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.
Files changed (178) hide show
  1. package/dist/Attribute/Attribute.js +6 -16
  2. package/dist/Attribute/Attribute.js.map +1 -1
  3. package/dist/Attribute/AttributeType.js +22 -32
  4. package/dist/Attribute/AttributeType.js.map +1 -1
  5. package/dist/Attribute/BinaryAttribute.js +14 -24
  6. package/dist/Attribute/BinaryAttribute.js.map +1 -1
  7. package/dist/Attribute/ContinuousAttribute.js +46 -55
  8. package/dist/Attribute/ContinuousAttribute.js.map +1 -1
  9. package/dist/Attribute/DiscreteAttribute.js +38 -48
  10. package/dist/Attribute/DiscreteAttribute.js.map +1 -1
  11. package/dist/Attribute/DiscreteIndexedAttribute.js +47 -55
  12. package/dist/Attribute/DiscreteIndexedAttribute.js.map +1 -1
  13. package/dist/DataSet/DataDefinition.js +115 -123
  14. package/dist/DataSet/DataDefinition.js.map +1 -1
  15. package/dist/DataSet/DataSet.js +268 -245
  16. package/dist/DataSet/DataSet.js.map +1 -1
  17. package/dist/DistanceMetric/DistanceMetric.js +2 -12
  18. package/dist/DistanceMetric/EuclidianDistance.js +27 -37
  19. package/dist/DistanceMetric/EuclidianDistance.js.map +1 -1
  20. package/dist/DistanceMetric/MahalanobisDistance.js +27 -36
  21. package/dist/DistanceMetric/MahalanobisDistance.js.map +1 -1
  22. package/dist/Experiment/BootstrapRun.js +31 -40
  23. package/dist/Experiment/BootstrapRun.js.map +1 -1
  24. package/dist/Experiment/Experiment.js +46 -53
  25. package/dist/Experiment/Experiment.js.map +1 -1
  26. package/dist/Experiment/KFoldRun.js +45 -54
  27. package/dist/Experiment/KFoldRun.js.map +1 -1
  28. package/dist/Experiment/KFoldRunSeparateTest.js +48 -58
  29. package/dist/Experiment/KFoldRunSeparateTest.js.map +1 -1
  30. package/dist/Experiment/MultipleRun.js +2 -12
  31. package/dist/Experiment/MxKFoldRun.js +31 -40
  32. package/dist/Experiment/MxKFoldRun.js.map +1 -1
  33. package/dist/Experiment/MxKFoldRunSeparateTest.js +35 -44
  34. package/dist/Experiment/MxKFoldRunSeparateTest.js.map +1 -1
  35. package/dist/Experiment/SingleRun.js +2 -12
  36. package/dist/Experiment/SingleRunWithK.js +39 -48
  37. package/dist/Experiment/SingleRunWithK.js.map +1 -1
  38. package/dist/Experiment/StratifiedKFoldRun.js +26 -36
  39. package/dist/Experiment/StratifiedKFoldRun.js.map +1 -1
  40. package/dist/Experiment/StratifiedKFoldRunSeparateTest.js +30 -40
  41. package/dist/Experiment/StratifiedKFoldRunSeparateTest.js.map +1 -1
  42. package/dist/Experiment/StratifiedMxKFoldRun.js +29 -39
  43. package/dist/Experiment/StratifiedMxKFoldRun.js.map +1 -1
  44. package/dist/Experiment/StratifiedMxKFoldRunSeparateTest.js +34 -43
  45. package/dist/Experiment/StratifiedMxKFoldRunSeparateTest.js.map +1 -1
  46. package/dist/Experiment/StratifiedSingleRunWithK.js +27 -36
  47. package/dist/Experiment/StratifiedSingleRunWithK.js.map +1 -1
  48. package/dist/FeatureSelection/BackwardSelection.js +26 -36
  49. package/dist/FeatureSelection/BackwardSelection.js.map +1 -1
  50. package/dist/FeatureSelection/FeatureSubSet.js +72 -82
  51. package/dist/FeatureSelection/FeatureSubSet.js.map +1 -1
  52. package/dist/FeatureSelection/FloatingSelection.js +25 -35
  53. package/dist/FeatureSelection/FloatingSelection.js.map +1 -1
  54. package/dist/FeatureSelection/ForwardSelection.js +25 -35
  55. package/dist/FeatureSelection/ForwardSelection.js.map +1 -1
  56. package/dist/FeatureSelection/SubSetSelection.js +69 -78
  57. package/dist/FeatureSelection/SubSetSelection.js.map +1 -1
  58. package/dist/Filter/DiscreteToContinuous.js +50 -60
  59. package/dist/Filter/DiscreteToContinuous.js.map +1 -1
  60. package/dist/Filter/DiscreteToIndexed.js +40 -50
  61. package/dist/Filter/DiscreteToIndexed.js.map +1 -1
  62. package/dist/Filter/FeatureFilter.js +23 -32
  63. package/dist/Filter/FeatureFilter.js.map +1 -1
  64. package/dist/Filter/LaryFilter.js +46 -55
  65. package/dist/Filter/LaryFilter.js.map +1 -1
  66. package/dist/Filter/LaryToBinary.js +48 -58
  67. package/dist/Filter/LaryToBinary.js.map +1 -1
  68. package/dist/Filter/Normalize.js +33 -41
  69. package/dist/Filter/Normalize.js.map +1 -1
  70. package/dist/Filter/Pca.js +86 -96
  71. package/dist/Filter/Pca.js.map +1 -1
  72. package/dist/Filter/TrainedFeatureFilter.js +14 -24
  73. package/dist/Filter/TrainedFeatureFilter.js.map +1 -1
  74. package/dist/Instance/CompositeInstance.js +46 -56
  75. package/dist/Instance/CompositeInstance.js.map +1 -1
  76. package/dist/Instance/Instance.js +145 -154
  77. package/dist/Instance/Instance.js.map +1 -1
  78. package/dist/InstanceList/InstanceList.js +466 -443
  79. package/dist/InstanceList/InstanceList.js.map +1 -1
  80. package/dist/InstanceList/InstanceListOfSameClass.js +23 -32
  81. package/dist/InstanceList/InstanceListOfSameClass.js.map +1 -1
  82. package/dist/InstanceList/Partition.js +167 -177
  83. package/dist/InstanceList/Partition.js.map +1 -1
  84. package/dist/Model/DecisionTree/DecisionCondition.js +71 -80
  85. package/dist/Model/DecisionTree/DecisionCondition.js.map +1 -1
  86. package/dist/Model/DecisionTree/DecisionNode.js +302 -311
  87. package/dist/Model/DecisionTree/DecisionNode.js.map +1 -1
  88. package/dist/Model/DecisionTree/DecisionStump.js +22 -32
  89. package/dist/Model/DecisionTree/DecisionStump.js.map +1 -1
  90. package/dist/Model/DecisionTree/DecisionTree.js +89 -98
  91. package/dist/Model/DecisionTree/DecisionTree.js.map +1 -1
  92. package/dist/Model/DummyModel.js +64 -73
  93. package/dist/Model/DummyModel.js.map +1 -1
  94. package/dist/Model/Ensemble/BaggingModel.js +34 -44
  95. package/dist/Model/Ensemble/BaggingModel.js.map +1 -1
  96. package/dist/Model/Ensemble/RandomForestModel.js +31 -41
  97. package/dist/Model/Ensemble/RandomForestModel.js.map +1 -1
  98. package/dist/Model/Ensemble/TreeEnsembleModel.js +55 -64
  99. package/dist/Model/Ensemble/TreeEnsembleModel.js.map +1 -1
  100. package/dist/Model/Model.js +130 -140
  101. package/dist/Model/Model.js.map +1 -1
  102. package/dist/Model/NeuralNetwork/DeepNetworkModel.js +162 -169
  103. package/dist/Model/NeuralNetwork/DeepNetworkModel.js.map +1 -1
  104. package/dist/Model/NeuralNetwork/LinearPerceptronModel.js +69 -78
  105. package/dist/Model/NeuralNetwork/LinearPerceptronModel.js.map +1 -1
  106. package/dist/Model/NeuralNetwork/MultiLayerPerceptronModel.js +112 -120
  107. package/dist/Model/NeuralNetwork/MultiLayerPerceptronModel.js.map +1 -1
  108. package/dist/Model/NeuralNetwork/NeuralNetworkModel.js +197 -201
  109. package/dist/Model/NeuralNetwork/NeuralNetworkModel.js.map +1 -1
  110. package/dist/Model/NonParametric/KnnInstance.js +21 -29
  111. package/dist/Model/NonParametric/KnnInstance.js.map +1 -1
  112. package/dist/Model/NonParametric/KnnModel.js +101 -108
  113. package/dist/Model/NonParametric/KnnModel.js.map +1 -1
  114. package/dist/Model/Parametric/GaussianModel.js +82 -91
  115. package/dist/Model/Parametric/GaussianModel.js.map +1 -1
  116. package/dist/Model/Parametric/KMeansModel.js +59 -67
  117. package/dist/Model/Parametric/KMeansModel.js.map +1 -1
  118. package/dist/Model/Parametric/LdaModel.js +83 -91
  119. package/dist/Model/Parametric/LdaModel.js.map +1 -1
  120. package/dist/Model/Parametric/NaiveBayesModel.js +119 -132
  121. package/dist/Model/Parametric/NaiveBayesModel.js.map +1 -1
  122. package/dist/Model/Parametric/QdaModel.js +70 -79
  123. package/dist/Model/Parametric/QdaModel.js.map +1 -1
  124. package/dist/Model/RandomModel.js +85 -92
  125. package/dist/Model/RandomModel.js.map +1 -1
  126. package/dist/Model/ValidatedModel.js +21 -31
  127. package/dist/Model/ValidatedModel.js.map +1 -1
  128. package/dist/Parameter/ActivationFunction.js +9 -19
  129. package/dist/Parameter/ActivationFunction.js.map +1 -1
  130. package/dist/Parameter/BaggingParameter.js +24 -33
  131. package/dist/Parameter/BaggingParameter.js.map +1 -1
  132. package/dist/Parameter/C45Parameter.js +34 -42
  133. package/dist/Parameter/C45Parameter.js.map +1 -1
  134. package/dist/Parameter/DeepNetworkParameter.js +48 -56
  135. package/dist/Parameter/DeepNetworkParameter.js.map +1 -1
  136. package/dist/Parameter/KMeansParameter.js +29 -38
  137. package/dist/Parameter/KMeansParameter.js.map +1 -1
  138. package/dist/Parameter/KnnParameter.js +25 -34
  139. package/dist/Parameter/KnnParameter.js.map +1 -1
  140. package/dist/Parameter/LinearPerceptronParameter.js +56 -62
  141. package/dist/Parameter/LinearPerceptronParameter.js.map +1 -1
  142. package/dist/Parameter/MultiLayerPerceptronParameter.js +38 -46
  143. package/dist/Parameter/MultiLayerPerceptronParameter.js.map +1 -1
  144. package/dist/Parameter/Parameter.js +21 -30
  145. package/dist/Parameter/Parameter.js.map +1 -1
  146. package/dist/Parameter/RandomForestParameter.js +25 -34
  147. package/dist/Parameter/RandomForestParameter.js.map +1 -1
  148. package/dist/Performance/ClassificationPerformance.js +24 -33
  149. package/dist/Performance/ClassificationPerformance.js.map +1 -1
  150. package/dist/Performance/ConfusionMatrix.js +149 -158
  151. package/dist/Performance/ConfusionMatrix.js.map +1 -1
  152. package/dist/Performance/DetailedClassificationPerformance.js +23 -32
  153. package/dist/Performance/DetailedClassificationPerformance.js.map +1 -1
  154. package/dist/Performance/ExperimentPerformance.js +184 -161
  155. package/dist/Performance/ExperimentPerformance.js.map +1 -1
  156. package/dist/Performance/Performance.js +21 -30
  157. package/dist/Performance/Performance.js.map +1 -1
  158. package/dist/StatisticalTest/Combined5x2F.js +41 -51
  159. package/dist/StatisticalTest/Combined5x2F.js.map +1 -1
  160. package/dist/StatisticalTest/Combined5x2t.js +42 -52
  161. package/dist/StatisticalTest/Combined5x2t.js.map +1 -1
  162. package/dist/StatisticalTest/Paired5x2t.js +40 -50
  163. package/dist/StatisticalTest/Paired5x2t.js.map +1 -1
  164. package/dist/StatisticalTest/PairedTest.js +31 -41
  165. package/dist/StatisticalTest/PairedTest.js.map +1 -1
  166. package/dist/StatisticalTest/Pairedt.js +38 -48
  167. package/dist/StatisticalTest/Pairedt.js.map +1 -1
  168. package/dist/StatisticalTest/Sign.js +50 -60
  169. package/dist/StatisticalTest/Sign.js.map +1 -1
  170. package/dist/StatisticalTest/StatisticalTestResult.js +65 -73
  171. package/dist/StatisticalTest/StatisticalTestResult.js.map +1 -1
  172. package/dist/StatisticalTest/StatisticalTestResultType.js +11 -21
  173. package/dist/StatisticalTest/StatisticalTestResultType.js.map +1 -1
  174. package/dist/index.js +95 -101
  175. package/dist/index.js.map +1 -1
  176. package/package.json +7 -6
  177. package/tsconfig.json +4 -3
  178. package/source/tsconfig.json +0 -13
