nlptoolkit-classification 1.0.8 → 1.0.9
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/dist/Attribute/Attribute.js +6 -16
- package/dist/Attribute/Attribute.js.map +1 -1
- package/dist/Attribute/AttributeType.js +22 -32
- package/dist/Attribute/AttributeType.js.map +1 -1
- package/dist/Attribute/BinaryAttribute.js +14 -24
- package/dist/Attribute/BinaryAttribute.js.map +1 -1
- package/dist/Attribute/ContinuousAttribute.js +46 -55
- package/dist/Attribute/ContinuousAttribute.js.map +1 -1
- package/dist/Attribute/DiscreteAttribute.js +38 -48
- package/dist/Attribute/DiscreteAttribute.js.map +1 -1
- package/dist/Attribute/DiscreteIndexedAttribute.js +47 -55
- package/dist/Attribute/DiscreteIndexedAttribute.js.map +1 -1
- package/dist/DataSet/DataDefinition.js +115 -123
- package/dist/DataSet/DataDefinition.js.map +1 -1
- package/dist/DataSet/DataSet.js +268 -245
- package/dist/DataSet/DataSet.js.map +1 -1
- package/dist/DistanceMetric/DistanceMetric.js +2 -12
- package/dist/DistanceMetric/EuclidianDistance.js +27 -37
- package/dist/DistanceMetric/EuclidianDistance.js.map +1 -1
- package/dist/DistanceMetric/MahalanobisDistance.js +27 -36
- package/dist/DistanceMetric/MahalanobisDistance.js.map +1 -1
- package/dist/Experiment/BootstrapRun.js +31 -40
- package/dist/Experiment/BootstrapRun.js.map +1 -1
- package/dist/Experiment/Experiment.js +46 -53
- package/dist/Experiment/Experiment.js.map +1 -1
- package/dist/Experiment/KFoldRun.js +45 -54
- package/dist/Experiment/KFoldRun.js.map +1 -1
- package/dist/Experiment/KFoldRunSeparateTest.js +48 -58
- package/dist/Experiment/KFoldRunSeparateTest.js.map +1 -1
- package/dist/Experiment/MultipleRun.js +2 -12
- package/dist/Experiment/MxKFoldRun.js +31 -40
- package/dist/Experiment/MxKFoldRun.js.map +1 -1
- package/dist/Experiment/MxKFoldRunSeparateTest.js +35 -44
- package/dist/Experiment/MxKFoldRunSeparateTest.js.map +1 -1
- package/dist/Experiment/SingleRun.js +2 -12
- package/dist/Experiment/SingleRunWithK.js +39 -48
- package/dist/Experiment/SingleRunWithK.js.map +1 -1
- package/dist/Experiment/StratifiedKFoldRun.js +26 -36
- package/dist/Experiment/StratifiedKFoldRun.js.map +1 -1
- package/dist/Experiment/StratifiedKFoldRunSeparateTest.js +30 -40
- package/dist/Experiment/StratifiedKFoldRunSeparateTest.js.map +1 -1
- package/dist/Experiment/StratifiedMxKFoldRun.js +29 -39
- package/dist/Experiment/StratifiedMxKFoldRun.js.map +1 -1
- package/dist/Experiment/StratifiedMxKFoldRunSeparateTest.js +34 -43
- package/dist/Experiment/StratifiedMxKFoldRunSeparateTest.js.map +1 -1
- package/dist/Experiment/StratifiedSingleRunWithK.js +27 -36
- package/dist/Experiment/StratifiedSingleRunWithK.js.map +1 -1
- package/dist/FeatureSelection/BackwardSelection.js +26 -36
- package/dist/FeatureSelection/BackwardSelection.js.map +1 -1
- package/dist/FeatureSelection/FeatureSubSet.js +72 -82
- package/dist/FeatureSelection/FeatureSubSet.js.map +1 -1
- package/dist/FeatureSelection/FloatingSelection.js +25 -35
- package/dist/FeatureSelection/FloatingSelection.js.map +1 -1
- package/dist/FeatureSelection/ForwardSelection.js +25 -35
- package/dist/FeatureSelection/ForwardSelection.js.map +1 -1
- package/dist/FeatureSelection/SubSetSelection.js +69 -78
- package/dist/FeatureSelection/SubSetSelection.js.map +1 -1
- package/dist/Filter/DiscreteToContinuous.js +50 -60
- package/dist/Filter/DiscreteToContinuous.js.map +1 -1
- package/dist/Filter/DiscreteToIndexed.js +40 -50
- package/dist/Filter/DiscreteToIndexed.js.map +1 -1
- package/dist/Filter/FeatureFilter.js +23 -32
- package/dist/Filter/FeatureFilter.js.map +1 -1
- package/dist/Filter/LaryFilter.js +46 -55
- package/dist/Filter/LaryFilter.js.map +1 -1
- package/dist/Filter/LaryToBinary.js +48 -58
- package/dist/Filter/LaryToBinary.js.map +1 -1
- package/dist/Filter/Normalize.js +33 -41
- package/dist/Filter/Normalize.js.map +1 -1
- package/dist/Filter/Pca.js +86 -96
- package/dist/Filter/Pca.js.map +1 -1
- package/dist/Filter/TrainedFeatureFilter.js +14 -24
- package/dist/Filter/TrainedFeatureFilter.js.map +1 -1
- package/dist/Instance/CompositeInstance.js +46 -56
- package/dist/Instance/CompositeInstance.js.map +1 -1
- package/dist/Instance/Instance.js +145 -154
- package/dist/Instance/Instance.js.map +1 -1
- package/dist/InstanceList/InstanceList.js +466 -443
- package/dist/InstanceList/InstanceList.js.map +1 -1
- package/dist/InstanceList/InstanceListOfSameClass.js +23 -32
- package/dist/InstanceList/InstanceListOfSameClass.js.map +1 -1
- package/dist/InstanceList/Partition.js +167 -177
- package/dist/InstanceList/Partition.js.map +1 -1
- package/dist/Model/DecisionTree/DecisionCondition.js +71 -80
- package/dist/Model/DecisionTree/DecisionCondition.js.map +1 -1
- package/dist/Model/DecisionTree/DecisionNode.js +302 -311
- package/dist/Model/DecisionTree/DecisionNode.js.map +1 -1
- package/dist/Model/DecisionTree/DecisionStump.js +22 -32
- package/dist/Model/DecisionTree/DecisionStump.js.map +1 -1
- package/dist/Model/DecisionTree/DecisionTree.js +89 -98
- package/dist/Model/DecisionTree/DecisionTree.js.map +1 -1
- package/dist/Model/DummyModel.js +64 -73
- package/dist/Model/DummyModel.js.map +1 -1
- package/dist/Model/Ensemble/BaggingModel.js +34 -44
- package/dist/Model/Ensemble/BaggingModel.js.map +1 -1
- package/dist/Model/Ensemble/RandomForestModel.js +31 -41
- package/dist/Model/Ensemble/RandomForestModel.js.map +1 -1
- package/dist/Model/Ensemble/TreeEnsembleModel.js +55 -64
- package/dist/Model/Ensemble/TreeEnsembleModel.js.map +1 -1
- package/dist/Model/Model.js +130 -140
- package/dist/Model/Model.js.map +1 -1
- package/dist/Model/NeuralNetwork/DeepNetworkModel.js +162 -169
- package/dist/Model/NeuralNetwork/DeepNetworkModel.js.map +1 -1
- package/dist/Model/NeuralNetwork/LinearPerceptronModel.js +69 -78
- package/dist/Model/NeuralNetwork/LinearPerceptronModel.js.map +1 -1
- package/dist/Model/NeuralNetwork/MultiLayerPerceptronModel.js +112 -120
- package/dist/Model/NeuralNetwork/MultiLayerPerceptronModel.js.map +1 -1
- package/dist/Model/NeuralNetwork/NeuralNetworkModel.js +197 -201
- package/dist/Model/NeuralNetwork/NeuralNetworkModel.js.map +1 -1
- package/dist/Model/NonParametric/KnnInstance.js +21 -29
- package/dist/Model/NonParametric/KnnInstance.js.map +1 -1
- package/dist/Model/NonParametric/KnnModel.js +101 -108
- package/dist/Model/NonParametric/KnnModel.js.map +1 -1
- package/dist/Model/Parametric/GaussianModel.js +82 -91
- package/dist/Model/Parametric/GaussianModel.js.map +1 -1
- package/dist/Model/Parametric/KMeansModel.js +59 -67
- package/dist/Model/Parametric/KMeansModel.js.map +1 -1
- package/dist/Model/Parametric/LdaModel.js +83 -91
- package/dist/Model/Parametric/LdaModel.js.map +1 -1
- package/dist/Model/Parametric/NaiveBayesModel.js +119 -132
- package/dist/Model/Parametric/NaiveBayesModel.js.map +1 -1
- package/dist/Model/Parametric/QdaModel.js +70 -79
- package/dist/Model/Parametric/QdaModel.js.map +1 -1
- package/dist/Model/RandomModel.js +85 -92
- package/dist/Model/RandomModel.js.map +1 -1
- package/dist/Model/ValidatedModel.js +21 -31
- package/dist/Model/ValidatedModel.js.map +1 -1
- package/dist/Parameter/ActivationFunction.js +9 -19
- package/dist/Parameter/ActivationFunction.js.map +1 -1
- package/dist/Parameter/BaggingParameter.js +24 -33
- package/dist/Parameter/BaggingParameter.js.map +1 -1
- package/dist/Parameter/C45Parameter.js +34 -42
- package/dist/Parameter/C45Parameter.js.map +1 -1
- package/dist/Parameter/DeepNetworkParameter.js +48 -56
- package/dist/Parameter/DeepNetworkParameter.js.map +1 -1
- package/dist/Parameter/KMeansParameter.js +29 -38
- package/dist/Parameter/KMeansParameter.js.map +1 -1
- package/dist/Parameter/KnnParameter.js +25 -34
- package/dist/Parameter/KnnParameter.js.map +1 -1
- package/dist/Parameter/LinearPerceptronParameter.js +56 -62
- package/dist/Parameter/LinearPerceptronParameter.js.map +1 -1
- package/dist/Parameter/MultiLayerPerceptronParameter.js +38 -46
- package/dist/Parameter/MultiLayerPerceptronParameter.js.map +1 -1
- package/dist/Parameter/Parameter.js +21 -30
- package/dist/Parameter/Parameter.js.map +1 -1
- package/dist/Parameter/RandomForestParameter.js +25 -34
- package/dist/Parameter/RandomForestParameter.js.map +1 -1
- package/dist/Performance/ClassificationPerformance.js +24 -33
- package/dist/Performance/ClassificationPerformance.js.map +1 -1
- package/dist/Performance/ConfusionMatrix.js +149 -158
- package/dist/Performance/ConfusionMatrix.js.map +1 -1
- package/dist/Performance/DetailedClassificationPerformance.js +23 -32
- package/dist/Performance/DetailedClassificationPerformance.js.map +1 -1
- package/dist/Performance/ExperimentPerformance.js +184 -161
- package/dist/Performance/ExperimentPerformance.js.map +1 -1
- package/dist/Performance/Performance.js +21 -30
- package/dist/Performance/Performance.js.map +1 -1
- package/dist/StatisticalTest/Combined5x2F.js +41 -51
- package/dist/StatisticalTest/Combined5x2F.js.map +1 -1
- package/dist/StatisticalTest/Combined5x2t.js +42 -52
- package/dist/StatisticalTest/Combined5x2t.js.map +1 -1
- package/dist/StatisticalTest/Paired5x2t.js +40 -50
- package/dist/StatisticalTest/Paired5x2t.js.map +1 -1
- package/dist/StatisticalTest/PairedTest.js +31 -41
- package/dist/StatisticalTest/PairedTest.js.map +1 -1
- package/dist/StatisticalTest/Pairedt.js +38 -48
- package/dist/StatisticalTest/Pairedt.js.map +1 -1
- package/dist/StatisticalTest/Sign.js +50 -60
- package/dist/StatisticalTest/Sign.js.map +1 -1
- package/dist/StatisticalTest/StatisticalTestResult.js +65 -73
- package/dist/StatisticalTest/StatisticalTestResult.js.map +1 -1
- package/dist/StatisticalTest/StatisticalTestResultType.js +11 -21
- package/dist/StatisticalTest/StatisticalTestResultType.js.map +1 -1
- package/dist/index.js +95 -101
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
- package/tsconfig.json +4 -3
- package/source/tsconfig.json +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StratifiedMxKFoldRunSeparateTest.js","sourceRoot":"","sources":["../../source/Experiment/StratifiedMxKFoldRunSeparateTest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StratifiedMxKFoldRunSeparateTest.js","sourceRoot":"","sources":["../../source/Experiment/StratifiedMxKFoldRunSeparateTest.ts"],"names":[],"mappings":";;;AAAA,qFAAgF;AAEhF,gFAA2E;AAC3E,yDAAoD;AAEpD,4GAAuG;AAEvG,MAAa,gCAAiC,SAAQ,+DAA8B;IAEtE,CAAC,CAAQ;IAEnB;;;;;OAKG;IACH,YAAY,CAAS,EAAE,CAAS;QAC5B,KAAK,CAAC,CAAC,CAAC,CAAC;QACT,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;IACd,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,UAAsB;QAC1B,IAAI,MAAM,GAAG,IAAI,6CAAqB,EAAE,CAAC;QACzC,IAAI,YAAY,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC,eAAe,EAAE,CAAC;QAC7D,IAAI,SAAS,GAAG,IAAI,qBAAS,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACxD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9B,IAAI,eAAe,GAAG,IAAI,+DAA8B,CAAW,IAAI,qBAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EACzG,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YACjD,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpH,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAhCD,4EAgCC"}
|
|
@@ -1,39 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StratifiedSingleRunWithK = void 0;
|
|
4
|
+
const StratifiedKFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/StratifiedKFoldCrossValidation");
|
|
5
|
+
const InstanceList_1 = require("../InstanceList/InstanceList");
|
|
6
|
+
class StratifiedSingleRunWithK {
|
|
7
|
+
K;
|
|
8
|
+
/**
|
|
9
|
+
* Constructor for StratifiedSingleRunWithK class. Basically sets K parameter of the K-fold cross-validation.
|
|
10
|
+
*
|
|
11
|
+
* @param K K of the K-fold cross-validation.
|
|
12
|
+
*/
|
|
13
|
+
constructor(K) {
|
|
14
|
+
this.K = K;
|
|
5
15
|
}
|
|
6
|
-
|
|
7
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Execute Stratified Single K-fold cross-validation with the given classifier on the given data set using the given parameters.
|
|
18
|
+
*
|
|
19
|
+
* @param experiment Experiment to be run.
|
|
20
|
+
* @return A Performance instance.
|
|
21
|
+
*/
|
|
22
|
+
execute(experiment) {
|
|
23
|
+
let crossValidation = new StratifiedKFoldCrossValidation_1.StratifiedKFoldCrossValidation(experiment.getDataSet().getClassInstances(), this.K, experiment.getParameter().getSeed());
|
|
24
|
+
let trainSet = new InstanceList_1.InstanceList(crossValidation.getTrainFold(0));
|
|
25
|
+
let testSet = new InstanceList_1.InstanceList(crossValidation.getTestFold(0));
|
|
26
|
+
return experiment.getmodel().singleRun(experiment.getParameter(), trainSet, testSet);
|
|
8
27
|
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.StratifiedSingleRunWithK = void 0;
|
|
13
|
-
const StratifiedKFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/StratifiedKFoldCrossValidation");
|
|
14
|
-
const InstanceList_1 = require("../InstanceList/InstanceList");
|
|
15
|
-
class StratifiedSingleRunWithK {
|
|
16
|
-
/**
|
|
17
|
-
* Constructor for StratifiedSingleRunWithK class. Basically sets K parameter of the K-fold cross-validation.
|
|
18
|
-
*
|
|
19
|
-
* @param K K of the K-fold cross-validation.
|
|
20
|
-
*/
|
|
21
|
-
constructor(K) {
|
|
22
|
-
this.K = K;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Execute Stratified Single K-fold cross-validation with the given classifier on the given data set using the given parameters.
|
|
26
|
-
*
|
|
27
|
-
* @param experiment Experiment to be run.
|
|
28
|
-
* @return A Performance instance.
|
|
29
|
-
*/
|
|
30
|
-
execute(experiment) {
|
|
31
|
-
let crossValidation = new StratifiedKFoldCrossValidation_1.StratifiedKFoldCrossValidation(experiment.getDataSet().getClassInstances(), this.K, experiment.getParameter().getSeed());
|
|
32
|
-
let trainSet = new InstanceList_1.InstanceList(crossValidation.getTrainFold(0));
|
|
33
|
-
let testSet = new InstanceList_1.InstanceList(crossValidation.getTestFold(0));
|
|
34
|
-
return experiment.getmodel().singleRun(experiment.getParameter(), trainSet, testSet);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.StratifiedSingleRunWithK = StratifiedSingleRunWithK;
|
|
38
|
-
});
|
|
28
|
+
}
|
|
29
|
+
exports.StratifiedSingleRunWithK = StratifiedSingleRunWithK;
|
|
39
30
|
//# sourceMappingURL=StratifiedSingleRunWithK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StratifiedSingleRunWithK.js","sourceRoot":"","sources":["../../source/Experiment/StratifiedSingleRunWithK.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StratifiedSingleRunWithK.js","sourceRoot":"","sources":["../../source/Experiment/StratifiedSingleRunWithK.ts"],"names":[],"mappings":";;;AAEA,4GAAuG;AAEvG,+DAA0D;AAE1D,MAAa,wBAAwB;IAEhB,CAAC,CAAQ;IAE1B;;;;OAIG;IACH,YAAY,CAAS;QACjB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;IACd,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,UAAsB;QAC1B,IAAI,eAAe,GAAG,IAAI,+DAA8B,CAAW,UAAU,CAAC,UAAU,EAAE,CAAC,iBAAiB,EAAE,EAC1G,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;QACjD,IAAI,QAAQ,GAAG,IAAI,2BAAY,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;QACjE,IAAI,OAAO,GAAG,IAAI,2BAAY,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/D,OAAO,UAAU,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;CACJ;AA1BD,4DA0BC"}
|
|
@@ -1,39 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BackwardSelection = void 0;
|
|
4
|
+
const SubSetSelection_1 = require("./SubSetSelection");
|
|
5
|
+
const FeatureSubSet_1 = require("./FeatureSubSet");
|
|
6
|
+
class BackwardSelection extends SubSetSelection_1.SubSetSelection {
|
|
7
|
+
/**
|
|
8
|
+
* Constructor that creates a new {@link FeatureSubSet} and initializes indexList with given number of features.
|
|
9
|
+
*
|
|
10
|
+
* @param numberOfFeatures Indicates the indices of indexList.
|
|
11
|
+
*/
|
|
12
|
+
constructor(numberOfFeatures) {
|
|
13
|
+
super(new FeatureSubSet_1.FeatureSubSet(numberOfFeatures));
|
|
5
14
|
}
|
|
6
|
-
|
|
7
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The operator method calls backward method which starts with all the features and removes the least significant feature at each iteration.
|
|
17
|
+
*
|
|
18
|
+
* @param current FeatureSubset that will be added to new ArrayList.
|
|
19
|
+
* @param numberOfFeatures Indicates the indices of indexList.
|
|
20
|
+
* @return ArrayList of FeatureSubSets created from backward.
|
|
21
|
+
*/
|
|
22
|
+
operator(current, numberOfFeatures) {
|
|
23
|
+
let result = new Array();
|
|
24
|
+
this.backward(result, current);
|
|
25
|
+
return result;
|
|
8
26
|
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.BackwardSelection = void 0;
|
|
13
|
-
const SubSetSelection_1 = require("./SubSetSelection");
|
|
14
|
-
const FeatureSubSet_1 = require("./FeatureSubSet");
|
|
15
|
-
class BackwardSelection extends SubSetSelection_1.SubSetSelection {
|
|
16
|
-
/**
|
|
17
|
-
* Constructor that creates a new {@link FeatureSubSet} and initializes indexList with given number of features.
|
|
18
|
-
*
|
|
19
|
-
* @param numberOfFeatures Indicates the indices of indexList.
|
|
20
|
-
*/
|
|
21
|
-
constructor(numberOfFeatures) {
|
|
22
|
-
super(new FeatureSubSet_1.FeatureSubSet(numberOfFeatures));
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The operator method calls backward method which starts with all the features and removes the least significant feature at each iteration.
|
|
26
|
-
*
|
|
27
|
-
* @param current FeatureSubset that will be added to new ArrayList.
|
|
28
|
-
* @param numberOfFeatures Indicates the indices of indexList.
|
|
29
|
-
* @return ArrayList of FeatureSubSets created from backward.
|
|
30
|
-
*/
|
|
31
|
-
operator(current, numberOfFeatures) {
|
|
32
|
-
let result = new Array();
|
|
33
|
-
this.backward(result, current);
|
|
34
|
-
return result;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.BackwardSelection = BackwardSelection;
|
|
38
|
-
});
|
|
27
|
+
}
|
|
28
|
+
exports.BackwardSelection = BackwardSelection;
|
|
39
29
|
//# sourceMappingURL=BackwardSelection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackwardSelection.js","sourceRoot":"","sources":["../../source/FeatureSelection/BackwardSelection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BackwardSelection.js","sourceRoot":"","sources":["../../source/FeatureSelection/BackwardSelection.ts"],"names":[],"mappings":";;;AAAA,uDAAkD;AAClD,mDAA8C;AAE9C,MAAa,iBAAkB,SAAQ,iCAAe;IAElD;;;;OAIG;IACH,YAAY,gBAAwB;QAChC,KAAK,CAAC,IAAI,6BAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACO,QAAQ,CAAC,OAAsB,EAAE,gBAAwB;QAC/D,IAAI,MAAM,GAAG,IAAI,KAAK,EAAiB,CAAC;QACxC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC/B,OAAO,MAAM,CAAC;IAClB,CAAC;CAEJ;AAxBD,8CAwBC"}
|
|
@@ -1,89 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FeatureSubSet = void 0;
|
|
4
|
+
class FeatureSubSet {
|
|
5
|
+
indexList = new Array();
|
|
6
|
+
/**
|
|
7
|
+
* A constructor that takes number of features as input and initializes indexList with these numbers.
|
|
8
|
+
*
|
|
9
|
+
* @param numberOfFeaturesOrList Indicates the indices of indexList.
|
|
10
|
+
*/
|
|
11
|
+
constructor(numberOfFeaturesOrList) {
|
|
12
|
+
if (numberOfFeaturesOrList != undefined) {
|
|
13
|
+
if (typeof numberOfFeaturesOrList == "number") {
|
|
14
|
+
for (let i = 0; i < numberOfFeaturesOrList; i++) {
|
|
15
|
+
this.indexList.push(i);
|
|
29
16
|
}
|
|
30
17
|
}
|
|
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]);
|
|
18
|
+
else {
|
|
19
|
+
this.indexList = numberOfFeaturesOrList;
|
|
41
20
|
}
|
|
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
21
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
*
|
|
81
|
-
* @param index Index of the item that will be removed.
|
|
82
|
-
*/
|
|
83
|
-
remove(index) {
|
|
84
|
-
this.indexList.splice(index, 1);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The clone method creates a new ArrayList with the elements of indexList and returns it as a new FeatureSubSet.
|
|
25
|
+
*
|
|
26
|
+
* @return A new ArrayList with the elements of indexList and returns it as a new FeatureSubSet.
|
|
27
|
+
*/
|
|
28
|
+
clone() {
|
|
29
|
+
let result = new FeatureSubSet(this.indexList.length);
|
|
30
|
+
for (let i = 0; i < this.indexList.length; i++) {
|
|
31
|
+
result.add(this.indexList[i]);
|
|
85
32
|
}
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The size method returns the size of the indexList.
|
|
37
|
+
*
|
|
38
|
+
* @return The size of the indexList.
|
|
39
|
+
*/
|
|
40
|
+
size() {
|
|
41
|
+
return this.indexList.length;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The get method returns the item of indexList at given index.
|
|
45
|
+
*
|
|
46
|
+
* @param index Index of the indexList to be accessed.
|
|
47
|
+
* @return The item of indexList at given index.
|
|
48
|
+
*/
|
|
49
|
+
get(index) {
|
|
50
|
+
return this.indexList[index];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The contains method returns True, if indexList contains given input number and False otherwise.
|
|
54
|
+
*
|
|
55
|
+
* @param featureNo Feature number that will be checked.
|
|
56
|
+
* @return True, if indexList contains given input number.
|
|
57
|
+
*/
|
|
58
|
+
contains(featureNo) {
|
|
59
|
+
return this.indexList.includes(featureNo);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The add method adds given Integer to the indexList.
|
|
63
|
+
*
|
|
64
|
+
* @param featureNo Integer that will be added to indexList.
|
|
65
|
+
*/
|
|
66
|
+
add(featureNo) {
|
|
67
|
+
this.indexList.push(featureNo);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The remove method removes the item of indexList at the given index.
|
|
71
|
+
*
|
|
72
|
+
* @param index Index of the item that will be removed.
|
|
73
|
+
*/
|
|
74
|
+
remove(index) {
|
|
75
|
+
this.indexList.splice(index, 1);
|
|
86
76
|
}
|
|
87
|
-
|
|
88
|
-
|
|
77
|
+
}
|
|
78
|
+
exports.FeatureSubSet = FeatureSubSet;
|
|
89
79
|
//# sourceMappingURL=FeatureSubSet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureSubSet.js","sourceRoot":"","sources":["../../source/FeatureSelection/FeatureSubSet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FeatureSubSet.js","sourceRoot":"","sources":["../../source/FeatureSelection/FeatureSubSet.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAa;IAEL,SAAS,GAAkB,IAAI,KAAK,EAAU,CAAA;IAE/D;;;;OAIG;IACH,YAAY,sBAA4B;QACpC,IAAI,sBAAsB,IAAI,SAAS,EAAC,CAAC;YACrC,IAAI,OAAO,sBAAsB,IAAI,QAAQ,EAAC,CAAC;gBAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,sBAAsB,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC9C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAC3B,CAAC;YACL,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,SAAS,GAAG,sBAAsB,CAAA;YAC3C,CAAC;QACL,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,KAAK;QACD,IAAI,MAAM,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QACrD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAC,CAAC;YAC5C,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;QACjC,CAAC;QACD,OAAO,MAAM,CAAA;IACjB,CAAC;IAED;;;;OAIG;IACH,IAAI;QACA,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAC,KAAa;QACb,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,SAAiB;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC7C,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,SAAiB;QACjB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAClC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAa;QAChB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IACnC,CAAC;CAEJ;AAjFD,sCAiFC"}
|
|
@@ -1,38 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FloatingSelection = void 0;
|
|
4
|
+
const SubSetSelection_1 = require("./SubSetSelection");
|
|
5
|
+
const FeatureSubSet_1 = require("./FeatureSubSet");
|
|
6
|
+
class FloatingSelection extends SubSetSelection_1.SubSetSelection {
|
|
7
|
+
/**
|
|
8
|
+
* Constructor that creates a new {@link FeatureSubSet}.
|
|
9
|
+
*/
|
|
10
|
+
constructor() {
|
|
11
|
+
super(new FeatureSubSet_1.FeatureSubSet());
|
|
5
12
|
}
|
|
6
|
-
|
|
7
|
-
|
|
13
|
+
/**
|
|
14
|
+
* The operator method calls forward and backward methods.
|
|
15
|
+
*
|
|
16
|
+
* @param current {@link FeatureSubSet} input.
|
|
17
|
+
* @param numberOfFeatures Indicates the indices of indexList.
|
|
18
|
+
* @return ArrayList of FeatureSubSet.
|
|
19
|
+
*/
|
|
20
|
+
operator(current, numberOfFeatures) {
|
|
21
|
+
let result = new Array();
|
|
22
|
+
this.forward(result, current, numberOfFeatures);
|
|
23
|
+
this.backward(result, current);
|
|
24
|
+
return result;
|
|
8
25
|
}
|
|
9
|
-
}
|
|
10
|
-
|
|
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
|
-
});
|
|
26
|
+
}
|
|
27
|
+
exports.FloatingSelection = FloatingSelection;
|
|
38
28
|
//# sourceMappingURL=FloatingSelection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingSelection.js","sourceRoot":"","sources":["../../source/FeatureSelection/FloatingSelection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FloatingSelection.js","sourceRoot":"","sources":["../../source/FeatureSelection/FloatingSelection.ts"],"names":[],"mappings":";;;AAAA,uDAAkD;AAClD,mDAA8C;AAE9C,MAAa,iBAAkB,SAAQ,iCAAe;IAElD;;OAEG;IACH;QACI,KAAK,CAAC,IAAI,6BAAa,EAAE,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACO,QAAQ,CAAC,OAAsB,EAAE,gBAAwB;QAC/D,IAAI,MAAM,GAAG,IAAI,KAAK,EAAiB,CAAC;QACxC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC;QAChD,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC/B,OAAO,MAAM,CAAC;IAClB,CAAC;CAEJ;AAvBD,8CAuBC"}
|
|
@@ -1,38 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ForwardSelection = void 0;
|
|
4
|
+
const SubSetSelection_1 = require("./SubSetSelection");
|
|
5
|
+
const FeatureSubSet_1 = require("./FeatureSubSet");
|
|
6
|
+
class ForwardSelection extends SubSetSelection_1.SubSetSelection {
|
|
7
|
+
/**
|
|
8
|
+
* Constructor that creates a new {@link FeatureSubSet}.
|
|
9
|
+
*/
|
|
10
|
+
constructor() {
|
|
11
|
+
super(new FeatureSubSet_1.FeatureSubSet());
|
|
5
12
|
}
|
|
6
|
-
|
|
7
|
-
|
|
13
|
+
/**
|
|
14
|
+
* The operator method calls forward method which starts with having no feature in the model. In each iteration,
|
|
15
|
+
* it keeps adding the features that are not currently listed.
|
|
16
|
+
*
|
|
17
|
+
* @param current FeatureSubset that will be added to new ArrayList.
|
|
18
|
+
* @param numberOfFeatures Indicates the indices of indexList.
|
|
19
|
+
* @return ArrayList of FeatureSubSets created from forward.
|
|
20
|
+
*/
|
|
21
|
+
operator(current, numberOfFeatures) {
|
|
22
|
+
let result = new Array();
|
|
23
|
+
this.forward(result, current, numberOfFeatures);
|
|
24
|
+
return result;
|
|
8
25
|
}
|
|
9
|
-
}
|
|
10
|
-
|
|
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
|
-
});
|
|
26
|
+
}
|
|
27
|
+
exports.ForwardSelection = ForwardSelection;
|
|
38
28
|
//# sourceMappingURL=ForwardSelection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ForwardSelection.js","sourceRoot":"","sources":["../../source/FeatureSelection/ForwardSelection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ForwardSelection.js","sourceRoot":"","sources":["../../source/FeatureSelection/ForwardSelection.ts"],"names":[],"mappings":";;;AAAA,uDAAkD;AAClD,mDAA8C;AAE9C,MAAa,gBAAiB,SAAQ,iCAAe;IAEjD;;OAEG;IACH;QACI,KAAK,CAAC,IAAI,6BAAa,EAAE,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;;OAOG;IACO,QAAQ,CAAC,OAAsB,EAAE,gBAAwB;QAC/D,IAAI,MAAM,GAAG,IAAI,KAAK,EAAiB,CAAC;QACxC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC;IAClB,CAAC;CAEJ;AAvBD,4CAuBC"}
|
|
@@ -1,90 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubSetSelection = void 0;
|
|
4
|
+
class SubSetSelection {
|
|
5
|
+
initialSubSet;
|
|
6
|
+
/**
|
|
7
|
+
* A constructor that sets the initial subset with given input.
|
|
8
|
+
*
|
|
9
|
+
* @param initialSubSet {@link FeatureSubSet} input.
|
|
10
|
+
*/
|
|
11
|
+
constructor(initialSubSet) {
|
|
12
|
+
this.initialSubSet = initialSubSet;
|
|
5
13
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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++) {
|
|
14
|
+
/**
|
|
15
|
+
* The forward method starts with having no feature in the model. In each iteration, it keeps adding the features that are not currently listed.
|
|
16
|
+
*
|
|
17
|
+
* @param currentSubSetList ArrayList to add the FeatureSubsets.
|
|
18
|
+
* @param current FeatureSubset that will be added to currentSubSetList.
|
|
19
|
+
* @param numberOfFeatures The number of features to add the subset.
|
|
20
|
+
*/
|
|
21
|
+
forward(currentSubSetList, current, numberOfFeatures) {
|
|
22
|
+
for (let i = 0; i < numberOfFeatures; i++) {
|
|
23
|
+
if (!current.contains(i)) {
|
|
46
24
|
let candidate = current.clone();
|
|
47
|
-
candidate.
|
|
25
|
+
candidate.add(i);
|
|
48
26
|
currentSubSetList.push(candidate);
|
|
49
27
|
}
|
|
50
28
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
let
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The backward method starts with all the features and removes the least significant feature at each iteration.
|
|
32
|
+
*
|
|
33
|
+
* @param currentSubSetList ArrayList to add the FeatureSubsets.
|
|
34
|
+
* @param current FeatureSubset that will be added to currentSubSetList
|
|
35
|
+
*/
|
|
36
|
+
backward(currentSubSetList, current) {
|
|
37
|
+
for (let i = 0; i < current.size(); i++) {
|
|
38
|
+
let candidate = current.clone();
|
|
39
|
+
candidate.remove(i);
|
|
40
|
+
currentSubSetList.push(candidate);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The execute method takes an {@link Experiment} and a {@link MultipleRun} as inputs. By selecting a candidateList from given
|
|
45
|
+
* Experiment it tries to find a FeatureSubSet that gives best performance.
|
|
46
|
+
*
|
|
47
|
+
* @param multipleRun {@link MultipleRun} type input.
|
|
48
|
+
* @param experiment {@link Experiment} type input.
|
|
49
|
+
* @return FeatureSubSet that gives best performance.
|
|
50
|
+
*/
|
|
51
|
+
execute(multipleRun, experiment) {
|
|
52
|
+
let processed = new Set();
|
|
53
|
+
let best = this.initialSubSet;
|
|
54
|
+
processed.add(best);
|
|
55
|
+
let betterFound = true;
|
|
56
|
+
let bestPerformance = undefined, currentPerformance;
|
|
57
|
+
if (best.size() > 0) {
|
|
58
|
+
bestPerformance = multipleRun.execute(experiment.featureSelectedExperiment(best));
|
|
59
|
+
}
|
|
60
|
+
while (betterFound) {
|
|
61
|
+
betterFound = false;
|
|
62
|
+
let candidateList = this.operator(best, experiment.getDataSet().getDataDefinition().attributeCount());
|
|
63
|
+
for (let candidateSubSet of candidateList) {
|
|
64
|
+
if (!processed.has(candidateSubSet)) {
|
|
65
|
+
if (candidateSubSet.size() > 0) {
|
|
66
|
+
currentPerformance = multipleRun.execute(experiment.featureSelectedExperiment(candidateSubSet));
|
|
67
|
+
if (bestPerformance == null || currentPerformance.isBetter(bestPerformance)) {
|
|
68
|
+
best = candidateSubSet;
|
|
69
|
+
bestPerformance = currentPerformance;
|
|
70
|
+
betterFound = true;
|
|
80
71
|
}
|
|
81
|
-
processed.add(candidateSubSet);
|
|
82
72
|
}
|
|
73
|
+
processed.add(candidateSubSet);
|
|
83
74
|
}
|
|
84
75
|
}
|
|
85
|
-
return best;
|
|
86
76
|
}
|
|
77
|
+
return best;
|
|
87
78
|
}
|
|
88
|
-
|
|
89
|
-
|
|
79
|
+
}
|
|
80
|
+
exports.SubSetSelection = SubSetSelection;
|
|
90
81
|
//# sourceMappingURL=SubSetSelection.js.map
|