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,44 +1,35 @@
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.MxKFoldRun = void 0;
4
+ const KFoldRun_1 = require("./KFoldRun");
5
+ const ExperimentPerformance_1 = require("../Performance/ExperimentPerformance");
6
+ const KFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/KFoldCrossValidation");
7
+ class MxKFoldRun extends KFoldRun_1.KFoldRun {
8
+ M;
9
+ /**
10
+ * Constructor for MxKFoldRun class. Basically sets K parameter of the K-fold cross-validation and M for the number of times.
11
+ *
12
+ * @param M number of cross-validation times.
13
+ * @param K K of the K-fold cross-validation.
14
+ */
15
+ constructor(M, K) {
16
+ super(K);
17
+ this.M = M;
5
18
  }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./KFoldRun", "../Performance/ExperimentPerformance", "nlptoolkit-sampling/dist/KFoldCrossValidation"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MxKFoldRun = void 0;
13
- const KFoldRun_1 = require("./KFoldRun");
14
- const ExperimentPerformance_1 = require("../Performance/ExperimentPerformance");
15
- const KFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/KFoldCrossValidation");
16
- class MxKFoldRun extends KFoldRun_1.KFoldRun {
17
- /**
18
- * Constructor for MxKFoldRun class. Basically sets K parameter of the K-fold cross-validation and M for the number of times.
19
- *
20
- * @param M number of cross-validation times.
21
- * @param K K of the K-fold cross-validation.
22
- */
23
- constructor(M, K) {
24
- super(K);
25
- this.M = M;
26
- }
27
- /**
28
- * Execute the MxKFold run with the given classifier on the given data set using the given parameters.
29
- *
30
- * @param experiment Experiment to be run.
31
- * @return An ExperimentPerformance instance.
32
- */
33
- execute(experiment) {
34
- let result = new ExperimentPerformance_1.ExperimentPerformance();
35
- for (let j = 0; j < this.M; j++) {
36
- let crossValidation = new KFoldCrossValidation_1.KFoldCrossValidation(experiment.getDataSet().getInstances(), this.K, experiment.getParameter().getSeed());
37
- this.runExperiment(experiment.getmodel(), experiment.getParameter(), result, crossValidation);
38
- }
39
- return result;
19
+ /**
20
+ * Execute the MxKFold run with the given classifier on the given data set using the given parameters.
21
+ *
22
+ * @param experiment Experiment to be run.
23
+ * @return An ExperimentPerformance instance.
24
+ */
25
+ execute(experiment) {
26
+ let result = new ExperimentPerformance_1.ExperimentPerformance();
27
+ for (let j = 0; j < this.M; j++) {
28
+ let crossValidation = new KFoldCrossValidation_1.KFoldCrossValidation(experiment.getDataSet().getInstances(), this.K, experiment.getParameter().getSeed());
29
+ this.runExperiment(experiment.getmodel(), experiment.getParameter(), result, crossValidation);
40
30
  }
31
+ return result;
41
32
  }
42
- exports.MxKFoldRun = MxKFoldRun;
43
- });
33
+ }
34
+ exports.MxKFoldRun = MxKFoldRun;
44
35
  //# sourceMappingURL=MxKFoldRun.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MxKFoldRun.js","sourceRoot":"","sources":["../../source/Experiment/MxKFoldRun.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,yCAAoC;IAEpC,gFAA2E;IAC3E,wFAAmF;IAGnF,MAAa,UAAW,SAAQ,mBAAQ;QAIpC;;;;;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,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBAC7B,IAAI,eAAe,GAAG,IAAI,2CAAoB,CAAW,UAAU,CAAC,UAAU,EAAE,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;gBAC9I,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;aACjG;YACD,OAAO,MAAM,CAAC;QAClB,CAAC;KAEJ;IA9BD,gCA8BC"}