@@ -1 +1 @@
1
- {"version":3,"file":"StratifiedMxKFoldRunSeparateTest.js","sourceRoot":"","sources":["../../source/Experiment/StratifiedMxKFoldRunSeparateTest.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,qFAAgF;IAEhF,gFAA2E;IAC3E,yDAAoD;IAEpD,4GAAuG;IAEvG,MAAa,gCAAiC,SAAQ,+DAA8B;QAIhF;;;;;WAKG;QACH,YAAY,CAAS,EAAE,CAAS;YAC5B,KAAK,CAAC,CAAC,CAAC,CAAC;YACT,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;QACd,CAAC;QAED;;;;;WAKG;QACH,OAAO,CAAC,UAAsB;YAC1B,IAAI,MAAM,GAAG,IAAI,6CAAqB,EAAE,CAAC;YACzC,IAAI,YAAY,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC,eAAe,EAAE,CAAC;YAC7D,IAAI,SAAS,GAAG,IAAI,qBAAS,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YACxD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;g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,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
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
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
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "nlptoolkit-sampling/dist/StratifiedKFoldCrossValidation", "../InstanceList/InstanceList"], factory);
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
- })(function (require, exports) {
10
- "use strict";
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":";;;;;;;;;;;;IAEA,4GAAuG;IAEvG,+DAA0D;IAE1D,MAAa,wBAAwB;QAIjC;;;;WAIG;QACH,YAAY,CAAS;YACjB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;QACd,CAAC;QAED;;;;;WAKG;QACH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AAC,SAAS,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;CACJ;AA1BD,4DA0BC"}
@@ -1,39 +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;
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
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./SubSetSelection", "./FeatureSubSet"], factory);
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
- })(function (require, exports) {
10
- "use strict";
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":";;;;;;;;;;;;IAAA,uDAAkD;IAClD,mDAA8C;IAE9C,MAAa,iBAAkB,SAAQ,iCAAe;QAElD;;;;WAIG;QACH,YAAY,gBAAwB;YAChC,KAAK,CAAC,IAAI,6BAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAC/C,CAAC;QAED;;;;;;WAMG;QACO,QAAQ,CAAC,OAAsB,EAAE,gBAAwB;YAC/D,IAAI,MAAM,GAAG,IAAI,KAAK,EAAiB,CAAC;YACxC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAC/B,OAAO,MAAM,CAAC;QAClB,CAAC;KAEJ;IAxBD,8CAwBC"}
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
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.FeatureSubSet = void 0;
13
- class FeatureSubSet {
14
- /**
15
- * A constructor that takes number of features as input and initializes indexList with these numbers.
16
- *
17
- * @param numberOfFeaturesOrList Indicates the indices of indexList.
18
- */
19
- constructor(numberOfFeaturesOrList) {
20
- this.indexList = new Array();
21
- if (numberOfFeaturesOrList != undefined) {
22
- if (typeof numberOfFeaturesOrList == "number") {
23
- for (let i = 0; i < numberOfFeaturesOrList; i++) {
24
- this.indexList.push(i);
25
- }
26
- }
27
- else {
28
- this.indexList = numberOfFeaturesOrList;
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
- * The add method adds given Integer to the indexList.
72
- *
73
- * @param featureNo Integer that will be added to indexList.
74
- */
75
- add(featureNo) {
76
- this.indexList.push(featureNo);
77
- }
78
- /**
79
- * The remove method removes the item of indexList at the given index.
80
- *
81
- * @param index Index of the item that will be removed.
82
- */
83
- remove(index) {
84
- this.indexList.splice(index, 1);
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
- exports.FeatureSubSet = FeatureSubSet;
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":";;;;;;;;;;;;IAAA,MAAa,aAAa;QAItB;;;;WAIG;QACH,YAAY,sBAA4B;YAPvB,cAAS,GAAkB,IAAI,KAAK,EAAU,CAAA;YAQ3D,IAAI,sBAAsB,IAAI,SAAS,EAAC;gBACpC,IAAI,OAAO,sBAAsB,IAAI,QAAQ,EAAC;oBAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,sBAAsB,EAAE,CAAC,EAAE,EAAE;wBAC7C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;qBAC1B;iBACJ;qBAAM;oBACH,IAAI,CAAC,SAAS,GAAG,sBAAsB,CAAA;iBAC1C;aACJ;QACL,CAAC;QAED;;;;WAIG;QACH,KAAK;YACD,IAAI,MAAM,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;YACrD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAC;gBAC3C,MAAM,CAAC,GAAG,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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
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
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
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./SubSetSelection", "./FeatureSubSet"], factory);
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
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.FloatingSelection = void 0;
13
- const SubSetSelection_1 = require("./SubSetSelection");
14
- const FeatureSubSet_1 = require("./FeatureSubSet");
15
- class FloatingSelection extends SubSetSelection_1.SubSetSelection {
16
- /**
17
- * Constructor that creates a new {@link FeatureSubSet}.
18
- */
19
- constructor() {
20
- super(new FeatureSubSet_1.FeatureSubSet());
21
- }
22
- /**
23
- * The operator method calls forward and backward methods.
24
- *
25
- * @param current {@link FeatureSubSet} input.
26
- * @param numberOfFeatures Indicates the indices of indexList.
27
- * @return ArrayList of FeatureSubSet.
28
- */
29
- operator(current, numberOfFeatures) {
30
- let result = new Array();
31
- this.forward(result, current, numberOfFeatures);
32
- this.backward(result, current);
33
- return result;
34
- }
35
- }
36
- exports.FloatingSelection = FloatingSelection;
37
- });
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":";;;;;;;;;;;;IAAA,uDAAkD;IAClD,mDAA8C;IAE9C,MAAa,iBAAkB,SAAQ,iCAAe;QAElD;;WAEG;QACH;YACI,KAAK,CAAC,IAAI,6BAAa,EAAE,CAAC,CAAC;QAC/B,CAAC;QAED;;;;;;WAMG;QACO,QAAQ,CAAC,OAAsB,EAAE,gBAAwB;YAC/D,IAAI,MAAM,GAAG,IAAI,KAAK,EAAiB,CAAC;YACxC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC;YAChD,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAC/B,OAAO,MAAM,CAAC;QAClB,CAAC;KAEJ;IAvBD,8CAuBC"}
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
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
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
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./SubSetSelection", "./FeatureSubSet"], factory);
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
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ForwardSelection = void 0;
13
- const SubSetSelection_1 = require("./SubSetSelection");
14
- const FeatureSubSet_1 = require("./FeatureSubSet");
15
- class ForwardSelection extends SubSetSelection_1.SubSetSelection {
16
- /**
17
- * Constructor that creates a new {@link FeatureSubSet}.
18
- */
19
- constructor() {
20
- super(new FeatureSubSet_1.FeatureSubSet());
21
- }
22
- /**
23
- * The operator method calls forward method which starts with having no feature in the model. In each iteration,
24
- * it keeps adding the features that are not currently listed.
25
- *
26
- * @param current FeatureSubset that will be added to new ArrayList.
27
- * @param numberOfFeatures Indicates the indices of indexList.
28
- * @return ArrayList of FeatureSubSets created from forward.
29
- */
30
- operator(current, numberOfFeatures) {
31
- let result = new Array();
32
- this.forward(result, current, numberOfFeatures);
33
- return result;
34
- }
35
- }
36
- exports.ForwardSelection = ForwardSelection;
37
- });
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":";;;;;;;;;;;;IAAA,uDAAkD;IAClD,mDAA8C;IAE9C,MAAa,gBAAiB,SAAQ,iCAAe;QAEjD;;WAEG;QACH;YACI,KAAK,CAAC,IAAI,6BAAa,EAAE,CAAC,CAAC;QAC/B,CAAC;QAED;;;;;;;WAOG;QACO,QAAQ,CAAC,OAAsB,EAAE,gBAAwB;YAC/D,IAAI,MAAM,GAAG,IAAI,KAAK,EAAiB,CAAC;YACxC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC;YAChD,OAAO,MAAM,CAAC;QAClB,CAAC;KAEJ;IAvBD,4CAuBC"}
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
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
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
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SubSetSelection = void 0;
13
- class SubSetSelection {
14
- /**
15
- * A constructor that sets the initial subset with given input.
16
- *
17
- * @param initialSubSet {@link FeatureSubSet} input.
18
- */
19
- constructor(initialSubSet) {
20
- this.initialSubSet = initialSubSet;
21
- }
22
- /**
23
- * The forward method starts with having no feature in the model. In each iteration, it keeps adding the features that are not currently listed.
24
- *
25
- * @param currentSubSetList ArrayList to add the FeatureSubsets.
26
- * @param current FeatureSubset that will be added to currentSubSetList.
27
- * @param numberOfFeatures The number of features to add the subset.
28
- */
29
- forward(currentSubSetList, current, numberOfFeatures) {
30
- for (let i = 0; i < numberOfFeatures; i++) {
31
- if (!current.contains(i)) {
32
- let candidate = current.clone();
33
- candidate.add(i);
34
- currentSubSetList.push(candidate);
35
- }
36
- }
37
- }
38
- /**
39
- * The backward method starts with all the features and removes the least significant feature at each iteration.
40
- *
41
- * @param currentSubSetList ArrayList to add the FeatureSubsets.
42
- * @param current FeatureSubset that will be added to currentSubSetList
43
- */
44
- backward(currentSubSetList, current) {
45
- for (let i = 0; i < current.size(); i++) {
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.remove(i);
25
+ candidate.add(i);
48
26
  currentSubSetList.push(candidate);
49
27
  }
50
28
  }
51
- /**
52
- * The execute method takes an {@link Experiment} and a {@link MultipleRun} as inputs. By selecting a candidateList from given
53
- * Experiment it tries to find a FeatureSubSet that gives best performance.
54
- *
55
- * @param multipleRun {@link MultipleRun} type input.
56
- * @param experiment {@link Experiment} type input.
57
- * @return FeatureSubSet that gives best performance.
58
- */
59
- execute(multipleRun, experiment) {
60
- let processed = new Set();
61
- let best = this.initialSubSet;
62
- processed.add(best);
63
- let betterFound = true;
64
- let bestPerformance = undefined, currentPerformance;
65
- if (best.size() > 0) {
66
- bestPerformance = multipleRun.execute(experiment.featureSelectedExperiment(best));
67
- }
68
- while (betterFound) {
69
- betterFound = false;
70
- let candidateList = this.operator(best, experiment.getDataSet().getDataDefinition().attributeCount());
71
- for (let candidateSubSet of candidateList) {
72
- if (!processed.has(candidateSubSet)) {
73
- if (candidateSubSet.size() > 0) {
74
- currentPerformance = multipleRun.execute(experiment.featureSelectedExperiment(candidateSubSet));
75
- if (bestPerformance == null || currentPerformance.isBetter(bestPerformance)) {
76
- best = candidateSubSet;
77
- bestPerformance = currentPerformance;
78
- betterFound = true;
79
- }
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
- exports.SubSetSelection = SubSetSelection;
89
- });
79
+ }
80
+ exports.SubSetSelection = SubSetSelection;
90
81
  //# sourceMappingURL=SubSetSelection.js.map