nlptoolkit-classification 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +161 -0
- package/datasets/bupa.data +345 -0
- package/datasets/car.data +1728 -0
- package/datasets/chess.data +28056 -0
- package/datasets/dermatology.data +366 -0
- package/datasets/iris.data +150 -0
- package/datasets/nursery.data +12960 -0
- package/datasets/tictactoe.data +958 -0
- package/dist/Attribute/Attribute.d.ts +4 -0
- package/dist/Attribute/Attribute.js +17 -0
- package/dist/Attribute/Attribute.js.map +1 -0
- package/dist/Attribute/AttributeType.d.ts +18 -0
- package/dist/Attribute/AttributeType.js +33 -0
- package/dist/Attribute/AttributeType.js.map +1 -0
- package/dist/Attribute/BinaryAttribute.d.ts +9 -0
- package/dist/Attribute/BinaryAttribute.js +26 -0
- package/dist/Attribute/BinaryAttribute.js.map +1 -0
- package/dist/Attribute/ContinuousAttribute.d.ts +30 -0
- package/dist/Attribute/ContinuousAttribute.js +59 -0
- package/dist/Attribute/ContinuousAttribute.js.map +1 -0
- package/dist/Attribute/DiscreteAttribute.d.ts +24 -0
- package/dist/Attribute/DiscreteAttribute.js +53 -0
- package/dist/Attribute/DiscreteAttribute.js.map +1 -0
- package/dist/Attribute/DiscreteIndexedAttribute.d.ts +27 -0
- package/dist/Attribute/DiscreteIndexedAttribute.js +61 -0
- package/dist/Attribute/DiscreteIndexedAttribute.js.map +1 -0
- package/dist/Classifier/Bagging.d.ts +16 -0
- package/dist/Classifier/Bagging.js +42 -0
- package/dist/Classifier/Bagging.js.map +1 -0
- package/dist/Classifier/C45.d.ts +13 -0
- package/dist/Classifier/C45.js +40 -0
- package/dist/Classifier/C45.js.map +1 -0
- package/dist/Classifier/C45Stump.d.ts +12 -0
- package/dist/Classifier/C45Stump.js +29 -0
- package/dist/Classifier/C45Stump.js.map +1 -0
- package/dist/Classifier/Classifier.d.ts +39 -0
- package/dist/Classifier/Classifier.js +72 -0
- package/dist/Classifier/Classifier.js.map +1 -0
- package/dist/Classifier/DeepNetwork.d.ts +13 -0
- package/dist/Classifier/DeepNetwork.js +31 -0
- package/dist/Classifier/DeepNetwork.js.map +1 -0
- package/dist/Classifier/Dummy.d.ts +13 -0
- package/dist/Classifier/Dummy.js +29 -0
- package/dist/Classifier/Dummy.js.map +1 -0
- package/dist/Classifier/KMeans.d.ts +12 -0
- package/dist/Classifier/KMeans.js +36 -0
- package/dist/Classifier/KMeans.js.map +1 -0
- package/dist/Classifier/Knn.d.ts +13 -0
- package/dist/Classifier/Knn.js +29 -0
- package/dist/Classifier/Knn.js.map +1 -0
- package/dist/Classifier/Lda.d.ts +12 -0
- package/dist/Classifier/Lda.js +52 -0
- package/dist/Classifier/Lda.js.map +1 -0
- package/dist/Classifier/LinearPerceptron.d.ts +14 -0
- package/dist/Classifier/LinearPerceptron.js +32 -0
- package/dist/Classifier/LinearPerceptron.js.map +1 -0
- package/dist/Classifier/MultiLayerPerceptron.d.ts +14 -0
- package/dist/Classifier/MultiLayerPerceptron.js +32 -0
- package/dist/Classifier/MultiLayerPerceptron.js.map +1 -0
- package/dist/Classifier/NaiveBayes.d.ts +25 -0
- package/dist/Classifier/NaiveBayes.js +67 -0
- package/dist/Classifier/NaiveBayes.js.map +1 -0
- package/dist/Classifier/Qda.d.ts +12 -0
- package/dist/Classifier/Qda.js +50 -0
- package/dist/Classifier/Qda.js.map +1 -0
- package/dist/Classifier/RandomClassifier.d.ts +12 -0
- package/dist/Classifier/RandomClassifier.js +32 -0
- package/dist/Classifier/RandomClassifier.js.map +1 -0
- package/dist/Classifier/RandomForest.d.ts +13 -0
- package/dist/Classifier/RandomForest.js +39 -0
- package/dist/Classifier/RandomForest.js.map +1 -0
- package/dist/DataSet/DataDefinition.d.ts +59 -0
- package/dist/DataSet/DataDefinition.js +108 -0
- package/dist/DataSet/DataDefinition.js.map +1 -0
- package/dist/DataSet/DataSet.d.ts +111 -0
- package/dist/DataSet/DataSet.js +286 -0
- package/dist/DataSet/DataSet.js.map +1 -0
- package/dist/DistanceMetric/DistanceMetric.d.ts +4 -0
- package/dist/DistanceMetric/DistanceMetric.js +13 -0
- package/dist/DistanceMetric/DistanceMetric.js.map +1 -0
- package/dist/DistanceMetric/EuclidianDistance.d.ts +13 -0
- package/dist/DistanceMetric/EuclidianDistance.js +43 -0
- package/dist/DistanceMetric/EuclidianDistance.js.map +1 -0
- package/dist/DistanceMetric/MahalanobisDistance.d.ts +20 -0
- package/dist/DistanceMetric/MahalanobisDistance.js +39 -0
- package/dist/DistanceMetric/MahalanobisDistance.js.map +1 -0
- package/dist/Experiment/BootstrapRun.d.ts +19 -0
- package/dist/Experiment/BootstrapRun.js +44 -0
- package/dist/Experiment/BootstrapRun.js.map +1 -0
- package/dist/Experiment/Experiment.d.ts +37 -0
- package/dist/Experiment/Experiment.js +57 -0
- package/dist/Experiment/Experiment.js.map +1 -0
- package/dist/Experiment/KFoldRun.d.ts +19 -0
- package/dist/Experiment/KFoldRun.js +43 -0
- package/dist/Experiment/KFoldRun.js.map +1 -0
- package/dist/Experiment/KFoldRunSeparateTest.d.ts +24 -0
- package/dist/Experiment/KFoldRunSeparateTest.js +51 -0
- package/dist/Experiment/KFoldRunSeparateTest.js.map +1 -0
- package/dist/Experiment/MultipleRun.d.ts +5 -0
- package/dist/Experiment/MultipleRun.js +13 -0
- package/dist/Experiment/MultipleRun.js.map +1 -0
- package/dist/Experiment/MxKFoldRun.d.ts +20 -0
- package/dist/Experiment/MxKFoldRun.js +44 -0
- package/dist/Experiment/MxKFoldRun.js.map +1 -0
- package/dist/Experiment/MxKFoldRunSeparateTest.d.ts +21 -0
- package/dist/Experiment/MxKFoldRunSeparateTest.js +48 -0
- package/dist/Experiment/MxKFoldRunSeparateTest.js.map +1 -0
- package/dist/Experiment/SingleRun.d.ts +5 -0
- package/dist/Experiment/SingleRun.js +13 -0
- package/dist/Experiment/SingleRun.js.map +1 -0
- package/dist/Experiment/SingleRunWithK.d.ts +19 -0
- package/dist/Experiment/SingleRunWithK.js +37 -0
- package/dist/Experiment/SingleRunWithK.js.map +1 -0
- package/dist/Experiment/StratifiedKFoldRun.d.ts +17 -0
- package/dist/Experiment/StratifiedKFoldRun.js +39 -0
- package/dist/Experiment/StratifiedKFoldRun.js.map +1 -0
- package/dist/Experiment/StratifiedKFoldRunSeparateTest.d.ts +18 -0
- package/dist/Experiment/StratifiedKFoldRunSeparateTest.js +43 -0
- package/dist/Experiment/StratifiedKFoldRunSeparateTest.js.map +1 -0
- package/dist/Experiment/StratifiedMxKFoldRun.d.ts +19 -0
- package/dist/Experiment/StratifiedMxKFoldRun.js +43 -0
- package/dist/Experiment/StratifiedMxKFoldRun.js.map +1 -0
- package/dist/Experiment/StratifiedMxKFoldRunSeparateTest.d.ts +20 -0
- package/dist/Experiment/StratifiedMxKFoldRunSeparateTest.js +47 -0
- package/dist/Experiment/StratifiedMxKFoldRunSeparateTest.js.map +1 -0
- package/dist/Experiment/StratifiedSingleRunWithK.d.ts +18 -0
- package/dist/Experiment/StratifiedSingleRunWithK.js +39 -0
- package/dist/Experiment/StratifiedSingleRunWithK.js.map +1 -0
- package/dist/FeatureSelection/BackwardSelection.d.ts +18 -0
- package/dist/FeatureSelection/BackwardSelection.js +39 -0
- package/dist/FeatureSelection/BackwardSelection.js.map +1 -0
- package/dist/FeatureSelection/FeatureSubSet.d.ts +47 -0
- package/dist/FeatureSelection/FeatureSubSet.js +89 -0
- package/dist/FeatureSelection/FeatureSubSet.js.map +1 -0
- package/dist/FeatureSelection/FloatingSelection.d.ts +16 -0
- package/dist/FeatureSelection/FloatingSelection.js +38 -0
- package/dist/FeatureSelection/FloatingSelection.js.map +1 -0
- package/dist/FeatureSelection/ForwardSelection.d.ts +17 -0
- package/dist/FeatureSelection/ForwardSelection.js +38 -0
- package/dist/FeatureSelection/ForwardSelection.js.map +1 -0
- package/dist/FeatureSelection/SubSetSelection.d.ts +37 -0
- package/dist/FeatureSelection/SubSetSelection.js +90 -0
- package/dist/FeatureSelection/SubSetSelection.js.map +1 -0
- package/dist/Filter/DiscreteToContinuous.d.ts +25 -0
- package/dist/Filter/DiscreteToContinuous.js +69 -0
- package/dist/Filter/DiscreteToContinuous.js.map +1 -0
- package/dist/Filter/DiscreteToIndexed.d.ts +21 -0
- package/dist/Filter/DiscreteToIndexed.js +56 -0
- package/dist/Filter/DiscreteToIndexed.js.map +1 -0
- package/dist/Filter/FeatureFilter.d.ts +18 -0
- package/dist/Filter/FeatureFilter.js +36 -0
- package/dist/Filter/FeatureFilter.js.map +1 -0
- package/dist/Filter/LaryFilter.d.ts +27 -0
- package/dist/Filter/LaryFilter.js +62 -0
- package/dist/Filter/LaryFilter.js.map +1 -0
- package/dist/Filter/LaryToBinary.d.ts +23 -0
- package/dist/Filter/LaryToBinary.js +67 -0
- package/dist/Filter/LaryToBinary.js.map +1 -0
- package/dist/Filter/Normalize.d.ts +21 -0
- package/dist/Filter/Normalize.js +47 -0
- package/dist/Filter/Normalize.js.map +1 -0
- package/dist/Filter/Pca.d.ts +44 -0
- package/dist/Filter/Pca.js +109 -0
- package/dist/Filter/Pca.js.map +1 -0
- package/dist/Filter/TrainedFeatureFilter.d.ts +11 -0
- package/dist/Filter/TrainedFeatureFilter.js +26 -0
- package/dist/Filter/TrainedFeatureFilter.js.map +1 -0
- package/dist/Instance/CompositeInstance.d.ts +32 -0
- package/dist/Instance/CompositeInstance.js +61 -0
- package/dist/Instance/CompositeInstance.js.map +1 -0
- package/dist/Instance/Instance.d.ts +89 -0
- package/dist/Instance/Instance.js +170 -0
- package/dist/Instance/Instance.js.map +1 -0
- package/dist/InstanceList/InstanceList.d.ts +188 -0
- package/dist/InstanceList/InstanceList.js +517 -0
- package/dist/InstanceList/InstanceList.js.map +1 -0
- package/dist/InstanceList/InstanceListOfSameClass.d.ts +16 -0
- package/dist/InstanceList/InstanceListOfSameClass.js +35 -0
- package/dist/InstanceList/InstanceListOfSameClass.js.map +1 -0
- package/dist/InstanceList/Partition.d.ts +31 -0
- package/dist/InstanceList/Partition.js +143 -0
- package/dist/InstanceList/Partition.js.map +1 -0
- package/dist/Model/DecisionTree/DecisionCondition.d.ts +34 -0
- package/dist/Model/DecisionTree/DecisionCondition.js +84 -0
- package/dist/Model/DecisionTree/DecisionCondition.js.map +1 -0
- package/dist/Model/DecisionTree/DecisionNode.d.ts +82 -0
- package/dist/Model/DecisionTree/DecisionNode.js +271 -0
- package/dist/Model/DecisionTree/DecisionNode.js.map +1 -0
- package/dist/Model/DecisionTree/DecisionTree.d.ts +37 -0
- package/dist/Model/DecisionTree/DecisionTree.js +75 -0
- package/dist/Model/DecisionTree/DecisionTree.js.map +1 -0
- package/dist/Model/DeepNetworkModel.d.ts +42 -0
- package/dist/Model/DeepNetworkModel.js +163 -0
- package/dist/Model/DeepNetworkModel.js.map +1 -0
- package/dist/Model/DummyModel.d.ts +20 -0
- package/dist/Model/DummyModel.js +46 -0
- package/dist/Model/DummyModel.js.map +1 -0
- package/dist/Model/GaussianModel.d.ts +24 -0
- package/dist/Model/GaussianModel.js +59 -0
- package/dist/Model/GaussianModel.js.map +1 -0
- package/dist/Model/KMeansModel.d.ts +27 -0
- package/dist/Model/KMeansModel.js +48 -0
- package/dist/Model/KMeansModel.js.map +1 -0
- package/dist/Model/KnnInstance.d.ts +14 -0
- package/dist/Model/KnnInstance.js +33 -0
- package/dist/Model/KnnInstance.js.map +1 -0
- package/dist/Model/KnnModel.d.ts +36 -0
- package/dist/Model/KnnModel.js +83 -0
- package/dist/Model/KnnModel.js.map +1 -0
- package/dist/Model/LdaModel.d.ts +25 -0
- package/dist/Model/LdaModel.js +45 -0
- package/dist/Model/LdaModel.js.map +1 -0
- package/dist/Model/LinearPerceptronModel.d.ts +21 -0
- package/dist/Model/LinearPerceptronModel.js +62 -0
- package/dist/Model/LinearPerceptronModel.js.map +1 -0
- package/dist/Model/Model.d.ts +12 -0
- package/dist/Model/Model.js +31 -0
- package/dist/Model/Model.js.map +1 -0
- package/dist/Model/MultiLayerPerceptronModel.d.ts +29 -0
- package/dist/Model/MultiLayerPerceptronModel.js +101 -0
- package/dist/Model/MultiLayerPerceptronModel.js.map +1 -0
- package/dist/Model/NaiveBayesModel.d.ts +47 -0
- package/dist/Model/NaiveBayesModel.js +95 -0
- package/dist/Model/NaiveBayesModel.js.map +1 -0
- package/dist/Model/NeuralNetworkModel.d.ts +99 -0
- package/dist/Model/NeuralNetworkModel.js +180 -0
- package/dist/Model/NeuralNetworkModel.js.map +1 -0
- package/dist/Model/QdaModel.d.ts +26 -0
- package/dist/Model/QdaModel.js +45 -0
- package/dist/Model/QdaModel.js.map +1 -0
- package/dist/Model/RandomModel.d.ts +16 -0
- package/dist/Model/RandomModel.js +51 -0
- package/dist/Model/RandomModel.js.map +1 -0
- package/dist/Model/TreeEnsembleModel.d.ts +21 -0
- package/dist/Model/TreeEnsembleModel.js +49 -0
- package/dist/Model/TreeEnsembleModel.js.map +1 -0
- package/dist/Model/ValidatedModel.d.ts +12 -0
- package/dist/Model/ValidatedModel.js +35 -0
- package/dist/Model/ValidatedModel.js.map +1 -0
- package/dist/Parameter/ActivationFunction.d.ts +5 -0
- package/dist/Parameter/ActivationFunction.js +20 -0
- package/dist/Parameter/ActivationFunction.js.map +1 -0
- package/dist/Parameter/BaggingParameter.d.ts +17 -0
- package/dist/Parameter/BaggingParameter.js +36 -0
- package/dist/Parameter/BaggingParameter.js.map +1 -0
- package/dist/Parameter/C45Parameter.d.ts +25 -0
- package/dist/Parameter/C45Parameter.js +46 -0
- package/dist/Parameter/C45Parameter.js.map +1 -0
- package/dist/Parameter/DeepNetworkParameter.d.ts +38 -0
- package/dist/Parameter/DeepNetworkParameter.js +60 -0
- package/dist/Parameter/DeepNetworkParameter.js.map +1 -0
- package/dist/Parameter/KMeansParameter.d.ts +18 -0
- package/dist/Parameter/KMeansParameter.js +42 -0
- package/dist/Parameter/KMeansParameter.js.map +1 -0
- package/dist/Parameter/KnnParameter.d.ts +19 -0
- package/dist/Parameter/KnnParameter.js +37 -0
- package/dist/Parameter/KnnParameter.js.map +1 -0
- package/dist/Parameter/LinearPerceptronParameter.d.ts +41 -0
- package/dist/Parameter/LinearPerceptronParameter.js +66 -0
- package/dist/Parameter/LinearPerceptronParameter.js.map +1 -0
- package/dist/Parameter/MultiLayerPerceptronParameter.d.ts +30 -0
- package/dist/Parameter/MultiLayerPerceptronParameter.js +50 -0
- package/dist/Parameter/MultiLayerPerceptronParameter.js.map +1 -0
- package/dist/Parameter/Parameter.d.ts +15 -0
- package/dist/Parameter/Parameter.js +33 -0
- package/dist/Parameter/Parameter.js.map +1 -0
- package/dist/Parameter/RandomForestParameter.d.ts +18 -0
- package/dist/Parameter/RandomForestParameter.js +37 -0
- package/dist/Parameter/RandomForestParameter.js.map +1 -0
- package/dist/Performance/ClassificationPerformance.d.ts +17 -0
- package/dist/Performance/ClassificationPerformance.js +36 -0
- package/dist/Performance/ClassificationPerformance.js.map +1 -0
- package/dist/Performance/ConfusionMatrix.d.ts +81 -0
- package/dist/Performance/ConfusionMatrix.js +178 -0
- package/dist/Performance/ConfusionMatrix.js.map +1 -0
- package/dist/Performance/DetailedClassificationPerformance.d.ts +17 -0
- package/dist/Performance/DetailedClassificationPerformance.js +35 -0
- package/dist/Performance/DetailedClassificationPerformance.js.map +1 -0
- package/dist/Performance/ExperimentPerformance.d.ts +88 -0
- package/dist/Performance/ExperimentPerformance.js +176 -0
- package/dist/Performance/ExperimentPerformance.js.map +1 -0
- package/dist/Performance/Performance.d.ts +15 -0
- package/dist/Performance/Performance.js +33 -0
- package/dist/Performance/Performance.js.map +1 -0
- package/dist/StatisticalTest/Combined5x2F.d.ts +7 -0
- package/dist/StatisticalTest/Combined5x2F.js +43 -0
- package/dist/StatisticalTest/Combined5x2F.js.map +1 -0
- package/dist/StatisticalTest/Combined5x2t.d.ts +7 -0
- package/dist/StatisticalTest/Combined5x2t.js +43 -0
- package/dist/StatisticalTest/Combined5x2t.js.map +1 -0
- package/dist/StatisticalTest/Paired5x2t.d.ts +7 -0
- package/dist/StatisticalTest/Paired5x2t.js +42 -0
- package/dist/StatisticalTest/Paired5x2t.js.map +1 -0
- package/dist/StatisticalTest/PairedTest.d.ts +6 -0
- package/dist/StatisticalTest/PairedTest.js +35 -0
- package/dist/StatisticalTest/PairedTest.js.map +1 -0
- package/dist/StatisticalTest/Pairedt.d.ts +7 -0
- package/dist/StatisticalTest/Pairedt.js +40 -0
- package/dist/StatisticalTest/Pairedt.js.map +1 -0
- package/dist/StatisticalTest/Sign.d.ts +8 -0
- package/dist/StatisticalTest/Sign.js +52 -0
- package/dist/StatisticalTest/Sign.js.map +1 -0
- package/dist/StatisticalTest/StatisticalTestResult.d.ts +9 -0
- package/dist/StatisticalTest/StatisticalTestResult.js +53 -0
- package/dist/StatisticalTest/StatisticalTestResult.js.map +1 -0
- package/dist/StatisticalTest/StatisticalTestResultType.d.ts +7 -0
- package/dist/StatisticalTest/StatisticalTestResultType.js +22 -0
- package/dist/StatisticalTest/StatisticalTestResultType.js.map +1 -0
- package/index.js +100 -0
- package/package.json +30 -0
- package/source/Attribute/Attribute.ts +6 -0
- package/source/Attribute/AttributeType.ts +18 -0
- package/source/Attribute/BinaryAttribute.ts +14 -0
- package/source/Attribute/ContinuousAttribute.ts +53 -0
- package/source/Attribute/DiscreteAttribute.ts +46 -0
- package/source/Attribute/DiscreteIndexedAttribute.ts +54 -0
- package/source/Classifier/Bagging.ts +32 -0
- package/source/Classifier/C45.ts +30 -0
- package/source/Classifier/C45Stump.ts +19 -0
- package/source/Classifier/Classifier.ts +71 -0
- package/source/Classifier/DeepNetwork.ts +22 -0
- package/source/Classifier/Dummy.ts +19 -0
- package/source/Classifier/KMeans.ts +26 -0
- package/source/Classifier/Knn.ts +21 -0
- package/source/Classifier/Lda.ts +43 -0
- package/source/Classifier/LinearPerceptron.ts +23 -0
- package/source/Classifier/MultiLayerPerceptron.ts +23 -0
- package/source/Classifier/NaiveBayes.ts +62 -0
- package/source/Classifier/Qda.ts +42 -0
- package/source/Classifier/RandomClassifier.ts +22 -0
- package/source/Classifier/RandomForest.ts +29 -0
- package/source/DataSet/DataDefinition.ts +106 -0
- package/source/DataSet/DataSet.ts +279 -0
- package/source/DistanceMetric/DistanceMetric.ts +6 -0
- package/source/DistanceMetric/EuclidianDistance.ts +32 -0
- package/source/DistanceMetric/MahalanobisDistance.ts +33 -0
- package/source/Experiment/BootstrapRun.ts +37 -0
- package/source/Experiment/Experiment.ts +57 -0
- package/source/Experiment/KFoldRun.ts +44 -0
- package/source/Experiment/KFoldRunSeparateTest.ts +50 -0
- package/source/Experiment/MultipleRun.ts +7 -0
- package/source/Experiment/MxKFoldRun.ts +37 -0
- package/source/Experiment/MxKFoldRunSeparateTest.ts +40 -0
- package/source/Experiment/SingleRun.ts +7 -0
- package/source/Experiment/SingleRunWithK.ts +39 -0
- package/source/Experiment/StratifiedKFoldRun.ts +30 -0
- package/source/Experiment/StratifiedKFoldRunSeparateTest.ts +33 -0
- package/source/Experiment/StratifiedMxKFoldRun.ts +34 -0
- package/source/Experiment/StratifiedMxKFoldRunSeparateTest.ts +40 -0
- package/source/Experiment/StratifiedSingleRunWithK.ts +33 -0
- package/source/FeatureSelection/BackwardSelection.ts +28 -0
- package/source/FeatureSelection/FeatureSubSet.ts +82 -0
- package/source/FeatureSelection/FloatingSelection.ts +27 -0
- package/source/FeatureSelection/ForwardSelection.ts +27 -0
- package/source/FeatureSelection/SubSetSelection.ts +88 -0
- package/source/Filter/DiscreteToContinuous.ts +59 -0
- package/source/Filter/DiscreteToIndexed.ts +48 -0
- package/source/Filter/FeatureFilter.ts +31 -0
- package/source/Filter/LaryFilter.ts +54 -0
- package/source/Filter/LaryToBinary.ts +57 -0
- package/source/Filter/Normalize.ts +42 -0
- package/source/Filter/Pca.ts +104 -0
- package/source/Filter/TrainedFeatureFilter.ts +17 -0
- package/source/Instance/CompositeInstance.ts +53 -0
- package/source/Instance/Instance.ts +170 -0
- package/source/InstanceList/InstanceList.ts +519 -0
- package/source/InstanceList/InstanceListOfSameClass.ts +25 -0
- package/source/InstanceList/Partition.ts +131 -0
- package/source/Model/DecisionTree/DecisionCondition.ts +74 -0
- package/source/Model/DecisionTree/DecisionNode.ts +257 -0
- package/source/Model/DecisionTree/DecisionTree.ts +71 -0
- package/source/Model/DeepNetworkModel.ts +156 -0
- package/source/Model/DummyModel.ts +40 -0
- package/source/Model/GaussianModel.ts +58 -0
- package/source/Model/KMeansModel.ts +44 -0
- package/source/Model/KnnInstance.ts +27 -0
- package/source/Model/KnnModel.ts +78 -0
- package/source/Model/LdaModel.ts +39 -0
- package/source/Model/LinearPerceptronModel.ts +55 -0
- package/source/Model/Model.ts +22 -0
- package/source/Model/MultiLayerPerceptronModel.ts +95 -0
- package/source/Model/NaiveBayesModel.ts +89 -0
- package/source/Model/NeuralNetworkModel.ts +187 -0
- package/source/Model/QdaModel.ts +39 -0
- package/source/Model/RandomModel.ts +44 -0
- package/source/Model/TreeEnsembleModel.ts +43 -0
- package/source/Model/ValidatedModel.ts +23 -0
- package/source/Parameter/ActivationFunction.ts +3 -0
- package/source/Parameter/BaggingParameter.ts +26 -0
- package/source/Parameter/C45Parameter.ts +38 -0
- package/source/Parameter/DeepNetworkParameter.ts +59 -0
- package/source/Parameter/KMeansParameter.ts +33 -0
- package/source/Parameter/KnnParameter.ts +28 -0
- package/source/Parameter/LinearPerceptronParameter.ts +66 -0
- package/source/Parameter/MultiLayerPerceptronParameter.ts +49 -0
- package/source/Parameter/Parameter.ts +22 -0
- package/source/Parameter/RandomForestParameter.ts +27 -0
- package/source/Performance/ClassificationPerformance.ts +26 -0
- package/source/Performance/ConfusionMatrix.ts +175 -0
- package/source/Performance/DetailedClassificationPerformance.ts +26 -0
- package/source/Performance/ExperimentPerformance.ts +175 -0
- package/source/Performance/Performance.ts +22 -0
- package/source/StatisticalTest/Combined5x2F.ts +33 -0
- package/source/StatisticalTest/Combined5x2t.ts +33 -0
- package/source/StatisticalTest/Paired5x2t.ts +32 -0
- package/source/StatisticalTest/PairedTest.ts +24 -0
- package/source/StatisticalTest/Pairedt.ts +30 -0
- package/source/StatisticalTest/Sign.ts +41 -0
- package/source/StatisticalTest/StatisticalTestResult.ts +42 -0
- package/source/StatisticalTest/StatisticalTestResultType.ts +6 -0
- package/source/tsconfig.json +13 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FeatureSubSet = void 0;
|
|
13
|
+
class FeatureSubSet {
|
|
14
|
+
/**
|
|
15
|
+
* A constructor that takes number of features as input and initializes indexList with these numbers.
|
|
16
|
+
*
|
|
17
|
+
* @param numberOfFeaturesOrList Indicates the indices of indexList.
|
|
18
|
+
*/
|
|
19
|
+
constructor(numberOfFeaturesOrList) {
|
|
20
|
+
this.indexList = new Array();
|
|
21
|
+
if (numberOfFeaturesOrList != undefined) {
|
|
22
|
+
if (typeof numberOfFeaturesOrList == "number") {
|
|
23
|
+
for (let i = 0; i < numberOfFeaturesOrList; i++) {
|
|
24
|
+
this.indexList.push(i);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this.indexList = numberOfFeaturesOrList;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The clone method creates a new ArrayList with the elements of indexList and returns it as a new FeatureSubSet.
|
|
34
|
+
*
|
|
35
|
+
* @return A new ArrayList with the elements of indexList and returns it as a new FeatureSubSet.
|
|
36
|
+
*/
|
|
37
|
+
clone() {
|
|
38
|
+
let result = new FeatureSubSet(this.indexList.length);
|
|
39
|
+
for (let i = 0; i < this.indexList.length; i++) {
|
|
40
|
+
result.add(this.indexList[i]);
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The size method returns the size of the indexList.
|
|
46
|
+
*
|
|
47
|
+
* @return The size of the indexList.
|
|
48
|
+
*/
|
|
49
|
+
size() {
|
|
50
|
+
return this.indexList.length;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The get method returns the item of indexList at given index.
|
|
54
|
+
*
|
|
55
|
+
* @param index Index of the indexList to be accessed.
|
|
56
|
+
* @return The item of indexList at given index.
|
|
57
|
+
*/
|
|
58
|
+
get(index) {
|
|
59
|
+
return this.indexList[index];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The contains method returns True, if indexList contains given input number and False otherwise.
|
|
63
|
+
*
|
|
64
|
+
* @param featureNo Feature number that will be checked.
|
|
65
|
+
* @return True, if indexList contains given input number.
|
|
66
|
+
*/
|
|
67
|
+
contains(featureNo) {
|
|
68
|
+
return this.indexList.includes(featureNo);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The add method adds given Integer to the indexList.
|
|
72
|
+
*
|
|
73
|
+
* @param featureNo Integer that will be added to indexList.
|
|
74
|
+
*/
|
|
75
|
+
add(featureNo) {
|
|
76
|
+
this.indexList.push(featureNo);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The remove method removes the item of indexList at the given index.
|
|
80
|
+
*
|
|
81
|
+
* @param index Index of the item that will be removed.
|
|
82
|
+
*/
|
|
83
|
+
remove(index) {
|
|
84
|
+
this.indexList.splice(index, 1);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.FeatureSubSet = FeatureSubSet;
|
|
88
|
+
});
|
|
89
|
+
//# sourceMappingURL=FeatureSubSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureSubSet.js","sourceRoot":"","sources":["../../source/FeatureSelection/FeatureSubSet.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,MAAa,aAAa;QAItB;;;;WAIG;QACH,YAAY,sBAA4B;YAPvB,cAAS,GAAkB,IAAI,KAAK,EAAU,CAAA;YAQ3D,IAAI,sBAAsB,IAAI,SAAS,EAAC;gBACpC,IAAI,OAAO,sBAAsB,IAAI,QAAQ,EAAC;oBAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,sBAAsB,EAAE,CAAC,EAAE,EAAE;wBAC7C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;qBAC1B;iBACJ;qBAAM;oBACH,IAAI,CAAC,SAAS,GAAG,sBAAsB,CAAA;iBAC1C;aACJ;QACL,CAAC;QAED;;;;WAIG;QACH,KAAK;YACD,IAAI,MAAM,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;YACrD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAC;gBAC3C,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;aAChC;YACD,OAAO,MAAM,CAAA;QACjB,CAAC;QAED;;;;WAIG;QACH,IAAI;YACA,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAA;QAChC,CAAC;QAED;;;;;WAKG;QACH,GAAG,CAAC,KAAa;YACb,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;QAChC,CAAC;QAED;;;;;WAKG;QACH,QAAQ,CAAC,SAAiB;YACtB,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;QAC7C,CAAC;QAED;;;;WAIG;QACH,GAAG,CAAC,SAAiB;YACjB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAClC,CAAC;QAED;;;;WAIG;QACH,MAAM,CAAC,KAAa;YAChB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACnC,CAAC;KAEJ;IAjFD,sCAiFC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SubSetSelection } from "./SubSetSelection";
|
|
2
|
+
import { FeatureSubSet } from "./FeatureSubSet";
|
|
3
|
+
export declare class FloatingSelection extends SubSetSelection {
|
|
4
|
+
/**
|
|
5
|
+
* Constructor that creates a new {@link FeatureSubSet}.
|
|
6
|
+
*/
|
|
7
|
+
constructor();
|
|
8
|
+
/**
|
|
9
|
+
* The operator method calls forward and backward methods.
|
|
10
|
+
*
|
|
11
|
+
* @param current {@link FeatureSubSet} input.
|
|
12
|
+
* @param numberOfFeatures Indicates the indices of indexList.
|
|
13
|
+
* @return ArrayList of FeatureSubSet.
|
|
14
|
+
*/
|
|
15
|
+
protected operator(current: FeatureSubSet, numberOfFeatures: number): Array<FeatureSubSet>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "./SubSetSelection", "./FeatureSubSet"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FloatingSelection = void 0;
|
|
13
|
+
const SubSetSelection_1 = require("./SubSetSelection");
|
|
14
|
+
const FeatureSubSet_1 = require("./FeatureSubSet");
|
|
15
|
+
class FloatingSelection extends SubSetSelection_1.SubSetSelection {
|
|
16
|
+
/**
|
|
17
|
+
* Constructor that creates a new {@link FeatureSubSet}.
|
|
18
|
+
*/
|
|
19
|
+
constructor() {
|
|
20
|
+
super(new FeatureSubSet_1.FeatureSubSet());
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The operator method calls forward and backward methods.
|
|
24
|
+
*
|
|
25
|
+
* @param current {@link FeatureSubSet} input.
|
|
26
|
+
* @param numberOfFeatures Indicates the indices of indexList.
|
|
27
|
+
* @return ArrayList of FeatureSubSet.
|
|
28
|
+
*/
|
|
29
|
+
operator(current, numberOfFeatures) {
|
|
30
|
+
let result = new Array();
|
|
31
|
+
this.forward(result, current, numberOfFeatures);
|
|
32
|
+
this.backward(result, current);
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.FloatingSelection = FloatingSelection;
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=FloatingSelection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingSelection.js","sourceRoot":"","sources":["../../source/FeatureSelection/FloatingSelection.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,uDAAkD;IAClD,mDAA8C;IAE9C,MAAa,iBAAkB,SAAQ,iCAAe;QAElD;;WAEG;QACH;YACI,KAAK,CAAC,IAAI,6BAAa,EAAE,CAAC,CAAC;QAC/B,CAAC;QAED;;;;;;WAMG;QACO,QAAQ,CAAC,OAAsB,EAAE,gBAAwB;YAC/D,IAAI,MAAM,GAAG,IAAI,KAAK,EAAiB,CAAC;YACxC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC;YAChD,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAC/B,OAAO,MAAM,CAAC;QAClB,CAAC;KAEJ;IAvBD,8CAuBC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SubSetSelection } from "./SubSetSelection";
|
|
2
|
+
import { FeatureSubSet } from "./FeatureSubSet";
|
|
3
|
+
export declare class ForwardSelection extends SubSetSelection {
|
|
4
|
+
/**
|
|
5
|
+
* Constructor that creates a new {@link FeatureSubSet}.
|
|
6
|
+
*/
|
|
7
|
+
constructor();
|
|
8
|
+
/**
|
|
9
|
+
* The operator method calls forward method which starts with having no feature in the model. In each iteration,
|
|
10
|
+
* it keeps adding the features that are not currently listed.
|
|
11
|
+
*
|
|
12
|
+
* @param current FeatureSubset that will be added to new ArrayList.
|
|
13
|
+
* @param numberOfFeatures Indicates the indices of indexList.
|
|
14
|
+
* @return ArrayList of FeatureSubSets created from forward.
|
|
15
|
+
*/
|
|
16
|
+
protected operator(current: FeatureSubSet, numberOfFeatures: number): Array<FeatureSubSet>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "./SubSetSelection", "./FeatureSubSet"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ForwardSelection = void 0;
|
|
13
|
+
const SubSetSelection_1 = require("./SubSetSelection");
|
|
14
|
+
const FeatureSubSet_1 = require("./FeatureSubSet");
|
|
15
|
+
class ForwardSelection extends SubSetSelection_1.SubSetSelection {
|
|
16
|
+
/**
|
|
17
|
+
* Constructor that creates a new {@link FeatureSubSet}.
|
|
18
|
+
*/
|
|
19
|
+
constructor() {
|
|
20
|
+
super(new FeatureSubSet_1.FeatureSubSet());
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The operator method calls forward method which starts with having no feature in the model. In each iteration,
|
|
24
|
+
* it keeps adding the features that are not currently listed.
|
|
25
|
+
*
|
|
26
|
+
* @param current FeatureSubset that will be added to new ArrayList.
|
|
27
|
+
* @param numberOfFeatures Indicates the indices of indexList.
|
|
28
|
+
* @return ArrayList of FeatureSubSets created from forward.
|
|
29
|
+
*/
|
|
30
|
+
operator(current, numberOfFeatures) {
|
|
31
|
+
let result = new Array();
|
|
32
|
+
this.forward(result, current, numberOfFeatures);
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.ForwardSelection = ForwardSelection;
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=ForwardSelection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ForwardSelection.js","sourceRoot":"","sources":["../../source/FeatureSelection/ForwardSelection.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,uDAAkD;IAClD,mDAA8C;IAE9C,MAAa,gBAAiB,SAAQ,iCAAe;QAEjD;;WAEG;QACH;YACI,KAAK,CAAC,IAAI,6BAAa,EAAE,CAAC,CAAC;QAC/B,CAAC;QAED;;;;;;;WAOG;QACO,QAAQ,CAAC,OAAsB,EAAE,gBAAwB;YAC/D,IAAI,MAAM,GAAG,IAAI,KAAK,EAAiB,CAAC;YACxC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC;YAChD,OAAO,MAAM,CAAC;QAClB,CAAC;KAEJ;IAvBD,4CAuBC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FeatureSubSet } from "./FeatureSubSet";
|
|
2
|
+
import { MultipleRun } from "../Experiment/MultipleRun";
|
|
3
|
+
import { Experiment } from "../Experiment/Experiment";
|
|
4
|
+
export declare abstract class SubSetSelection {
|
|
5
|
+
protected initialSubSet: FeatureSubSet;
|
|
6
|
+
protected abstract operator(current: FeatureSubSet, numberOfFeatures: number): Array<FeatureSubSet>;
|
|
7
|
+
/**
|
|
8
|
+
* A constructor that sets the initial subset with given input.
|
|
9
|
+
*
|
|
10
|
+
* @param initialSubSet {@link FeatureSubSet} input.
|
|
11
|
+
*/
|
|
12
|
+
protected constructor(initialSubSet: FeatureSubSet);
|
|
13
|
+
/**
|
|
14
|
+
* The forward method starts with having no feature in the model. In each iteration, it keeps adding the features that are not currently listed.
|
|
15
|
+
*
|
|
16
|
+
* @param currentSubSetList ArrayList to add the FeatureSubsets.
|
|
17
|
+
* @param current FeatureSubset that will be added to currentSubSetList.
|
|
18
|
+
* @param numberOfFeatures The number of features to add the subset.
|
|
19
|
+
*/
|
|
20
|
+
protected forward(currentSubSetList: Array<FeatureSubSet>, current: FeatureSubSet, numberOfFeatures: number): void;
|
|
21
|
+
/**
|
|
22
|
+
* The backward method starts with all the features and removes the least significant feature at each iteration.
|
|
23
|
+
*
|
|
24
|
+
* @param currentSubSetList ArrayList to add the FeatureSubsets.
|
|
25
|
+
* @param current FeatureSubset that will be added to currentSubSetList
|
|
26
|
+
*/
|
|
27
|
+
protected backward(currentSubSetList: Array<FeatureSubSet>, current: FeatureSubSet): void;
|
|
28
|
+
/**
|
|
29
|
+
* The execute method takes an {@link Experiment} and a {@link MultipleRun} as inputs. By selecting a candidateList from given
|
|
30
|
+
* Experiment it tries to find a FeatureSubSet that gives best performance.
|
|
31
|
+
*
|
|
32
|
+
* @param multipleRun {@link MultipleRun} type input.
|
|
33
|
+
* @param experiment {@link Experiment} type input.
|
|
34
|
+
* @return FeatureSubSet that gives best performance.
|
|
35
|
+
*/
|
|
36
|
+
execute(multipleRun: MultipleRun, experiment: Experiment): FeatureSubSet;
|
|
37
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SubSetSelection = void 0;
|
|
13
|
+
class SubSetSelection {
|
|
14
|
+
/**
|
|
15
|
+
* A constructor that sets the initial subset with given input.
|
|
16
|
+
*
|
|
17
|
+
* @param initialSubSet {@link FeatureSubSet} input.
|
|
18
|
+
*/
|
|
19
|
+
constructor(initialSubSet) {
|
|
20
|
+
this.initialSubSet = initialSubSet;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The forward method starts with having no feature in the model. In each iteration, it keeps adding the features that are not currently listed.
|
|
24
|
+
*
|
|
25
|
+
* @param currentSubSetList ArrayList to add the FeatureSubsets.
|
|
26
|
+
* @param current FeatureSubset that will be added to currentSubSetList.
|
|
27
|
+
* @param numberOfFeatures The number of features to add the subset.
|
|
28
|
+
*/
|
|
29
|
+
forward(currentSubSetList, current, numberOfFeatures) {
|
|
30
|
+
for (let i = 0; i < numberOfFeatures; i++) {
|
|
31
|
+
if (!current.contains(i)) {
|
|
32
|
+
let candidate = current.clone();
|
|
33
|
+
candidate.add(i);
|
|
34
|
+
currentSubSetList.push(candidate);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The backward method starts with all the features and removes the least significant feature at each iteration.
|
|
40
|
+
*
|
|
41
|
+
* @param currentSubSetList ArrayList to add the FeatureSubsets.
|
|
42
|
+
* @param current FeatureSubset that will be added to currentSubSetList
|
|
43
|
+
*/
|
|
44
|
+
backward(currentSubSetList, current) {
|
|
45
|
+
for (let i = 0; i < current.size(); i++) {
|
|
46
|
+
let candidate = current.clone();
|
|
47
|
+
candidate.remove(i);
|
|
48
|
+
currentSubSetList.push(candidate);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The execute method takes an {@link Experiment} and a {@link MultipleRun} as inputs. By selecting a candidateList from given
|
|
53
|
+
* Experiment it tries to find a FeatureSubSet that gives best performance.
|
|
54
|
+
*
|
|
55
|
+
* @param multipleRun {@link MultipleRun} type input.
|
|
56
|
+
* @param experiment {@link Experiment} type input.
|
|
57
|
+
* @return FeatureSubSet that gives best performance.
|
|
58
|
+
*/
|
|
59
|
+
execute(multipleRun, experiment) {
|
|
60
|
+
let processed = new Set();
|
|
61
|
+
let best = this.initialSubSet;
|
|
62
|
+
processed.add(best);
|
|
63
|
+
let betterFound = true;
|
|
64
|
+
let bestPerformance = undefined, currentPerformance;
|
|
65
|
+
if (best.size() > 0) {
|
|
66
|
+
bestPerformance = multipleRun.execute(experiment.featureSelectedExperiment(best));
|
|
67
|
+
}
|
|
68
|
+
while (betterFound) {
|
|
69
|
+
betterFound = false;
|
|
70
|
+
let candidateList = this.operator(best, experiment.getDataSet().getDataDefinition().attributeCount());
|
|
71
|
+
for (let candidateSubSet of candidateList) {
|
|
72
|
+
if (!processed.has(candidateSubSet)) {
|
|
73
|
+
if (candidateSubSet.size() > 0) {
|
|
74
|
+
currentPerformance = multipleRun.execute(experiment.featureSelectedExperiment(candidateSubSet));
|
|
75
|
+
if (bestPerformance == null || currentPerformance.isBetter(bestPerformance)) {
|
|
76
|
+
best = candidateSubSet;
|
|
77
|
+
bestPerformance = currentPerformance;
|
|
78
|
+
betterFound = true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
processed.add(candidateSubSet);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return best;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.SubSetSelection = SubSetSelection;
|
|
89
|
+
});
|
|
90
|
+
//# sourceMappingURL=SubSetSelection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubSetSelection.js","sourceRoot":"","sources":["../../source/FeatureSelection/SubSetSelection.ts"],"names":[],"mappings":";;;;;;;;;;;;IAIA,MAAsB,eAAe;QAMjC;;;;WAIG;QACH,YAAsB,aAA4B;YAC9C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QACtC,CAAC;QAED;;;;;;WAMG;QACO,OAAO,CAAC,iBAAuC,EAAE,OAAsB,EAAE,gBAAwB;YACvG,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,gBAAgB,EAAE,CAAC,EAAE,EAAE;gBACvC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;oBACtB,IAAI,SAAS,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;oBAChC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;oBACjB,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;iBACrC;aACJ;QACL,CAAC;QAED;;;;;WAKG;QACO,QAAQ,CAAC,iBAAuC,EAAE,OAAsB;YAC9E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE;gBACrC,IAAI,SAAS,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;gBAChC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBACpB,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aACrC;QACL,CAAC;QAED;;;;;;;WAOG;QACH,OAAO,CAAC,WAAwB,EAAE,UAAsB;YACpD,IAAI,SAAS,GAAG,IAAI,GAAG,EAAiB,CAAC;YACzC,IAAI,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC;YAC9B,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACpB,IAAI,WAAW,GAAG,IAAI,CAAC;YACvB,IAAI,eAAe,GAAG,SAAS,EAAE,kBAAkB,CAAC;YACpD,IAAI,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,EAAC;gBAChB,eAAe,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAC;aACrF;YACD,OAAO,WAAW,EAAE;gBAChB,WAAW,GAAG,KAAK,CAAC;gBACpB,IAAI,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,UAAU,EAAE,CAAC,iBAAiB,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC;gBACtG,KAAK,IAAI,eAAe,IAAI,aAAa,EAAE;oBACvC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE;wBACjC,IAAI,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,EAAC;4BAC3B,kBAAkB,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,yBAAyB,CAAC,eAAe,CAAC,CAAC,CAAC;4BAChG,IAAI,eAAe,IAAI,IAAI,IAAI,kBAAkB,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE;gCACzE,IAAI,GAAG,eAAe,CAAC;gCACvB,eAAe,GAAG,kBAAkB,CAAC;gCACrC,WAAW,GAAG,IAAI,CAAC;6BACtB;yBACJ;wBACD,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;qBAClC;iBACJ;aACJ;YACD,OAAO,IAAI,CAAC;QAChB,CAAC;KAEJ;IAnFD,0CAmFC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LaryFilter } from "./LaryFilter";
|
|
2
|
+
import { Instance } from "../Instance/Instance";
|
|
3
|
+
import { DataSet } from "../DataSet/DataSet";
|
|
4
|
+
export declare class DiscreteToContinuous extends LaryFilter {
|
|
5
|
+
/**
|
|
6
|
+
* Converts the data definition with discrete attributes, to data definition with continuous attributes. Basically,
|
|
7
|
+
* for each discrete attribute with L possible values, L more continuous attributes will be added.
|
|
8
|
+
*/
|
|
9
|
+
convertDataDefinition(): void;
|
|
10
|
+
/**
|
|
11
|
+
* Converts discrete attributes of a single instance to continuous version using 1-of-L encoding. For example, if
|
|
12
|
+
* an attribute has values red, green, blue; this attribute will be converted to 3 continuous attributes where
|
|
13
|
+
* red will have the value 100, green will have the value 010, and blue will have the value 001.
|
|
14
|
+
*
|
|
15
|
+
* @param instance The instance to be converted.
|
|
16
|
+
*/
|
|
17
|
+
convertInstance(instance: Instance): void;
|
|
18
|
+
/**
|
|
19
|
+
* Constructor for discrete to continuous filter.
|
|
20
|
+
*
|
|
21
|
+
* @param dataSet The dataSet whose instances whose discrete attributes will be converted to continuous attributes using
|
|
22
|
+
* 1-of-L encoding.
|
|
23
|
+
*/
|
|
24
|
+
constructor(dataSet: DataSet);
|
|
25
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "./LaryFilter", "../Attribute/ContinuousAttribute", "../Attribute/AttributeType"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DiscreteToContinuous = void 0;
|
|
13
|
+
const LaryFilter_1 = require("./LaryFilter");
|
|
14
|
+
const ContinuousAttribute_1 = require("../Attribute/ContinuousAttribute");
|
|
15
|
+
const AttributeType_1 = require("../Attribute/AttributeType");
|
|
16
|
+
class DiscreteToContinuous extends LaryFilter_1.LaryFilter {
|
|
17
|
+
/**
|
|
18
|
+
* Converts the data definition with discrete attributes, to data definition with continuous attributes. Basically,
|
|
19
|
+
* for each discrete attribute with L possible values, L more continuous attributes will be added.
|
|
20
|
+
*/
|
|
21
|
+
convertDataDefinition() {
|
|
22
|
+
let dataDefinition = this.dataSet.getDataDefinition();
|
|
23
|
+
let size = dataDefinition.attributeCount();
|
|
24
|
+
for (let i = 0; i < size; i++) {
|
|
25
|
+
if (this.attributeDistributions[i].size > 0) {
|
|
26
|
+
for (let j = 0; j < this.attributeDistributions[i].size; j++) {
|
|
27
|
+
dataDefinition.addAttribute(AttributeType_1.AttributeType.CONTINUOUS);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
this.removeDiscreteAttributesFromDataDefinition(size);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Converts discrete attributes of a single instance to continuous version using 1-of-L encoding. For example, if
|
|
35
|
+
* an attribute has values red, green, blue; this attribute will be converted to 3 continuous attributes where
|
|
36
|
+
* red will have the value 100, green will have the value 010, and blue will have the value 001.
|
|
37
|
+
*
|
|
38
|
+
* @param instance The instance to be converted.
|
|
39
|
+
*/
|
|
40
|
+
convertInstance(instance) {
|
|
41
|
+
let size = instance.attributeSize();
|
|
42
|
+
for (let i = 0; i < size; i++) {
|
|
43
|
+
if (this.attributeDistributions[i].size > 0) {
|
|
44
|
+
let index = this.attributeDistributions[i].getIndex(instance.getAttribute(i).toString());
|
|
45
|
+
for (let j = 0; j < this.attributeDistributions[i].size; j++) {
|
|
46
|
+
if (j != index) {
|
|
47
|
+
instance.addAttribute(new ContinuousAttribute_1.ContinuousAttribute(0));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
instance.addAttribute(new ContinuousAttribute_1.ContinuousAttribute(1));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
this.removeDiscreteAttributesFromInstance(instance, size);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Constructor for discrete to continuous filter.
|
|
59
|
+
*
|
|
60
|
+
* @param dataSet The dataSet whose instances whose discrete attributes will be converted to continuous attributes using
|
|
61
|
+
* 1-of-L encoding.
|
|
62
|
+
*/
|
|
63
|
+
constructor(dataSet) {
|
|
64
|
+
super(dataSet);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.DiscreteToContinuous = DiscreteToContinuous;
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=DiscreteToContinuous.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscreteToContinuous.js","sourceRoot":"","sources":["../../source/Filter/DiscreteToContinuous.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6CAAwC;IAGxC,0EAAqE;IACrE,8DAAyD;IAEzD,MAAa,oBAAqB,SAAQ,uBAAU;QAEhD;;;WAGG;QACH,qBAAqB;YACjB,IAAI,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;YACtD,IAAI,IAAI,GAAG,cAAc,CAAC,cAAc,EAAE,CAAC;YAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;gBAC3B,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,EAAE;oBACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;wBAC1D,cAAc,CAAC,YAAY,CAAC,6BAAa,CAAC,UAAU,CAAC,CAAC;qBACzD;iBACJ;aACJ;YACD,IAAI,CAAC,0CAA0C,CAAC,IAAI,CAAC,CAAC;QAC1D,CAAC;QAED;;;;;;WAMG;QACH,eAAe,CAAC,QAAkB;YAC9B,IAAI,IAAI,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC;YACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;gBAC3B,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,EAAE;oBACzC,IAAI,KAAK,GAAG,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;oBACzF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;wBAC1D,IAAI,CAAC,IAAI,KAAK,EAAE;4BACZ,QAAQ,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;yBACrD;6BAAM;4BACH,QAAQ,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;yBACrD;qBACJ;iBACJ;aACJ;YACD,IAAI,CAAC,oCAAoC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC9D,CAAC;QAED;;;;;WAKG;QACH,YAAY,OAAgB;YACxB,KAAK,CAAC,OAAO,CAAC,CAAC;QACnB,CAAC;KACJ;IApDD,oDAoDC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LaryFilter } from "./LaryFilter";
|
|
2
|
+
import { Instance } from "../Instance/Instance";
|
|
3
|
+
import { DataSet } from "../DataSet/DataSet";
|
|
4
|
+
export declare class DiscreteToIndexed extends LaryFilter {
|
|
5
|
+
/**
|
|
6
|
+
* Converts the data definition with discrete attributes, to data definition with DISCRETE_INDEXED attributes.
|
|
7
|
+
*/
|
|
8
|
+
convertDataDefinition(): void;
|
|
9
|
+
/**
|
|
10
|
+
* Converts discrete attributes of a single instance to indexed version.
|
|
11
|
+
*
|
|
12
|
+
* @param instance The instance to be converted.
|
|
13
|
+
*/
|
|
14
|
+
convertInstance(instance: Instance): void;
|
|
15
|
+
/**
|
|
16
|
+
* Constructor for discrete to indexed filter.
|
|
17
|
+
*
|
|
18
|
+
* @param dataSet The dataSet whose instances whose discrete attributes will be converted to indexed attributes
|
|
19
|
+
*/
|
|
20
|
+
constructor(dataSet: DataSet);
|
|
21
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "./LaryFilter", "../Attribute/DiscreteIndexedAttribute", "../Attribute/AttributeType"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DiscreteToIndexed = void 0;
|
|
13
|
+
const LaryFilter_1 = require("./LaryFilter");
|
|
14
|
+
const DiscreteIndexedAttribute_1 = require("../Attribute/DiscreteIndexedAttribute");
|
|
15
|
+
const AttributeType_1 = require("../Attribute/AttributeType");
|
|
16
|
+
class DiscreteToIndexed extends LaryFilter_1.LaryFilter {
|
|
17
|
+
/**
|
|
18
|
+
* Converts the data definition with discrete attributes, to data definition with DISCRETE_INDEXED attributes.
|
|
19
|
+
*/
|
|
20
|
+
convertDataDefinition() {
|
|
21
|
+
let dataDefinition = this.dataSet.getDataDefinition();
|
|
22
|
+
let size = dataDefinition.attributeCount();
|
|
23
|
+
for (let i = 0; i < size; i++) {
|
|
24
|
+
if (this.attributeDistributions[i].size > 0) {
|
|
25
|
+
dataDefinition.addAttribute(AttributeType_1.AttributeType.DISCRETE_INDEXED);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
this.removeDiscreteAttributesFromDataDefinition(size);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Converts discrete attributes of a single instance to indexed version.
|
|
32
|
+
*
|
|
33
|
+
* @param instance The instance to be converted.
|
|
34
|
+
*/
|
|
35
|
+
convertInstance(instance) {
|
|
36
|
+
let size = instance.attributeSize();
|
|
37
|
+
for (let i = 0; i < size; i++) {
|
|
38
|
+
if (this.attributeDistributions[i].size > 0) {
|
|
39
|
+
let index = this.attributeDistributions[i].getIndex(instance.getAttribute(i).toString());
|
|
40
|
+
instance.addAttribute(new DiscreteIndexedAttribute_1.DiscreteIndexedAttribute(instance.getAttribute(i).toString(), index, this.attributeDistributions[i].size));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
this.removeDiscreteAttributesFromInstance(instance, size);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Constructor for discrete to indexed filter.
|
|
47
|
+
*
|
|
48
|
+
* @param dataSet The dataSet whose instances whose discrete attributes will be converted to indexed attributes
|
|
49
|
+
*/
|
|
50
|
+
constructor(dataSet) {
|
|
51
|
+
super(dataSet);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.DiscreteToIndexed = DiscreteToIndexed;
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=DiscreteToIndexed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscreteToIndexed.js","sourceRoot":"","sources":["../../source/Filter/DiscreteToIndexed.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6CAAwC;IAGxC,oFAA+E;IAC/E,8DAAyD;IAEzD,MAAa,iBAAkB,SAAQ,uBAAU;QAE7C;;WAEG;QACH,qBAAqB;YACjB,IAAI,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;YACtD,IAAI,IAAI,GAAG,cAAc,CAAC,cAAc,EAAE,CAAC;YAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;gBAC3B,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,EAAE;oBACzC,cAAc,CAAC,YAAY,CAAC,6BAAa,CAAC,gBAAgB,CAAC,CAAC;iBAC/D;aACJ;YACD,IAAI,CAAC,0CAA0C,CAAC,IAAI,CAAC,CAAC;QAC1D,CAAC;QAED;;;;WAIG;QACH,eAAe,CAAC,QAAkB;YAC9B,IAAI,IAAI,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC;YACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;gBAC3B,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,EAAE;oBACzC,IAAI,KAAK,GAAG,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;oBACzF,QAAQ,CAAC,YAAY,CAAC,IAAI,mDAAwB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,KAAK,EACzF,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;iBAC7C;aACJ;YACD,IAAI,CAAC,oCAAoC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC9D,CAAC;QAED;;;;WAIG;QACH,YAAY,OAAgB;YACxB,KAAK,CAAC,OAAO,CAAC,CAAC;QACnB,CAAC;KACJ;IAzCD,8CAyCC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DataSet } from "../DataSet/DataSet";
|
|
2
|
+
import { Instance } from "../Instance/Instance";
|
|
3
|
+
export declare abstract class FeatureFilter {
|
|
4
|
+
protected dataSet: DataSet;
|
|
5
|
+
abstract convertInstance(instance: Instance): void;
|
|
6
|
+
abstract convertDataDefinition(): void;
|
|
7
|
+
/**
|
|
8
|
+
* Constructor that sets the dataSet.
|
|
9
|
+
*
|
|
10
|
+
* @param dataSet DataSet that will bu used.
|
|
11
|
+
*/
|
|
12
|
+
constructor(dataSet: DataSet);
|
|
13
|
+
/**
|
|
14
|
+
* Feature converter for a list of instances. Using the abstract method convertInstance, each instance in the
|
|
15
|
+
* instance list will be converted.
|
|
16
|
+
*/
|
|
17
|
+
convert(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FeatureFilter = void 0;
|
|
13
|
+
class FeatureFilter {
|
|
14
|
+
/**
|
|
15
|
+
* Constructor that sets the dataSet.
|
|
16
|
+
*
|
|
17
|
+
* @param dataSet DataSet that will bu used.
|
|
18
|
+
*/
|
|
19
|
+
constructor(dataSet) {
|
|
20
|
+
this.dataSet = dataSet;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Feature converter for a list of instances. Using the abstract method convertInstance, each instance in the
|
|
24
|
+
* instance list will be converted.
|
|
25
|
+
*/
|
|
26
|
+
convert() {
|
|
27
|
+
let instances = this.dataSet.getInstances();
|
|
28
|
+
for (let instance of instances) {
|
|
29
|
+
this.convertInstance(instance);
|
|
30
|
+
}
|
|
31
|
+
this.convertDataDefinition();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.FeatureFilter = FeatureFilter;
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=FeatureFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureFilter.js","sourceRoot":"","sources":["../../source/Filter/FeatureFilter.ts"],"names":[],"mappings":";;;;;;;;;;;;IAGA,MAAsB,aAAa;QAO/B;;;;WAIG;QACH,YAAY,OAAgB;YACxB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QAC1B,CAAC;QAED;;;WAGG;QACH,OAAO;YACH,IAAI,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;YAC5C,KAAK,IAAI,QAAQ,IAAI,SAAS,EAAE;gBAC5B,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;aAClC;YACD,IAAI,CAAC,qBAAqB,EAAE,CAAC;QACjC,CAAC;KACJ;IA3BD,sCA2BC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FeatureFilter } from "./FeatureFilter";
|
|
2
|
+
import { DiscreteDistribution } from "nlptoolkit-math/dist/DiscreteDistribution";
|
|
3
|
+
import { DataSet } from "../DataSet/DataSet";
|
|
4
|
+
import { Instance } from "../Instance/Instance";
|
|
5
|
+
export declare abstract class LaryFilter extends FeatureFilter {
|
|
6
|
+
protected attributeDistributions: Array<DiscreteDistribution>;
|
|
7
|
+
/**
|
|
8
|
+
* Constructor that sets the dataSet and all the attributes distributions.
|
|
9
|
+
*
|
|
10
|
+
* @param dataSet DataSet that will bu used.
|
|
11
|
+
*/
|
|
12
|
+
constructor(dataSet: DataSet);
|
|
13
|
+
/**
|
|
14
|
+
* The removeDiscreteAttributes method takes an {@link Instance} as an input, and removes the discrete attributes from
|
|
15
|
+
* given instance.
|
|
16
|
+
*
|
|
17
|
+
* @param instance Instance to removes attributes from.
|
|
18
|
+
* @param size Size of the given instance.
|
|
19
|
+
*/
|
|
20
|
+
protected removeDiscreteAttributesFromInstance(instance: Instance, size: number): void;
|
|
21
|
+
/**
|
|
22
|
+
* The removeDiscreteAttributes method removes the discrete attributes from dataDefinition.
|
|
23
|
+
*
|
|
24
|
+
* @param size Size of item that attributes will be removed.
|
|
25
|
+
*/
|
|
26
|
+
protected removeDiscreteAttributesFromDataDefinition(size: number): void;
|
|
27
|
+
}
|