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,170 @@
|
|
|
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/Attribute", "../Attribute/ContinuousAttribute", "../Attribute/DiscreteAttribute", "nlptoolkit-math/dist/Vector"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Instance = void 0;
|
|
13
|
+
const Attribute_1 = require("../Attribute/Attribute");
|
|
14
|
+
const ContinuousAttribute_1 = require("../Attribute/ContinuousAttribute");
|
|
15
|
+
const DiscreteAttribute_1 = require("../Attribute/DiscreteAttribute");
|
|
16
|
+
const Vector_1 = require("nlptoolkit-math/dist/Vector");
|
|
17
|
+
class Instance {
|
|
18
|
+
/**
|
|
19
|
+
* Constructor for a single instance. Given the attributes and class label, it generates a new instance.
|
|
20
|
+
*
|
|
21
|
+
* @param classLabel Class label of the instance.
|
|
22
|
+
* @param attributes Attributes of the instance.
|
|
23
|
+
*/
|
|
24
|
+
constructor(classLabel, attributes) {
|
|
25
|
+
this.attributes = new Array();
|
|
26
|
+
this.classLabel = classLabel;
|
|
27
|
+
if (attributes != undefined) {
|
|
28
|
+
this.attributes = attributes;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Adds a new attribute.
|
|
33
|
+
*
|
|
34
|
+
* @param value Attribute to be added.
|
|
35
|
+
*/
|
|
36
|
+
addAttribute(value) {
|
|
37
|
+
if (value instanceof Attribute_1.Attribute) {
|
|
38
|
+
this.attributes.push(value);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
if (!Number.isNaN(value)) {
|
|
42
|
+
this.attributes.push(new ContinuousAttribute_1.ContinuousAttribute(value));
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this.attributes.push(new DiscreteAttribute_1.DiscreteAttribute(value));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Adds a {@link Vector} of continuous attributes.
|
|
51
|
+
*
|
|
52
|
+
* @param vector {@link Vector} that has the continuous attributes.
|
|
53
|
+
*/
|
|
54
|
+
addVectorAttribute(vector) {
|
|
55
|
+
for (let i = 0; i < vector.size(); i++) {
|
|
56
|
+
this.attributes.push(new ContinuousAttribute_1.ContinuousAttribute(vector.getValue(i)));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Removes attribute with the given index from the attributes list.
|
|
61
|
+
*
|
|
62
|
+
* @param index Index of the attribute to be removed.
|
|
63
|
+
*/
|
|
64
|
+
removeAttribute(index) {
|
|
65
|
+
this.attributes.splice(index, 1);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Removes all the attributes from the attributes list.
|
|
69
|
+
*/
|
|
70
|
+
removeAllAttributes() {
|
|
71
|
+
this.attributes = new Array();
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Accessor for a single attribute.
|
|
75
|
+
*
|
|
76
|
+
* @param index Index of the attribute to be accessed.
|
|
77
|
+
* @return Attribute with index 'index'.
|
|
78
|
+
*/
|
|
79
|
+
getAttribute(index) {
|
|
80
|
+
return this.attributes[index];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Returns the number of attributes in the attributes list.
|
|
84
|
+
*
|
|
85
|
+
* @return Number of attributes in the attributes list.
|
|
86
|
+
*/
|
|
87
|
+
attributeSize() {
|
|
88
|
+
return this.attributes.length;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Returns the number of continuous and discrete indexed attributes in the attributes list.
|
|
92
|
+
*
|
|
93
|
+
* @return Number of continuous and discrete indexed attributes in the attributes list.
|
|
94
|
+
*/
|
|
95
|
+
continuousAttributeSize() {
|
|
96
|
+
let size = 0;
|
|
97
|
+
for (let attribute of this.attributes) {
|
|
98
|
+
size += attribute.continuousAttributeSize();
|
|
99
|
+
}
|
|
100
|
+
return size;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The continuousAttributes method creates a new {@link Array} result and it adds the continuous attributes of the
|
|
104
|
+
* attributes list and also it adds 1 for the discrete indexed attributes
|
|
105
|
+
* .
|
|
106
|
+
*
|
|
107
|
+
* @return result {@link Array} that has continuous and discrete indexed attributes.
|
|
108
|
+
*/
|
|
109
|
+
continuousAttributes() {
|
|
110
|
+
let result = new Array();
|
|
111
|
+
for (let attribute of this.attributes) {
|
|
112
|
+
for (let continuousAttribute of attribute.continuousAttributes()) {
|
|
113
|
+
result.push(continuousAttribute);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Accessor for the class label.
|
|
120
|
+
*
|
|
121
|
+
* @return Class label of the instance.
|
|
122
|
+
*/
|
|
123
|
+
getClassLabel() {
|
|
124
|
+
return this.classLabel;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Converts instance to a {@link String}.
|
|
128
|
+
*
|
|
129
|
+
* @return A string of attributes separated with comma character.
|
|
130
|
+
*/
|
|
131
|
+
toString() {
|
|
132
|
+
let result = "";
|
|
133
|
+
for (let attribute of this.attributes) {
|
|
134
|
+
result = result + attribute.toString() + ",";
|
|
135
|
+
}
|
|
136
|
+
result = result + this.classLabel;
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The getSubSetOfFeatures method takes a {@link FeatureSubSet} as an input. First it creates a result {@link Instance}
|
|
141
|
+
* with the class label, and adds the attributes of the given featureSubSet to it.
|
|
142
|
+
*
|
|
143
|
+
* @param featureSubSet {@link FeatureSubSet} an {@link Array} of indices.
|
|
144
|
+
* @return result Instance.
|
|
145
|
+
*/
|
|
146
|
+
getSubSetOfFeatures(featureSubSet) {
|
|
147
|
+
let result = new Instance(this.classLabel);
|
|
148
|
+
for (let i = 0; i < featureSubSet.size(); i++) {
|
|
149
|
+
result.addAttribute(this.attributes[featureSubSet.get(i)]);
|
|
150
|
+
}
|
|
151
|
+
return result;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* The toVector method returns a {@link Vector} of continuous attributes and discrete indexed attributes.
|
|
155
|
+
*
|
|
156
|
+
* @return {@link Vector} of continuous attributes and discrete indexed attributes.
|
|
157
|
+
*/
|
|
158
|
+
toVector() {
|
|
159
|
+
let values = new Array();
|
|
160
|
+
for (let attribute of this.attributes) {
|
|
161
|
+
for (let continuousAttribute of attribute.continuousAttributes()) {
|
|
162
|
+
values.push(continuousAttribute);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return new Vector_1.Vector(values);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
exports.Instance = Instance;
|
|
169
|
+
});
|
|
170
|
+
//# sourceMappingURL=Instance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Instance.js","sourceRoot":"","sources":["../../source/Instance/Instance.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,sDAAiD;IACjD,0EAAqE;IACrE,sEAAiE;IACjE,wDAAmD;IAGnD,MAAa,QAAQ;QAKjB;;;;;WAKG;QACH,YAAY,UAAkB,EAAE,UAA6B;YARrD,eAAU,GAAqB,IAAI,KAAK,EAAa,CAAA;YASzD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;YAC5B,IAAI,UAAU,IAAI,SAAS,EAAC;gBACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;aAC/B;QACL,CAAC;QAED;;;;WAIG;QACH,YAAY,CAAC,KAAU;YACnB,IAAI,KAAK,YAAY,qBAAS,EAAC;gBAC3B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;aAC9B;iBAAM;gBACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAC;oBACrB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,yCAAmB,CAAC,KAAK,CAAC,CAAC,CAAA;iBACvD;qBAAM;oBACH,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,qCAAiB,CAAC,KAAK,CAAC,CAAC,CAAA;iBACrD;aACJ;QACL,CAAC;QAED;;;;WAIG;QACH,kBAAkB,CAAC,MAAc;YAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAC;gBACnC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,yCAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;aACpE;QACL,CAAC;QAED;;;;WAIG;QACH,eAAe,CAAC,KAAa;YACzB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACpC,CAAC;QAED;;WAEG;QACH,mBAAmB;YACf,IAAI,CAAC,UAAU,GAAG,IAAI,KAAK,EAAa,CAAA;QAC5C,CAAC;QAED;;;;;WAKG;QACH,YAAY,CAAC,KAAa;YACtB,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QACjC,CAAC;QAED;;;;WAIG;QACH,aAAa;YACT,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAA;QACjC,CAAC;QAED;;;;WAIG;QACH,uBAAuB;YACnB,IAAI,IAAI,GAAG,CAAC,CAAC;YACb,KAAK,IAAI,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE;gBACnC,IAAI,IAAI,SAAS,CAAC,uBAAuB,EAAE,CAAC;aAC/C;YACD,OAAO,IAAI,CAAC;QAChB,CAAC;QAED;;;;;;WAMG;QACH,oBAAoB;YAChB,IAAI,MAAM,GAAG,IAAI,KAAK,EAAU,CAAC;YACjC,KAAK,IAAI,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE;gBACnC,KAAK,IAAI,mBAAmB,IAAI,SAAS,CAAC,oBAAoB,EAAE,EAAC;oBAC7D,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;iBACpC;aACJ;YACD,OAAO,MAAM,CAAC;QAClB,CAAC;QAED;;;;WAIG;QACH,aAAa;YACT,OAAO,IAAI,CAAC,UAAU,CAAA;QAC1B,CAAC;QAED;;;;WAIG;QACH,QAAQ;YACJ,IAAI,MAAM,GAAG,EAAE,CAAC;YAChB,KAAK,IAAI,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE;gBACnC,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,GAAG,GAAG,CAAC;aAChD;YACD,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;YAClC,OAAO,MAAM,CAAC;QAClB,CAAC;QAED;;;;;;WAMG;QACH,mBAAmB,CAAC,aAA4B;YAC5C,IAAI,MAAM,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE;gBAC3C,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAC9D;YACD,OAAO,MAAM,CAAC;QAClB,CAAC;QAED;;;;WAIG;QACH,QAAQ;YACJ,IAAI,MAAM,GAAG,IAAI,KAAK,EAAU,CAAC;YACjC,KAAK,IAAI,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE;gBACnC,KAAK,IAAI,mBAAmB,IAAI,SAAS,CAAC,oBAAoB,EAAE,EAAC;oBAC7D,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;iBACpC;aACJ;YACD,OAAO,IAAI,eAAM,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;KACJ;IAnKD,4BAmKC"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { Instance } from "../Instance/Instance";
|
|
2
|
+
import { Bootstrap } from "nlptoolkit-sampling/dist/Bootstrap";
|
|
3
|
+
import { DiscreteDistribution } from "nlptoolkit-math/dist/DiscreteDistribution";
|
|
4
|
+
import { Vector } from "nlptoolkit-math/dist/Vector";
|
|
5
|
+
import { Matrix } from "nlptoolkit-math/dist/Matrix";
|
|
6
|
+
export declare class InstanceList {
|
|
7
|
+
protected list: Array<Instance>;
|
|
8
|
+
/**
|
|
9
|
+
* Constructor for an instance list with a given data definition, data file and a separator character. Each instance
|
|
10
|
+
* must be stored in a separate line separated with the character separator. The last item must be the class label.
|
|
11
|
+
* The function reads the file line by line and for each line; depending on the data definition, that is, type of
|
|
12
|
+
* the attributes, adds discrete and continuous attributes to a new instance. For example, given the data set file
|
|
13
|
+
* <p>
|
|
14
|
+
* red;1;0.4;true
|
|
15
|
+
* green;-1;0.8;true
|
|
16
|
+
* blue;3;1.3;false
|
|
17
|
+
* <p>
|
|
18
|
+
* where the first attribute is a discrete attribute, second and third attributes are continuous attributes, the
|
|
19
|
+
* fourth item is the class label.
|
|
20
|
+
*
|
|
21
|
+
* @param definition Data definition of the data set.
|
|
22
|
+
* @param separator Separator character which separates the attribute values in the data file.
|
|
23
|
+
* @param fileName Name of the data set file.
|
|
24
|
+
*/
|
|
25
|
+
constructor(definition?: any, separator?: string, fileName?: string);
|
|
26
|
+
/**
|
|
27
|
+
* Adds instance to the instance list.
|
|
28
|
+
*
|
|
29
|
+
* @param instance Instance to be added.
|
|
30
|
+
*/
|
|
31
|
+
add(instance: Instance): void;
|
|
32
|
+
/**
|
|
33
|
+
* Adds a list of instances to the current instance list.
|
|
34
|
+
*
|
|
35
|
+
* @param instanceList List of instances to be added.
|
|
36
|
+
*/
|
|
37
|
+
addAll(instanceList: Array<Instance>): void;
|
|
38
|
+
/**
|
|
39
|
+
* Returns size of the instance list.
|
|
40
|
+
*
|
|
41
|
+
* @return Size of the instance list.
|
|
42
|
+
*/
|
|
43
|
+
size(): number;
|
|
44
|
+
/**
|
|
45
|
+
* Accessor for a single instance with the given index.
|
|
46
|
+
*
|
|
47
|
+
* @param index Index of the instance.
|
|
48
|
+
* @return Instance with index 'index'.
|
|
49
|
+
*/
|
|
50
|
+
get(index: number): Instance;
|
|
51
|
+
/**
|
|
52
|
+
* Sorts instance list according to the attribute with index 'attributeIndex'.
|
|
53
|
+
*
|
|
54
|
+
* @param attributeIndex index of the attribute.
|
|
55
|
+
*/
|
|
56
|
+
sort(attributeIndex?: number): void;
|
|
57
|
+
/**
|
|
58
|
+
* Shuffles the instance list.
|
|
59
|
+
* @param seed Seed is used for random number generation.
|
|
60
|
+
*/
|
|
61
|
+
shuffle(seed: number): void;
|
|
62
|
+
/**
|
|
63
|
+
* Creates a bootstrap sample from the current instance list.
|
|
64
|
+
*
|
|
65
|
+
* @param seed To create a different bootstrap sample, we need a new seed for each sample.
|
|
66
|
+
* @return Bootstrap sample.
|
|
67
|
+
*/
|
|
68
|
+
bootstrap(seed: number): Bootstrap<Instance>;
|
|
69
|
+
/**
|
|
70
|
+
* Extracts the class labels of each instance in the instance list and returns them in an array of {@link String}.
|
|
71
|
+
*
|
|
72
|
+
* @return An array list of class labels.
|
|
73
|
+
*/
|
|
74
|
+
getClassLabels(): Array<string>;
|
|
75
|
+
/**
|
|
76
|
+
* Extracts the class labels of each instance in the instance list and returns them as a set.
|
|
77
|
+
*
|
|
78
|
+
* @return An {@link Array} of distinct class labels.
|
|
79
|
+
*/
|
|
80
|
+
getDistinctClassLabels(): Array<string>;
|
|
81
|
+
/**
|
|
82
|
+
* Extracts the possible class labels of each instance in the instance list and returns them as a set.
|
|
83
|
+
*
|
|
84
|
+
* @return An {@link Array} of distinct class labels.
|
|
85
|
+
*/
|
|
86
|
+
getUnionOfPossibleClassLabels(): Array<string>;
|
|
87
|
+
/**
|
|
88
|
+
* Extracts distinct discrete values of a given attribute as an array of strings.
|
|
89
|
+
*
|
|
90
|
+
* @param attributeIndex Index of the discrete attribute.
|
|
91
|
+
* @return An array of distinct values of a discrete attribute.
|
|
92
|
+
*/
|
|
93
|
+
getAttributeValueList(attributeIndex: number): Array<string>;
|
|
94
|
+
/**
|
|
95
|
+
* Calculates the mean of a single attribute for this instance list (m_i). If the attribute is discrete, the maximum
|
|
96
|
+
* occurring value for that attribute is returned. If the attribute is continuous, the mean value of the values of
|
|
97
|
+
* all instances are returned.
|
|
98
|
+
*
|
|
99
|
+
* @param index Index of the attribute.
|
|
100
|
+
* @return The mean value of the instances as an attribute.
|
|
101
|
+
*/
|
|
102
|
+
private attributeAverage;
|
|
103
|
+
/**
|
|
104
|
+
* Calculates the mean of a single attribute for this instance list (m_i).
|
|
105
|
+
*
|
|
106
|
+
* @param index Index of the attribute.
|
|
107
|
+
* @return The mean value of the instances as an attribute.
|
|
108
|
+
*/
|
|
109
|
+
continuousAttributeAverage(index?: number): Array<number>;
|
|
110
|
+
/**
|
|
111
|
+
* Calculates the standard deviation of a single attribute for this instance list (m_i). If the attribute is discrete,
|
|
112
|
+
* null returned. If the attribute is continuous, the standard deviation of the values all instances are returned.
|
|
113
|
+
*
|
|
114
|
+
* @param index Index of the attribute.
|
|
115
|
+
* @return The standard deviation of the instances as an attribute.
|
|
116
|
+
*/
|
|
117
|
+
private attributeStandardDeviation;
|
|
118
|
+
/**
|
|
119
|
+
* Calculates the standard deviation of a single continuous attribute for this instance list (m_i).
|
|
120
|
+
*
|
|
121
|
+
* @param index Index of the attribute.
|
|
122
|
+
* @return The standard deviation of the instances as an attribute.
|
|
123
|
+
*/
|
|
124
|
+
private continuousAttributeStandardDeviation;
|
|
125
|
+
/**
|
|
126
|
+
* The attributeDistribution method takes an index as an input and if the attribute of the instance at given index is
|
|
127
|
+
* discrete, it returns the distribution of the attributes of that instance.
|
|
128
|
+
*
|
|
129
|
+
* @param index Index of the attribute.
|
|
130
|
+
* @return Distribution of the attribute.
|
|
131
|
+
*/
|
|
132
|
+
attributeDistribution(index: number): DiscreteDistribution;
|
|
133
|
+
/**
|
|
134
|
+
* The attributeClassDistribution method takes an attribute index as an input. It loops through the instances, gets
|
|
135
|
+
* the corresponding value of given attribute index and adds the class label of that instance to the discrete distributions list.
|
|
136
|
+
*
|
|
137
|
+
* @param attributeIndex Index of the attribute.
|
|
138
|
+
* @return Distribution of the class labels.
|
|
139
|
+
*/
|
|
140
|
+
attributeClassDistribution(attributeIndex: number): Array<DiscreteDistribution>;
|
|
141
|
+
/**
|
|
142
|
+
* The discreteIndexedAttributeClassDistribution method takes an attribute index and an attribute value as inputs.
|
|
143
|
+
* It loops through the instances, gets the corresponding value of given attribute index and given attribute value.
|
|
144
|
+
* Then, adds the class label of that instance to the discrete indexed distributions list.
|
|
145
|
+
*
|
|
146
|
+
* @param attributeIndex Index of the attribute.
|
|
147
|
+
* @param attributeValue Value of the attribute.
|
|
148
|
+
* @return Distribution of the class labels.
|
|
149
|
+
*/
|
|
150
|
+
discreteIndexedAttributeClassDistribution(attributeIndex: number, attributeValue: number): DiscreteDistribution;
|
|
151
|
+
/**
|
|
152
|
+
* The classDistribution method returns the distribution of all the class labels of instances.
|
|
153
|
+
*
|
|
154
|
+
* @return Distribution of the class labels.
|
|
155
|
+
*/
|
|
156
|
+
classDistribution(): DiscreteDistribution;
|
|
157
|
+
/**
|
|
158
|
+
* The allAttributesDistribution method returns the distributions of all the attributes of instances.
|
|
159
|
+
*
|
|
160
|
+
* @return Distributions of all the attributes of instances.
|
|
161
|
+
*/
|
|
162
|
+
allAttributesDistribution(): Array<DiscreteDistribution>;
|
|
163
|
+
/**
|
|
164
|
+
* Returns the mean of all the attributes for instances in the list.
|
|
165
|
+
*
|
|
166
|
+
* @return Mean of all the attributes for instances in the list.
|
|
167
|
+
*/
|
|
168
|
+
average(): Instance;
|
|
169
|
+
/**
|
|
170
|
+
* Returns the standard deviation of attributes for instances.
|
|
171
|
+
*
|
|
172
|
+
* @return Standard deviation of attributes for instances.
|
|
173
|
+
*/
|
|
174
|
+
standardDeviation(): Instance;
|
|
175
|
+
/**
|
|
176
|
+
* Calculates a covariance {@link Matrix} by using an average {@link Vector}.
|
|
177
|
+
*
|
|
178
|
+
* @param average Vector input.
|
|
179
|
+
* @return Covariance {@link Matrix}.
|
|
180
|
+
*/
|
|
181
|
+
covariance(average: Vector): Matrix;
|
|
182
|
+
/**
|
|
183
|
+
* Accessor for the instances.
|
|
184
|
+
*
|
|
185
|
+
* @return Instances.
|
|
186
|
+
*/
|
|
187
|
+
getInstances(): Array<Instance>;
|
|
188
|
+
}
|