1
+ {"version":3,"file":"MxKFoldRun.js","sourceRoot":"","sources":["../../source/Experiment/MxKFoldRun.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAEpC,gFAA2E;AAC3E,wFAAmF;AAGnF,MAAa,UAAW,SAAQ,mBAAQ;IAE1B,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,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9B,IAAI,eAAe,GAAG,IAAI,2CAAoB,CAAW,UAAU,CAAC,UAAU,EAAE,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YAC9I,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QAClG,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CAEJ;AA9BD,gCA8BC"}
@@ -1,48 +1,39 @@
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.MxKFoldRunSeparateTest = void 0;
4
+ const KFoldRunSeparateTest_1 = require("./KFoldRunSeparateTest");
5
+ const ExperimentPerformance_1 = require("../Performance/ExperimentPerformance");
6
+ const Partition_1 = require("../InstanceList/Partition");
7
+ const KFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/KFoldCrossValidation");
8
+ class MxKFoldRunSeparateTest extends KFoldRunSeparateTest_1.KFoldRunSeparateTest {
9
+ M;
10
+ /**
11
+ * Constructor for KFoldRunSeparateTest class. Basically sets K parameter of the K-fold cross-validation and M for
12
+ * the number of times.
13
+ *
14
+ * @param M number of cross-validation times.
15
+ * @param K K of the K-fold cross-validation.
16
+ */
17
+ constructor(M, K) {
18
+ super(K);
19
+ this.M = M;
5
20
  }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./KFoldRunSeparateTest", "../Performance/ExperimentPerformance", "../InstanceList/Partition", "nlptoolkit-sampling/dist/KFoldCrossValidation"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MxKFoldRunSeparateTest = void 0;
13
- const KFoldRunSeparateTest_1 = require("./KFoldRunSeparateTest");
14
- const ExperimentPerformance_1 = require("../Performance/ExperimentPerformance");
15
- const Partition_1 = require("../InstanceList/Partition");
16
- const KFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/KFoldCrossValidation");
17
- class MxKFoldRunSeparateTest extends KFoldRunSeparateTest_1.KFoldRunSeparateTest {
18
- /**
19
- * Constructor for KFoldRunSeparateTest class. Basically sets K parameter of the K-fold cross-validation and M for
20
- * the number of times.
21
- *
22
- * @param M number of cross-validation times.
23
- * @param K K of the K-fold cross-validation.
24
- */
25
- constructor(M, K) {
26
- super(K);
27
- this.M = M;
28
- }
29
- /**
30
- * Execute the MxKFold run with separate test set with the given classifier on the given data set using the given parameters.
31
- *
32
- * @param experiment Experiment to be run.
33
- * @return An ExperimentPerformance instance.
34
- */
35
- execute(experiment) {
36
- let result = new ExperimentPerformance_1.ExperimentPerformance();
37
- let instanceList = experiment.getDataSet().getInstanceList();
38
- let partition = new Partition_1.Partition(instanceList, 0.25, true);
39
- for (let j = 0; j < this.M; j++) {
40
- let crossValidation = new KFoldCrossValidation_1.KFoldCrossValidation(partition.get(1).getInstances(), this.K, experiment.getParameter().getSeed());
41
- this.runExperiment(experiment.getmodel(), experiment.getParameter(), result, crossValidation, partition.get(0));
42
- }
43
- return result;
21
+ /**
22
+ * Execute the MxKFold run with separate test set with the given classifier on the given data set using the given parameters.
23
+ *
24
+ * @param experiment Experiment to be run.
25
+ * @return An ExperimentPerformance instance.
26
+ */
27
+ execute(experiment) {
28
+ let result = new ExperimentPerformance_1.ExperimentPerformance();
29
+ let instanceList = experiment.getDataSet().getInstanceList();
30
+ let partition = new Partition_1.Partition(instanceList, 0.25, true);
31
+ for (let j = 0; j < this.M; j++) {
32
+ let crossValidation = new KFoldCrossValidation_1.KFoldCrossValidation(partition.get(1).getInstances(), this.K, experiment.getParameter().getSeed());
33
+ this.runExperiment(experiment.getmodel(), experiment.getParameter(), result, crossValidation, partition.get(0));
44
34
  }
35
+ return result;
45
36
  }
46
- exports.MxKFoldRunSeparateTest = MxKFoldRunSeparateTest;
47
- });
37
+ }
38
+ exports.MxKFoldRunSeparateTest = MxKFoldRunSeparateTest;
48
39
  //# sourceMappingURL=MxKFoldRunSeparateTest.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MxKFoldRunSeparateTest.js","sourceRoot":"","sources":["../../source/Experiment/MxKFoldRunSeparateTest.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,iEAA4D;IAC5D,gFAA2E;IAE3E,yDAAoD;IACpD,wFAAmF;IAGnF,MAAa,sBAAuB,SAAQ,2CAAoB;QAI5D;;;;;;WAMG;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;gBAC7B,IAAI,eAAe,GAAG,IAAI,2CAAoB,CAAW,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;gBACvI,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;aACnH;YACD,OAAO,MAAM,CAAC;QAClB,CAAC;KACJ;IAhCD,wDAgCC"}
1
+ {"version":3,"file":"MxKFoldRunSeparateTest.js","sourceRoot":"","sources":["../../source/Experiment/MxKFoldRunSeparateTest.ts"],"names":[],"mappings":";;;AAAA,iEAA4D;AAC5D,gFAA2E;AAE3E,yDAAoD;AACpD,wFAAmF;AAGnF,MAAa,sBAAuB,SAAQ,2CAAoB;IAElD,CAAC,CAAQ;IAEnB;;;;;;OAMG;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,2CAAoB,CAAW,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YACvI,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,wDAgCC"}
@@ -1,13 +1,3 @@
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
- });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
13
3
  //# sourceMappingURL=SingleRun.js.map
