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,17 @@
|
|
|
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.Attribute = void 0;
|
|
13
|
+
class Attribute {
|
|
14
|
+
}
|
|
15
|
+
exports.Attribute = Attribute;
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=Attribute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Attribute.js","sourceRoot":"","sources":["../../source/Attribute/Attribute.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,MAAsB,SAAS;KAK9B;IALD,8BAKC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare enum AttributeType {
|
|
2
|
+
/**
|
|
3
|
+
* Continuous Attribute
|
|
4
|
+
*/
|
|
5
|
+
CONTINUOUS = 0,
|
|
6
|
+
/**
|
|
7
|
+
* Discrete Attribute
|
|
8
|
+
*/
|
|
9
|
+
DISCRETE = 1,
|
|
10
|
+
/**
|
|
11
|
+
* Binary Attribute
|
|
12
|
+
*/
|
|
13
|
+
BINARY = 2,
|
|
14
|
+
/**
|
|
15
|
+
* Discrete Indexed Attribute is used to store the indices.
|
|
16
|
+
*/
|
|
17
|
+
DISCRETE_INDEXED = 3
|
|
18
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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.AttributeType = void 0;
|
|
13
|
+
var AttributeType;
|
|
14
|
+
(function (AttributeType) {
|
|
15
|
+
/**
|
|
16
|
+
* Continuous Attribute
|
|
17
|
+
*/
|
|
18
|
+
AttributeType[AttributeType["CONTINUOUS"] = 0] = "CONTINUOUS";
|
|
19
|
+
/**
|
|
20
|
+
* Discrete Attribute
|
|
21
|
+
*/
|
|
22
|
+
AttributeType[AttributeType["DISCRETE"] = 1] = "DISCRETE";
|
|
23
|
+
/**
|
|
24
|
+
* Binary Attribute
|
|
25
|
+
*/
|
|
26
|
+
AttributeType[AttributeType["BINARY"] = 2] = "BINARY";
|
|
27
|
+
/**
|
|
28
|
+
* Discrete Indexed Attribute is used to store the indices.
|
|
29
|
+
*/
|
|
30
|
+
AttributeType[AttributeType["DISCRETE_INDEXED"] = 3] = "DISCRETE_INDEXED";
|
|
31
|
+
})(AttributeType = exports.AttributeType || (exports.AttributeType = {}));
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=AttributeType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttributeType.js","sourceRoot":"","sources":["../../source/Attribute/AttributeType.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,IAAY,aAiBX;IAjBD,WAAY,aAAa;QACrB;;WAEG;QACH,6DAAU,CAAA;QACV;;WAEG;QACH,yDAAQ,CAAA;QACR;;WAEG;QACH,qDAAM,CAAA;QACN;;WAEG;QACH,yEAAgB,CAAA;IACpB,CAAC,EAjBW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAiBxB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DiscreteAttribute } from "./DiscreteAttribute";
|
|
2
|
+
export declare class BinaryAttribute extends DiscreteAttribute {
|
|
3
|
+
/**
|
|
4
|
+
* Constructor for a binary discrete attribute. The attribute can take only two values "True" or "False".
|
|
5
|
+
*
|
|
6
|
+
* @param value Value of the attribute. Can be true or false.
|
|
7
|
+
*/
|
|
8
|
+
constructor(value: boolean);
|
|
9
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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", "./DiscreteAttribute"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.BinaryAttribute = void 0;
|
|
13
|
+
const DiscreteAttribute_1 = require("./DiscreteAttribute");
|
|
14
|
+
class BinaryAttribute extends DiscreteAttribute_1.DiscreteAttribute {
|
|
15
|
+
/**
|
|
16
|
+
* Constructor for a binary discrete attribute. The attribute can take only two values "True" or "False".
|
|
17
|
+
*
|
|
18
|
+
* @param value Value of the attribute. Can be true or false.
|
|
19
|
+
*/
|
|
20
|
+
constructor(value) {
|
|
21
|
+
super(value == true ? "1" : "0");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.BinaryAttribute = BinaryAttribute;
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=BinaryAttribute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BinaryAttribute.js","sourceRoot":"","sources":["../../source/Attribute/BinaryAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,2DAAsD;IAEtD,MAAa,eAAgB,SAAQ,qCAAiB;QAElD;;;;WAIG;QACH,YAAY,KAAc;YACtB,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACrC,CAAC;KAEJ;IAXD,0CAWC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Attribute } from "./Attribute";
|
|
2
|
+
export declare class ContinuousAttribute extends Attribute {
|
|
3
|
+
private value;
|
|
4
|
+
/**
|
|
5
|
+
* Constructor for a continuous attribute.
|
|
6
|
+
*
|
|
7
|
+
* @param value Value of the attribute.
|
|
8
|
+
*/
|
|
9
|
+
constructor(value: number);
|
|
10
|
+
/**
|
|
11
|
+
* Accessor method for value.
|
|
12
|
+
*
|
|
13
|
+
* @return value
|
|
14
|
+
*/
|
|
15
|
+
getValue(): number;
|
|
16
|
+
/**
|
|
17
|
+
* Mutator method for value
|
|
18
|
+
*
|
|
19
|
+
* @param value New value of value.
|
|
20
|
+
*/
|
|
21
|
+
setValue(value: number): void;
|
|
22
|
+
/**
|
|
23
|
+
* Converts value to {@link String}.
|
|
24
|
+
*
|
|
25
|
+
* @return String representation of value.
|
|
26
|
+
*/
|
|
27
|
+
toString(): string;
|
|
28
|
+
continuousAttributeSize(): number;
|
|
29
|
+
continuousAttributes(): Array<number>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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", "./Attribute"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ContinuousAttribute = void 0;
|
|
13
|
+
const Attribute_1 = require("./Attribute");
|
|
14
|
+
class ContinuousAttribute extends Attribute_1.Attribute {
|
|
15
|
+
/**
|
|
16
|
+
* Constructor for a continuous attribute.
|
|
17
|
+
*
|
|
18
|
+
* @param value Value of the attribute.
|
|
19
|
+
*/
|
|
20
|
+
constructor(value) {
|
|
21
|
+
super();
|
|
22
|
+
this.value = value;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Accessor method for value.
|
|
26
|
+
*
|
|
27
|
+
* @return value
|
|
28
|
+
*/
|
|
29
|
+
getValue() {
|
|
30
|
+
return this.value;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Mutator method for value
|
|
34
|
+
*
|
|
35
|
+
* @param value New value of value.
|
|
36
|
+
*/
|
|
37
|
+
setValue(value) {
|
|
38
|
+
this.value = value;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Converts value to {@link String}.
|
|
42
|
+
*
|
|
43
|
+
* @return String representation of value.
|
|
44
|
+
*/
|
|
45
|
+
toString() {
|
|
46
|
+
return this.value.toString();
|
|
47
|
+
}
|
|
48
|
+
continuousAttributeSize() {
|
|
49
|
+
return 1;
|
|
50
|
+
}
|
|
51
|
+
continuousAttributes() {
|
|
52
|
+
let result = new Array();
|
|
53
|
+
result.push(this.value);
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.ContinuousAttribute = ContinuousAttribute;
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=ContinuousAttribute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContinuousAttribute.js","sourceRoot":"","sources":["../../source/Attribute/ContinuousAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,2CAAsC;IAEtC,MAAa,mBAAoB,SAAQ,qBAAS;QAI9C;;;;WAIG;QACH,YAAY,KAAa;YACrB,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QACtB,CAAC;QAED;;;;WAIG;QACH,QAAQ;YACJ,OAAO,IAAI,CAAC,KAAK,CAAA;QACrB,CAAC;QAED;;;;WAIG;QACH,QAAQ,CAAC,KAAa;YAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QACtB,CAAC;QAED;;;;WAIG;QACH,QAAQ;YACJ,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAA;QAChC,CAAC;QAED,uBAAuB;YACnB,OAAO,CAAC,CAAC;QACb,CAAC;QAED,oBAAoB;YAChB,IAAI,MAAM,GAAG,IAAI,KAAK,EAAU,CAAC;YACjC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YACvB,OAAO,MAAM,CAAA;QACjB,CAAC;KACJ;IAlDD,kDAkDC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Attribute } from "./Attribute";
|
|
2
|
+
export declare class DiscreteAttribute extends Attribute {
|
|
3
|
+
private value;
|
|
4
|
+
/**
|
|
5
|
+
* Constructor for a discrete attribute.
|
|
6
|
+
*
|
|
7
|
+
* @param value Value of the attribute.
|
|
8
|
+
*/
|
|
9
|
+
constructor(value: string);
|
|
10
|
+
/**
|
|
11
|
+
* Accessor method for value.
|
|
12
|
+
*
|
|
13
|
+
* @return value
|
|
14
|
+
*/
|
|
15
|
+
getValue(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Converts value to {@link String}.
|
|
18
|
+
*
|
|
19
|
+
* @return String representation of value.
|
|
20
|
+
*/
|
|
21
|
+
toString(): string;
|
|
22
|
+
continuousAttributeSize(): number;
|
|
23
|
+
continuousAttributes(): Array<number>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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", "./Attribute"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DiscreteAttribute = void 0;
|
|
13
|
+
const Attribute_1 = require("./Attribute");
|
|
14
|
+
class DiscreteAttribute extends Attribute_1.Attribute {
|
|
15
|
+
/**
|
|
16
|
+
* Constructor for a discrete attribute.
|
|
17
|
+
*
|
|
18
|
+
* @param value Value of the attribute.
|
|
19
|
+
*/
|
|
20
|
+
constructor(value) {
|
|
21
|
+
super();
|
|
22
|
+
this.value = "NULL";
|
|
23
|
+
this.value = value;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Accessor method for value.
|
|
27
|
+
*
|
|
28
|
+
* @return value
|
|
29
|
+
*/
|
|
30
|
+
getValue() {
|
|
31
|
+
return this.value;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Converts value to {@link String}.
|
|
35
|
+
*
|
|
36
|
+
* @return String representation of value.
|
|
37
|
+
*/
|
|
38
|
+
toString() {
|
|
39
|
+
if (this.value == ",") {
|
|
40
|
+
return "comma";
|
|
41
|
+
}
|
|
42
|
+
return this.value;
|
|
43
|
+
}
|
|
44
|
+
continuousAttributeSize() {
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
continuousAttributes() {
|
|
48
|
+
return new Array();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.DiscreteAttribute = DiscreteAttribute;
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=DiscreteAttribute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscreteAttribute.js","sourceRoot":"","sources":["../../source/Attribute/DiscreteAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,2CAAsC;IAEtC,MAAa,iBAAkB,SAAQ,qBAAS;QAI5C;;;;WAIG;QACH,YAAY,KAAa;YACrB,KAAK,EAAE,CAAC;YARJ,UAAK,GAAW,MAAM,CAAA;YAS1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QACtB,CAAC;QAED;;;;WAIG;QACH,QAAQ;YACJ,OAAO,IAAI,CAAC,KAAK,CAAA;QACrB,CAAC;QAED;;;;WAIG;QACH,QAAQ;YACJ,IAAI,IAAI,CAAC,KAAK,IAAI,GAAG,EAAC;gBAClB,OAAO,OAAO,CAAC;aAClB;YACD,OAAO,IAAI,CAAC,KAAK,CAAC;QACtB,CAAC;QAED,uBAAuB;YACnB,OAAO,CAAC,CAAC;QACb,CAAC;QAED,oBAAoB;YAChB,OAAO,IAAI,KAAK,EAAU,CAAC;QAC/B,CAAC;KAEJ;IA3CD,8CA2CC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DiscreteAttribute } from "./DiscreteAttribute";
|
|
2
|
+
export declare class DiscreteIndexedAttribute extends DiscreteAttribute {
|
|
3
|
+
private index;
|
|
4
|
+
private maxIndex;
|
|
5
|
+
/**
|
|
6
|
+
* Constructor for a discrete attribute.
|
|
7
|
+
*
|
|
8
|
+
* @param value Value of the attribute.
|
|
9
|
+
* @param index Index of the attribute.
|
|
10
|
+
* @param maxIndex Maximum index of the attribute.
|
|
11
|
+
*/
|
|
12
|
+
constructor(value: string, index: number, maxIndex: number);
|
|
13
|
+
/**
|
|
14
|
+
* Accessor method for index.
|
|
15
|
+
*
|
|
16
|
+
* @return index.
|
|
17
|
+
*/
|
|
18
|
+
getIndex(): number;
|
|
19
|
+
/**
|
|
20
|
+
* Accessor method for maxIndex.
|
|
21
|
+
*
|
|
22
|
+
* @return maxIndex.
|
|
23
|
+
*/
|
|
24
|
+
getMaxIndex(): number;
|
|
25
|
+
continuousAttributeSize(): number;
|
|
26
|
+
continuousAttributes(): Array<number>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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", "./DiscreteAttribute"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DiscreteIndexedAttribute = void 0;
|
|
13
|
+
const DiscreteAttribute_1 = require("./DiscreteAttribute");
|
|
14
|
+
class DiscreteIndexedAttribute extends DiscreteAttribute_1.DiscreteAttribute {
|
|
15
|
+
/**
|
|
16
|
+
* Constructor for a discrete attribute.
|
|
17
|
+
*
|
|
18
|
+
* @param value Value of the attribute.
|
|
19
|
+
* @param index Index of the attribute.
|
|
20
|
+
* @param maxIndex Maximum index of the attribute.
|
|
21
|
+
*/
|
|
22
|
+
constructor(value, index, maxIndex) {
|
|
23
|
+
super(value);
|
|
24
|
+
this.index = index;
|
|
25
|
+
this.maxIndex = maxIndex;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Accessor method for index.
|
|
29
|
+
*
|
|
30
|
+
* @return index.
|
|
31
|
+
*/
|
|
32
|
+
getIndex() {
|
|
33
|
+
return this.index;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Accessor method for maxIndex.
|
|
37
|
+
*
|
|
38
|
+
* @return maxIndex.
|
|
39
|
+
*/
|
|
40
|
+
getMaxIndex() {
|
|
41
|
+
return this.maxIndex;
|
|
42
|
+
}
|
|
43
|
+
continuousAttributeSize() {
|
|
44
|
+
return this.maxIndex;
|
|
45
|
+
}
|
|
46
|
+
continuousAttributes() {
|
|
47
|
+
let result = new Array();
|
|
48
|
+
for (let i = 0; i < this.maxIndex; i++) {
|
|
49
|
+
if (i != this.index) {
|
|
50
|
+
result.push(0.0);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
result.push(1.0);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.DiscreteIndexedAttribute = DiscreteIndexedAttribute;
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=DiscreteIndexedAttribute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscreteIndexedAttribute.js","sourceRoot":"","sources":["../../source/Attribute/DiscreteIndexedAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,2DAAsD;IAEtD,MAAa,wBAAyB,SAAQ,qCAAiB;QAK3D;;;;;;WAMG;QACH,YAAY,KAAa,EAAE,KAAa,EAAE,QAAgB;YACtD,KAAK,CAAC,KAAK,CAAC,CAAC;YACb,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;YAClB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QAC5B,CAAC;QAED;;;;WAIG;QACH,QAAQ;YACJ,OAAO,IAAI,CAAC,KAAK,CAAA;QACrB,CAAC;QAED;;;;WAIG;QACH,WAAW;YACP,OAAO,IAAI,CAAC,QAAQ,CAAA;QACxB,CAAC;QAED,uBAAuB;YACnB,OAAO,IAAI,CAAC,QAAQ,CAAA;QACxB,CAAC;QAED,oBAAoB;YAChB,IAAI,MAAM,GAAG,IAAI,KAAK,EAAU,CAAA;YAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE;gBACpC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE;oBACjB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;iBACpB;qBAAM;oBACH,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;iBACpB;aACJ;YACD,OAAO,MAAM,CAAA;QACjB,CAAC;KACJ;IAnDD,4DAmDC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Classifier } from "./Classifier";
|
|
2
|
+
import { InstanceList } from "../InstanceList/InstanceList";
|
|
3
|
+
import { Parameter } from "../Parameter/Parameter";
|
|
4
|
+
export declare class Bagging extends Classifier {
|
|
5
|
+
/**
|
|
6
|
+
* Bagging bootstrap ensemble method that creates individuals for its ensemble by training each classifier on a random
|
|
7
|
+
* redistribution of the training set.
|
|
8
|
+
* This training method is for a bagged decision tree classifier. 20 percent of the instances are left aside for pruning of the trees
|
|
9
|
+
* 80 percent of the instances are used for training the trees. The number of trees (forestSize) is a parameter, and basically
|
|
10
|
+
* the method will learn an ensemble of trees as a model.
|
|
11
|
+
*
|
|
12
|
+
* @param trainSet Training data given to the algorithm.
|
|
13
|
+
* @param parameters Parameters of the bagging trees algorithm. ensembleSize returns the number of trees in the bagged forest.
|
|
14
|
+
*/
|
|
15
|
+
train(trainSet: InstanceList, parameters: Parameter): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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", "./Classifier", "../InstanceList/InstanceList", "../Model/DecisionTree/DecisionTree", "../Model/DecisionTree/DecisionNode", "../Model/TreeEnsembleModel"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Bagging = void 0;
|
|
13
|
+
const Classifier_1 = require("./Classifier");
|
|
14
|
+
const InstanceList_1 = require("../InstanceList/InstanceList");
|
|
15
|
+
const DecisionTree_1 = require("../Model/DecisionTree/DecisionTree");
|
|
16
|
+
const DecisionNode_1 = require("../Model/DecisionTree/DecisionNode");
|
|
17
|
+
const TreeEnsembleModel_1 = require("../Model/TreeEnsembleModel");
|
|
18
|
+
class Bagging extends Classifier_1.Classifier {
|
|
19
|
+
/**
|
|
20
|
+
* Bagging bootstrap ensemble method that creates individuals for its ensemble by training each classifier on a random
|
|
21
|
+
* redistribution of the training set.
|
|
22
|
+
* This training method is for a bagged decision tree classifier. 20 percent of the instances are left aside for pruning of the trees
|
|
23
|
+
* 80 percent of the instances are used for training the trees. The number of trees (forestSize) is a parameter, and basically
|
|
24
|
+
* the method will learn an ensemble of trees as a model.
|
|
25
|
+
*
|
|
26
|
+
* @param trainSet Training data given to the algorithm.
|
|
27
|
+
* @param parameters Parameters of the bagging trees algorithm. ensembleSize returns the number of trees in the bagged forest.
|
|
28
|
+
*/
|
|
29
|
+
train(trainSet, parameters) {
|
|
30
|
+
let forestSize = parameters.getEnsembleSize();
|
|
31
|
+
let forest = new Array();
|
|
32
|
+
for (let i = 0; i < forestSize; i++) {
|
|
33
|
+
let bootstrap = trainSet.bootstrap(i);
|
|
34
|
+
let tree = new DecisionTree_1.DecisionTree(new DecisionNode_1.DecisionNode(new InstanceList_1.InstanceList(bootstrap.getSample()), undefined, undefined, false));
|
|
35
|
+
forest.push(tree);
|
|
36
|
+
}
|
|
37
|
+
this.model = new TreeEnsembleModel_1.TreeEnsembleModel(forest);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.Bagging = Bagging;
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=Bagging.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bagging.js","sourceRoot":"","sources":["../../source/Classifier/Bagging.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6CAAwC;IACxC,+DAA0D;IAG1D,qEAAgE;IAChE,qEAAgE;IAChE,kEAA6D;IAE7D,MAAa,OAAQ,SAAQ,uBAAU;QAEnC;;;;;;;;;WASG;QACH,KAAK,CAAC,QAAsB,EAAE,UAAqB;YAC/C,IAAI,UAAU,GAAuB,UAAW,CAAC,eAAe,EAAE,CAAC;YACnE,IAAI,MAAM,GAAG,IAAI,KAAK,EAAgB,CAAC;YACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE;gBACjC,IAAI,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;gBACtC,IAAI,IAAI,GAAG,IAAI,2BAAY,CAAC,IAAI,2BAAY,CAAC,IAAI,2BAAY,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;gBACpH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACrB;YACD,IAAI,CAAC,KAAK,GAAG,IAAI,qCAAiB,CAAC,MAAM,CAAC,CAAC;QAC/C,CAAC;KAEJ;IAvBD,0BAuBC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Classifier } from "./Classifier";
|
|
2
|
+
import { InstanceList } from "../InstanceList/InstanceList";
|
|
3
|
+
import { Parameter } from "../Parameter/Parameter";
|
|
4
|
+
export declare class C45 extends Classifier {
|
|
5
|
+
/**
|
|
6
|
+
* Training algorithm for C4.5 univariate decision tree classifier. 20 percent of the data are left aside for pruning
|
|
7
|
+
* 80 percent of the data is used for constructing the tree.
|
|
8
|
+
*
|
|
9
|
+
* @param trainSet Training data given to the algorithm.
|
|
10
|
+
* @param parameters -
|
|
11
|
+
*/
|
|
12
|
+
train(trainSet: InstanceList, parameters: Parameter): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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", "./Classifier", "../InstanceList/Partition", "../Model/DecisionTree/DecisionTree", "../Model/DecisionTree/DecisionNode"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.C45 = void 0;
|
|
13
|
+
const Classifier_1 = require("./Classifier");
|
|
14
|
+
const Partition_1 = require("../InstanceList/Partition");
|
|
15
|
+
const DecisionTree_1 = require("../Model/DecisionTree/DecisionTree");
|
|
16
|
+
const DecisionNode_1 = require("../Model/DecisionTree/DecisionNode");
|
|
17
|
+
class C45 extends Classifier_1.Classifier {
|
|
18
|
+
/**
|
|
19
|
+
* Training algorithm for C4.5 univariate decision tree classifier. 20 percent of the data are left aside for pruning
|
|
20
|
+
* 80 percent of the data is used for constructing the tree.
|
|
21
|
+
*
|
|
22
|
+
* @param trainSet Training data given to the algorithm.
|
|
23
|
+
* @param parameters -
|
|
24
|
+
*/
|
|
25
|
+
train(trainSet, parameters) {
|
|
26
|
+
let tree;
|
|
27
|
+
if (parameters.isPrune()) {
|
|
28
|
+
let partition = new Partition_1.Partition(trainSet, parameters.getCrossValidationRatio(), true);
|
|
29
|
+
tree = new DecisionTree_1.DecisionTree(new DecisionNode_1.DecisionNode(partition.get(1), undefined, undefined, false));
|
|
30
|
+
tree.prune(partition.get(0));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
tree = new DecisionTree_1.DecisionTree(new DecisionNode_1.DecisionNode(trainSet, undefined, undefined, false));
|
|
34
|
+
}
|
|
35
|
+
this.model = tree;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.C45 = C45;
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=C45.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"C45.js","sourceRoot":"","sources":["../../source/Classifier/C45.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6CAAwC;IAIxC,yDAAoD;IACpD,qEAAgE;IAChE,qEAAgE;IAEhE,MAAa,GAAI,SAAQ,uBAAU;QAE/B;;;;;;WAMG;QACH,KAAK,CAAC,QAAsB,EAAE,UAAqB;YAC/C,IAAI,IAAkB,CAAA;YACtB,IAAoB,UAAW,CAAC,OAAO,EAAE,EAAE;gBACvC,IAAI,SAAS,GAAG,IAAI,qBAAS,CAAC,QAAQ,EAAkB,UAAW,CAAC,uBAAuB,EAAE,EAAE,IAAI,CAAC,CAAC;gBACrG,IAAI,GAAG,IAAI,2BAAY,CAAC,IAAI,2BAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;gBACzF,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;aAChC;iBAAM;gBACH,IAAI,GAAG,IAAI,2BAAY,CAAC,IAAI,2BAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;aACpF;YACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QACtB,CAAC;KAEJ;IArBD,kBAqBC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Classifier } from "./Classifier";
|
|
2
|
+
import { InstanceList } from "../InstanceList/InstanceList";
|
|
3
|
+
import { Parameter } from "../Parameter/Parameter";
|
|
4
|
+
export declare class C45Stump extends Classifier {
|
|
5
|
+
/**
|
|
6
|
+
* Training algorithm for C4.5 Stump univariate decision tree classifier.
|
|
7
|
+
*
|
|
8
|
+
* @param trainSet Training data given to the algorithm.
|
|
9
|
+
* @param parameters -
|
|
10
|
+
*/
|
|
11
|
+
train(trainSet: InstanceList, parameters: Parameter): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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", "./Classifier", "../Model/DecisionTree/DecisionTree", "../Model/DecisionTree/DecisionNode"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.C45Stump = void 0;
|
|
13
|
+
const Classifier_1 = require("./Classifier");
|
|
14
|
+
const DecisionTree_1 = require("../Model/DecisionTree/DecisionTree");
|
|
15
|
+
const DecisionNode_1 = require("../Model/DecisionTree/DecisionNode");
|
|
16
|
+
class C45Stump extends Classifier_1.Classifier {
|
|
17
|
+
/**
|
|
18
|
+
* Training algorithm for C4.5 Stump univariate decision tree classifier.
|
|
19
|
+
*
|
|
20
|
+
* @param trainSet Training data given to the algorithm.
|
|
21
|
+
* @param parameters -
|
|
22
|
+
*/
|
|
23
|
+
train(trainSet, parameters) {
|
|
24
|
+
this.model = new DecisionTree_1.DecisionTree(new DecisionNode_1.DecisionNode(trainSet, undefined, undefined, true));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.C45Stump = C45Stump;
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=C45Stump.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"C45Stump.js","sourceRoot":"","sources":["../../source/Classifier/C45Stump.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6CAAwC;IAGxC,qEAAgE;IAChE,qEAAgE;IAEhE,MAAa,QAAS,SAAQ,uBAAU;QAEpC;;;;;WAKG;QACH,KAAK,CAAC,QAAsB,EAAE,UAAqB;YAC/C,IAAI,CAAC,KAAK,GAAG,IAAI,2BAAY,CAAC,IAAI,2BAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;QAC1F,CAAC;KAEJ;IAZD,4BAYC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Model } from "../Model/Model";
|
|
2
|
+
import { InstanceList } from "../InstanceList/InstanceList";
|
|
3
|
+
import { Parameter } from "../Parameter/Parameter";
|
|
4
|
+
import { Instance } from "../Instance/Instance";
|
|
5
|
+
import { Performance } from "../Performance/Performance";
|
|
6
|
+
export declare abstract class Classifier {
|
|
7
|
+
protected model: Model;
|
|
8
|
+
abstract train(trainSet: InstanceList, parameters: Parameter): void;
|
|
9
|
+
/**
|
|
10
|
+
* Checks given instance's attribute and returns true if it is a discrete indexed attribute, false otherwise.
|
|
11
|
+
*
|
|
12
|
+
* @param instance Instance to check.
|
|
13
|
+
* @return True if instance is a discrete indexed attribute, false otherwise.
|
|
14
|
+
*/
|
|
15
|
+
discreteCheck(instance: Instance): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* TestClassification an instance list with the current model.
|
|
18
|
+
*
|
|
19
|
+
* @param testSet Test data (list of instances) to be tested.
|
|
20
|
+
* @return The accuracy (and error) of the model as an instance of Performance class.
|
|
21
|
+
*/
|
|
22
|
+
test(testSet: InstanceList): Performance;
|
|
23
|
+
/**
|
|
24
|
+
* Runs current classifier with the given train and test data.
|
|
25
|
+
*
|
|
26
|
+
* @param parameter Parameter of the classifier to be trained.
|
|
27
|
+
* @param trainSet Training data to be used in training the classifier.
|
|
28
|
+
* @param testSet Test data to be tested after training the model.
|
|
29
|
+
* @return The accuracy (and error) of the trained model as an instance of Performance class.
|
|
30
|
+
* @throws DiscreteFeaturesNotAllowed Exception for discrete features.
|
|
31
|
+
*/
|
|
32
|
+
singleRun(parameter: Parameter, trainSet: InstanceList, testSet: InstanceList): Performance;
|
|
33
|
+
/**
|
|
34
|
+
* Accessor for the model.
|
|
35
|
+
*
|
|
36
|
+
* @return Model.
|
|
37
|
+
*/
|
|
38
|
+
getModel(): Model;
|
|
39
|
+
}
|