@@ -1,52 +1,43 @@
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.SingleRunWithK = void 0;
4
+ const KFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/KFoldCrossValidation");
5
+ const InstanceList_1 = require("../InstanceList/InstanceList");
6
+ class SingleRunWithK {
7
+ K;
8
+ /**
9
+ * Constructor for SingleRunWithK 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/KFoldCrossValidation", "../InstanceList/InstanceList"], factory);
16
+ /**
17
+ * Runs first fold of a K fold cross-validated experiment for the given classifier with the given parameters.
18
+ * The experiment result will be returned.
19
+ * @param model Classifier for the experiment
20
+ * @param parameter Hyperparameters of the classifier of the experiment
21
+ * @param crossValidation K-fold crossvalidated dataset.
22
+ * @return The experiment result of the first fold of the K-fold cross-validated experiment.
23
+ * @throws DiscreteFeaturesNotAllowed If the classifier does not allow discrete features and the dataset contains
24
+ * discrete features, DiscreteFeaturesNotAllowed will be thrown.
25
+ */
26
+ runExperiment(model, parameter, crossValidation) {
27
+ let trainSet = new InstanceList_1.InstanceList(crossValidation.getTrainFold(0));
28
+ let testSet = new InstanceList_1.InstanceList(crossValidation.getTestFold(0));
29
+ return model.singleRun(parameter, trainSet, testSet);
8
30
  }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SingleRunWithK = void 0;
13
- const KFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/KFoldCrossValidation");
14
- const InstanceList_1 = require("../InstanceList/InstanceList");
15
- class SingleRunWithK {
16
- /**
17
- * Constructor for SingleRunWithK 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
- * Runs first fold of a K fold cross-validated experiment for the given classifier with the given parameters.
26
- * The experiment result will be returned.
27
- * @param model Classifier for the experiment
28
- * @param parameter Hyperparameters of the classifier of the experiment
29
- * @param crossValidation K-fold crossvalidated dataset.
30
- * @return The experiment result of the first fold of the K-fold cross-validated experiment.
31
- * @throws DiscreteFeaturesNotAllowed If the classifier does not allow discrete features and the dataset contains
32
- * discrete features, DiscreteFeaturesNotAllowed will be thrown.
33
- */
34
- runExperiment(model, parameter, crossValidation) {
35
- let trainSet = new InstanceList_1.InstanceList(crossValidation.getTrainFold(0));
36
- let testSet = new InstanceList_1.InstanceList(crossValidation.getTestFold(0));
37
- return model.singleRun(parameter, trainSet, testSet);
38
- }
39
- /**
40
- * Execute Single K-fold cross-validation with the given classifier on the given data set using the given parameters.
41
- *
42
- * @param experiment Experiment to be run.
43
- * @return A Performance instance
44
- */
45
- execute(experiment) {
46
- let crossValidation = new KFoldCrossValidation_1.KFoldCrossValidation(experiment.getDataSet().getInstances(), this.K, experiment.getParameter().getSeed());
47
- return this.runExperiment(experiment.getmodel(), experiment.getParameter(), crossValidation);
48
- }
31
+ /**
32
+ * Execute Single K-fold cross-validation with the given classifier on the given data set using the given parameters.
33
+ *
34
+ * @param experiment Experiment to be run.
35
+ * @return A Performance instance
36
+ */
37
+ execute(experiment) {
38
+ let crossValidation = new KFoldCrossValidation_1.KFoldCrossValidation(experiment.getDataSet().getInstances(), this.K, experiment.getParameter().getSeed());
39
+ return this.runExperiment(experiment.getmodel(), experiment.getParameter(), crossValidation);
49
40
  }
50
- exports.SingleRunWithK = SingleRunWithK;
51
- });
41
+ }
42
+ exports.SingleRunWithK = SingleRunWithK;
52
43
  //# sourceMappingURL=SingleRunWithK.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SingleRunWithK.js","sourceRoot":"","sources":["../../source/Experiment/SingleRunWithK.ts"],"names":[],"mappings":";;;;;;;;;;;;IAEA,wFAAmF;IAGnF,+DAA0D;IAK1D,MAAa,cAAc;QAIvB;;;;WAIG;QACH,YAAY,CAAS;YACjB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;QACd,CAAC;QAED;;;;;;;;;WASG;QACH,aAAa,CAAC,KAAY,EACZ,SAAoB,EACpB,eAA0C;YACpD,IAAI,QAAQ,GAAG,IAAI,2BAAY,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;YACjE,IAAI,OAAO,GAAG,IAAI,2BAAY,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/D,OAAO,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACzD,CAAC;QAED;;;;;WAKG;QACH,OAAO,CAAC,UAAsB;YAC1B,IAAI,eAAe,GAAG,IAAI,2CAAoB,CAAW,UAAU,CAAC,UAAU,EAAE,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,CAAC,EACnG,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YACzC,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC,YAAY,EAAE,EAAE,eAAe,CAAC,CAAC;QACjG,CAAC;KAEJ;IA3CD,wCA2CC"}
1
+ {"version":3,"file":"SingleRunWithK.js","sourceRoot":"","sources":["../../source/Experiment/SingleRunWithK.ts"],"names":[],"mappings":";;;AAEA,wFAAmF;AAGnF,+DAA0D;AAK1D,MAAa,cAAc;IAEN,CAAC,CAAQ;IAE1B;;;;OAIG;IACH,YAAY,CAAS;QACjB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;IACd,CAAC;IAED;;;;;;;;;OASG;IACH,aAAa,CAAC,KAAY,EACZ,SAAoB,EACpB,eAA0C;QACpD,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,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,UAAsB;QAC1B,IAAI,eAAe,GAAG,IAAI,2CAAoB,CAAW,UAAU,CAAC,UAAU,EAAE,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,CAAC,EACnG,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC,YAAY,EAAE,EAAE,eAAe,CAAC,CAAC;IACjG,CAAC;CAEJ;AA3CD,wCA2CC"}
@@ -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.StratifiedKFoldRun = void 0;
4
+ const KFoldRun_1 = require("./KFoldRun");
5
+ const ExperimentPerformance_1 = require("../Performance/ExperimentPerformance");
6
+ const StratifiedKFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/StratifiedKFoldCrossValidation");
7
+ class StratifiedKFoldRun extends KFoldRun_1.KFoldRun {
8
+ /**
9
+ * Constructor for KFoldRun class. Basically sets K parameter of the K-fold cross-validation.
10
+ * @param K K of the K-fold cross-validation.
11
+ */
12
+ constructor(K) {
13
+ super(K);
5
14
  }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./KFoldRun", "../Performance/ExperimentPerformance", "nlptoolkit-sampling/dist/StratifiedKFoldCrossValidation"], factory);
15
+ /**
16
+ * Execute Stratified K-fold cross-validation with the given classifier on the given data set using the given parameters.
17
+ *
18
+ * @param experiment Experiment to be run.
19
+ * @return An ExperimentPerformance instance.
20
+ */
21
+ execute(experiment) {
22
+ let result = new ExperimentPerformance_1.ExperimentPerformance();
23
+ let crossValidation = new StratifiedKFoldCrossValidation_1.StratifiedKFoldCrossValidation(experiment.getDataSet().getClassInstances(), this.K, experiment.getParameter().getSeed());
24
+ this.runExperiment(experiment.getmodel(), experiment.getParameter(), result, crossValidation);
25
+ return result;
8
26
  }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.StratifiedKFoldRun = void 0;
13
- const KFoldRun_1 = require("./KFoldRun");
14
- const ExperimentPerformance_1 = require("../Performance/ExperimentPerformance");
15
- const StratifiedKFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/StratifiedKFoldCrossValidation");
16
- class StratifiedKFoldRun extends KFoldRun_1.KFoldRun {
17
- /**
18
- * Constructor for KFoldRun class. Basically sets K parameter of the K-fold cross-validation.
19
- * @param K K of the K-fold cross-validation.
20
- */
21
- constructor(K) {
22
- super(K);
23
- }
24
- /**
25
- * Execute Stratified 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 An ExperimentPerformance instance.
29
- */
30
- execute(experiment) {
31
- let result = new ExperimentPerformance_1.ExperimentPerformance();
32
- let crossValidation = new StratifiedKFoldCrossValidation_1.StratifiedKFoldCrossValidation(experiment.getDataSet().getClassInstances(), this.K, experiment.getParameter().getSeed());
33
- this.runExperiment(experiment.getmodel(), experiment.getParameter(), result, crossValidation);
34
- return result;
35
- }
36
- }
37
- exports.StratifiedKFoldRun = StratifiedKFoldRun;
38
- });
27
+ }
28
+ exports.StratifiedKFoldRun = StratifiedKFoldRun;
39
29
  //# sourceMappingURL=StratifiedKFoldRun.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StratifiedKFoldRun.js","sourceRoot":"","sources":["../../source/Experiment/StratifiedKFoldRun.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,yCAAoC;IAEpC,gFAA2E;IAC3E,4GAAuG;IAGvG,MAAa,kBAAmB,SAAQ,mBAAQ;QAE5C;;;WAGG;QACH,YAAY,CAAS;YACjB,KAAK,CAAC,CAAC,CAAC,CAAC;QACb,CAAC;QAED;;;;;WAKG;QACH,OAAO,CAAC,UAAsB;YAC1B,IAAI,MAAM,GAAG,IAAI,6CAAqB,EAAE,CAAC;YACzC,IAAI,eAAe,GAAG,IAAI,+DAA8B,CAAW,UAAU,CAAC,UAAU,EAAE,CAAC,iBAAiB,EAAE,EAAE,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YAC7J,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;YAC9F,OAAO,MAAM,CAAC;QAClB,CAAC;KAEJ;IAvBD,gDAuBC"}
1
+ {"version":3,"file":"StratifiedKFoldRun.js","sourceRoot":"","sources":["../../source/Experiment/StratifiedKFoldRun.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAEpC,gFAA2E;AAC3E,4GAAuG;AAGvG,MAAa,kBAAmB,SAAQ,mBAAQ;IAE5C;;;OAGG;IACH,YAAY,CAAS;QACjB,KAAK,CAAC,CAAC,CAAC,CAAC;IACb,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,UAAsB;QAC1B,IAAI,MAAM,GAAG,IAAI,6CAAqB,EAAE,CAAC;QACzC,IAAI,eAAe,GAAG,IAAI,+DAA8B,CAAW,UAAU,CAAC,UAAU,EAAE,CAAC,iBAAiB,EAAE,EAAE,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;QAC7J,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QAC9F,OAAO,MAAM,CAAC;IAClB,CAAC;CAEJ;AAvBD,gDAuBC"}
@@ -1,43 +1,33 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StratifiedKFoldRunSeparateTest = void 0;
4
+ const KFoldRunSeparateTest_1 = require("./KFoldRunSeparateTest");
5
+ const ExperimentPerformance_1 = require("../Performance/ExperimentPerformance");
6
+ const Partition_1 = require("../InstanceList/Partition");
7
+ const StratifiedKFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/StratifiedKFoldCrossValidation");
8
+ class StratifiedKFoldRunSeparateTest extends KFoldRunSeparateTest_1.KFoldRunSeparateTest {
9
+ /**
10
+ * Constructor for StratifiedKFoldRunSeparateTest class. Basically sets K parameter of the K-fold cross-validation.
11
+ *
12
+ * @param K K of the K-fold cross-validation.
13
+ */
14
+ constructor(K) {
15
+ super(K);
5
16
  }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./KFoldRunSeparateTest", "../Performance/ExperimentPerformance", "../InstanceList/Partition", "nlptoolkit-sampling/dist/StratifiedKFoldCrossValidation"], factory);
17
+ /**
18
+ * Execute Stratified K-fold cross-validation with the given classifier on the given data set using the given parameters.
19
+ *
20
+ * @param experiment Experiment to be run.
21
+ * @return An ExperimentPerformance instance.
22
+ */
23
+ execute(experiment) {
24
+ let result = new ExperimentPerformance_1.ExperimentPerformance();
25
+ let instanceList = experiment.getDataSet().getInstanceList();
26
+ let partition = new Partition_1.Partition(instanceList, 0.25, true);
27
+ let crossValidation = new StratifiedKFoldCrossValidation_1.StratifiedKFoldCrossValidation(new Partition_1.Partition(partition.get(1)).getLists(), this.K, experiment.getParameter().getSeed());
28
+ this.runExperiment(experiment.getmodel(), experiment.getParameter(), result, crossValidation, partition.get(0));
29
+ return result;
8
30
  }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.StratifiedKFoldRunSeparateTest = void 0;
13
- const KFoldRunSeparateTest_1 = require("./KFoldRunSeparateTest");
14
- const ExperimentPerformance_1 = require("../Performance/ExperimentPerformance");
15
- const Partition_1 = require("../InstanceList/Partition");
16
- const StratifiedKFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/StratifiedKFoldCrossValidation");
17
- class StratifiedKFoldRunSeparateTest extends KFoldRunSeparateTest_1.KFoldRunSeparateTest {
18
- /**
19
- * Constructor for StratifiedKFoldRunSeparateTest class. Basically sets K parameter of the K-fold cross-validation.
20
- *
21
- * @param K K of the K-fold cross-validation.
22
- */
23
- constructor(K) {
24
- super(K);
25
- }
26
- /**
27
- * Execute Stratified K-fold cross-validation with the given classifier on the given data set using the given parameters.
28
- *
29
- * @param experiment Experiment to be run.
30
- * @return An ExperimentPerformance instance.
31
- */
32
- execute(experiment) {
33
- let result = new ExperimentPerformance_1.ExperimentPerformance();
34
- let instanceList = experiment.getDataSet().getInstanceList();
35
- let partition = new Partition_1.Partition(instanceList, 0.25, true);
36
- let crossValidation = new StratifiedKFoldCrossValidation_1.StratifiedKFoldCrossValidation(new Partition_1.Partition(partition.get(1)).getLists(), this.K, experiment.getParameter().getSeed());
37
- this.runExperiment(experiment.getmodel(), experiment.getParameter(), result, crossValidation, partition.get(0));
38
- return result;
39
- }
40
- }
41
- exports.StratifiedKFoldRunSeparateTest = StratifiedKFoldRunSeparateTest;
42
- });
31
+ }
32
+ exports.StratifiedKFoldRunSeparateTest = StratifiedKFoldRunSeparateTest;
43
33
  //# sourceMappingURL=StratifiedKFoldRunSeparateTest.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StratifiedKFoldRunSeparateTest.js","sourceRoot":"","sources":["../../source/Experiment/StratifiedKFoldRunSeparateTest.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,iEAA4D;IAE5D,gFAA2E;IAC3E,yDAAoD;IACpD,4GAAuG;IAGvG,MAAa,8BAA+B,SAAQ,2CAAoB;QAEpE;;;;WAIG;QACH,YAAY,CAAS;YACjB,KAAK,CAAC,CAAC,CAAC,CAAC;QACb,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,IAAI,eAAe,GAAG,IAAI,+DAA8B,CAAW,IAAI,qBAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YAC5J,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;YAChH,OAAO,MAAM,CAAC;QAClB,CAAC;KACJ;IAzBD,wEAyBC"}
1
+ {"version":3,"file":"StratifiedKFoldRunSeparateTest.js","sourceRoot":"","sources":["../../source/Experiment/StratifiedKFoldRunSeparateTest.ts"],"names":[],"mappings":";;;AAAA,iEAA4D;AAE5D,gFAA2E;AAC3E,yDAAoD;AACpD,4GAAuG;AAGvG,MAAa,8BAA+B,SAAQ,2CAAoB;IAEpE;;;;OAIG;IACH,YAAY,CAAS;QACjB,KAAK,CAAC,CAAC,CAAC,CAAC;IACb,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,IAAI,eAAe,GAAG,IAAI,+DAA8B,CAAW,IAAI,qBAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5J,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;QAChH,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAzBD,wEAyBC"}
@@ -1,43 +1,33 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StratifiedMxKFoldRun = void 0;
4
+ const MxKFoldRun_1 = require("./MxKFoldRun");
5
+ const ExperimentPerformance_1 = require("../Performance/ExperimentPerformance");
6
+ const StratifiedKFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/StratifiedKFoldCrossValidation");
7
+ class StratifiedMxKFoldRun extends MxKFoldRun_1.MxKFoldRun {
8
+ /**
9
+ * Constructor for StratifiedMxKFoldRun class. Basically sets K parameter of the K-fold cross-validation and M for the number of times.
10
+ *
11
+ * @param M number of cross-validation times.
12
+ * @param K K of the K-fold cross-validation.
13
+ */
14
+ constructor(M, K) {
15
+ super(M, K);
5
16
  }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./MxKFoldRun", "../Performance/ExperimentPerformance", "nlptoolkit-sampling/dist/StratifiedKFoldCrossValidation"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.StratifiedMxKFoldRun = void 0;
13
- const MxKFoldRun_1 = require("./MxKFoldRun");
14
- const ExperimentPerformance_1 = require("../Performance/ExperimentPerformance");
15
- const StratifiedKFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/StratifiedKFoldCrossValidation");
16
- class StratifiedMxKFoldRun extends MxKFoldRun_1.MxKFoldRun {
17
- /**
18
- * Constructor for StratifiedMxKFoldRun class. Basically sets K parameter of the K-fold cross-validation and M for the number of times.
19
- *
20
- * @param M number of cross-validation times.
21
- * @param K K of the K-fold cross-validation.
22
- */
23
- constructor(M, K) {
24
- super(M, K);
25
- }
26
- /**
27
- * Execute the Stratified MxK-fold cross-validation with the given classifier on the given data set using the given parameters.
28
- *
29
- * @param experiment Experiment to be run.
30
- * @return An ExperimentPerformance instance.
31
- */
32
- execute(experiment) {
33
- let result = new ExperimentPerformance_1.ExperimentPerformance();
34
- for (let j = 0; j < this.M; j++) {
35
- let crossValidation = new StratifiedKFoldCrossValidation_1.StratifiedKFoldCrossValidation(experiment.getDataSet().getClassInstances(), this.K, experiment.getParameter().getSeed());
36
- this.runExperiment(experiment.getmodel(), experiment.getParameter(), result, crossValidation);
37
- }
38
- return result;
17
+ /**
18
+ * Execute the Stratified MxK-fold cross-validation with the given classifier on the given data set using the given parameters.
19
+ *
20
+ * @param experiment Experiment to be run.
21
+ * @return An ExperimentPerformance instance.
22
+ */
23
+ execute(experiment) {
24
+ let result = new ExperimentPerformance_1.ExperimentPerformance();
25
+ for (let j = 0; j < this.M; j++) {
26
+ let crossValidation = new StratifiedKFoldCrossValidation_1.StratifiedKFoldCrossValidation(experiment.getDataSet().getClassInstances(), this.K, experiment.getParameter().getSeed());
27
+ this.runExperiment(experiment.getmodel(), experiment.getParameter(), result, crossValidation);
39
28
  }
29
+ return result;
40
30
  }
41
- exports.StratifiedMxKFoldRun = StratifiedMxKFoldRun;
42
- });
31
+ }
32
+ exports.StratifiedMxKFoldRun = StratifiedMxKFoldRun;
43
33
  //# sourceMappingURL=StratifiedMxKFoldRun.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StratifiedMxKFoldRun.js","sourceRoot":"","sources":["../../source/Experiment/StratifiedMxKFoldRun.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6CAAwC;IAExC,gFAA2E;IAC3E,4GAAuG;IAGvG,MAAa,oBAAqB,SAAQ,uBAAU;QAEhD;;;;;WAKG;QACH,YAAY,CAAS,EAAE,CAAS;YAC5B,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAChB,CAAC;QAED;;;;;WAKG;QACH,OAAO,CAAC,UAAsB;YAC1B,IAAI,MAAM,GAAG,IAAI,6CAAqB,EAAE,CAAC;YACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBAC7B,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;gBACjD,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;aACjG;YACD,OAAO,MAAM,CAAC;QAClB,CAAC;KACJ;IA3BD,oDA2BC"}
1
+ {"version":3,"file":"StratifiedMxKFoldRun.js","sourceRoot":"","sources":["../../source/Experiment/StratifiedMxKFoldRun.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AAExC,gFAA2E;AAC3E,4GAAuG;AAGvG,MAAa,oBAAqB,SAAQ,uBAAU;IAEhD;;;;;OAKG;IACH,YAAY,CAAS,EAAE,CAAS;QAC5B,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChB,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,UAAsB;QAC1B,IAAI,MAAM,GAAG,IAAI,6CAAqB,EAAE,CAAC;QACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9B,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;YACjD,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QAClG,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AA3BD,oDA2BC"}
@@ -1,47 +1,38 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StratifiedMxKFoldRunSeparateTest = void 0;
4
+ const StratifiedKFoldRunSeparateTest_1 = require("./StratifiedKFoldRunSeparateTest");
5
+ const ExperimentPerformance_1 = require("../Performance/ExperimentPerformance");
6
+ const Partition_1 = require("../InstanceList/Partition");
7
+ const StratifiedKFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/StratifiedKFoldCrossValidation");
8
+ class StratifiedMxKFoldRunSeparateTest extends StratifiedKFoldRunSeparateTest_1.StratifiedKFoldRunSeparateTest {
9
+ M;
10
+ /**
11
+ * Constructor for StratifiedMxKFoldRunSeparateTest class. Basically sets K parameter of the K-fold cross-validation and M for the number of times.
12
+ *
13
+ * @param M number of cross-validation times.
14
+ * @param K K of the K-fold cross-validation.
15
+ */
16
+ constructor(M, K) {
17
+ super(K);
18
+ this.M = M;
5
19
  }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./StratifiedKFoldRunSeparateTest", "../Performance/ExperimentPerformance", "../InstanceList/Partition", "nlptoolkit-sampling/dist/StratifiedKFoldCrossValidation"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.StratifiedMxKFoldRunSeparateTest = void 0;
13
- const StratifiedKFoldRunSeparateTest_1 = require("./StratifiedKFoldRunSeparateTest");
14
- const ExperimentPerformance_1 = require("../Performance/ExperimentPerformance");
15
- const Partition_1 = require("../InstanceList/Partition");
16
- const StratifiedKFoldCrossValidation_1 = require("nlptoolkit-sampling/dist/StratifiedKFoldCrossValidation");
17
- class StratifiedMxKFoldRunSeparateTest extends StratifiedKFoldRunSeparateTest_1.StratifiedKFoldRunSeparateTest {
18
- /**
19
- * Constructor for StratifiedMxKFoldRunSeparateTest class. Basically sets K parameter of the K-fold cross-validation and M for the number of times.
20
- *
21
- * @param M number of cross-validation times.
22
- * @param K K of the K-fold cross-validation.
23
- */
24
- constructor(M, K) {
25
- super(K);
26
- this.M = M;
27
- }
28
- /**
29
- * Execute the Stratified MxK-fold cross-validation with the given classifier on the given data set using the given parameters.
30
- *
31
- * @param experiment Experiment to be run.
32
- * @return An ExperimentPerformance instance.
33
- */
34
- execute(experiment) {
35
- let result = new ExperimentPerformance_1.ExperimentPerformance();
36
- let instanceList = experiment.getDataSet().getInstanceList();
37
- let partition = new Partition_1.Partition(instanceList, 0.25, true);
38
- for (let j = 0; j < this.M; j++) {
39
- let crossValidation = new StratifiedKFoldCrossValidation_1.StratifiedKFoldCrossValidation(new Partition_1.Partition(partition.get(1)).getLists(), this.K, experiment.getParameter().getSeed());
40
- this.runExperiment(experiment.getmodel(), experiment.getParameter(), result, crossValidation, partition.get(0));
41
- }
42
- return result;
20
+ /**
21
+ * Execute the Stratified MxK-fold cross-validation with the given classifier on the given data set using the given parameters.
22
+ *
23
+ * @param experiment Experiment to be run.
24
+ * @return An ExperimentPerformance instance.
25
+ */
26
+ execute(experiment) {
27
+ let result = new ExperimentPerformance_1.ExperimentPerformance();
28
+ let instanceList = experiment.getDataSet().getInstanceList();
29
+ let partition = new Partition_1.Partition(instanceList, 0.25, true);
30
+ for (let j = 0; j < this.M; j++) {
31
+ let crossValidation = new StratifiedKFoldCrossValidation_1.StratifiedKFoldCrossValidation(new Partition_1.Partition(partition.get(1)).getLists(), this.K, experiment.getParameter().getSeed());
32
+ this.runExperiment(experiment.getmodel(), experiment.getParameter(), result, crossValidation, partition.get(0));
43
33
  }
34
+ return result;
44
35
  }
45
- exports.StratifiedMxKFoldRunSeparateTest = StratifiedMxKFoldRunSeparateTest;
46
- });
36
+ }
37
+ exports.StratifiedMxKFoldRunSeparateTest = StratifiedMxKFoldRunSeparateTest;
47
38
  //# sourceMappingURL=StratifiedMxKFoldRunSeparateTest.js.map