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,36 +1,27 @@
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.ClassificationPerformance = void 0;
4
+ const Performance_1 = require("./Performance");
5
+ class ClassificationPerformance extends Performance_1.Performance {
6
+ accuracy;
7
+ /**
8
+ * A constructor that sets the accuracy and errorRate via given input.
9
+ *
10
+ * @param accuracy Double value input.
11
+ * @param errorRate Double value input.
12
+ */
13
+ constructor(accuracy, errorRate) {
14
+ super(errorRate == undefined ? 1 - accuracy : errorRate);
15
+ this.accuracy = accuracy;
5
16
  }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./Performance"], factory);
17
+ /**
18
+ * Accessor for the accuracy.
19
+ *
20
+ * @return Accuracy value.
21
+ */
22
+ getAccuracy() {
23
+ return this.accuracy;
8
24
  }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ClassificationPerformance = void 0;
13
- const Performance_1 = require("./Performance");
14
- class ClassificationPerformance extends Performance_1.Performance {
15
- /**
16
- * A constructor that sets the accuracy and errorRate via given input.
17
- *
18
- * @param accuracy Double value input.
19
- * @param errorRate Double value input.
20
- */
21
- constructor(accuracy, errorRate) {
22
- super(errorRate == undefined ? 1 - accuracy : errorRate);
23
- this.accuracy = accuracy;
24
- }
25
- /**
26
- * Accessor for the accuracy.
27
- *
28
- * @return Accuracy value.
29
- */
30
- getAccuracy() {
31
- return this.accuracy;
32
- }
33
- }
34
- exports.ClassificationPerformance = ClassificationPerformance;
35
- });
25
+ }
26
+ exports.ClassificationPerformance = ClassificationPerformance;
36
27
  //# sourceMappingURL=ClassificationPerformance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClassificationPerformance.js","sourceRoot":"","sources":["../../source/Performance/ClassificationPerformance.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,+CAA0C;IAE1C,MAAa,yBAA0B,SAAQ,yBAAW;QAItD;;;;;WAKG;QACH,YAAY,QAAgB,EAAE,SAAkB;YAC5C,KAAK,CAAC,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YACzD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QAC5B,CAAC;QAED;;;;WAIG;QACH,WAAW;YACP,OAAO,IAAI,CAAC,QAAQ,CAAA;QACxB,CAAC;KACJ;IAvBD,8DAuBC"}
1
+ {"version":3,"file":"ClassificationPerformance.js","sourceRoot":"","sources":["../../source/Performance/ClassificationPerformance.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAE1C,MAAa,yBAA0B,SAAQ,yBAAW;IAErC,QAAQ,CAAQ;IAEjC;;;;;OAKG;IACH,YAAY,QAAgB,EAAE,SAAkB;QAC5C,KAAK,CAAC,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACzD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC5B,CAAC;IAED;;;;OAIG;IACH,WAAW;QACP,OAAO,IAAI,CAAC,QAAQ,CAAA;IACxB,CAAC;CACJ;AAvBD,8DAuBC"}
@@ -1,178 +1,169 @@
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.ConfusionMatrix = void 0;
4
+ const CounterHashMap_1 = require("nlptoolkit-datastructure/dist/CounterHashMap");
5
+ class ConfusionMatrix {
6
+ matrix = new Map();
7
+ classLabels;
8
+ /**
9
+ * Constructor that sets the class labels {@link Array} and creates new {@link Map} matrix
10
+ *
11
+ * @param classLabels {@link ArrayList} of String.
12
+ */
13
+ constructor(classLabels) {
14
+ this.classLabels = classLabels;
5
15
  }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "nlptoolkit-datastructure/dist/CounterHashMap"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ConfusionMatrix = void 0;
13
- const CounterHashMap_1 = require("nlptoolkit-datastructure/dist/CounterHashMap");
14
- class ConfusionMatrix {
15
- /**
16
- * Constructor that sets the class labels {@link Array} and creates new {@link Map} matrix
17
- *
18
- * @param classLabels {@link ArrayList} of String.
19
- */
20
- constructor(classLabels) {
21
- this.matrix = new Map();
22
- this.classLabels = classLabels;
16
+ /**
17
+ * The classify method takes two Strings; actual class and predicted class as inputs. If the matrix {@link Map} contains
18
+ * given actual class String as a key, it then assigns the corresponding object of that key to a {@link CounterHashMap}, if not
19
+ * it creates a new {@link CounterHashMap}. Then, it puts the given predicted class String to the counterHashMap and
20
+ * also put this counterHashMap to the matrix {@link Map} together with the given actual class String.
21
+ *
22
+ * @param actualClass String input actual class.
23
+ * @param predictedClass String input predicted class.
24
+ */
25
+ classify(actualClass, predictedClass) {
26
+ let counterHashMap;
27
+ if (this.matrix.has(actualClass)) {
28
+ counterHashMap = this.matrix.get(actualClass);
29
+ }
30
+ else {
31
+ counterHashMap = new CounterHashMap_1.CounterHashMap();
23
32
  }
24
- /**
25
- * The classify method takes two Strings; actual class and predicted class as inputs. If the matrix {@link Map} contains
26
- * given actual class String as a key, it then assigns the corresponding object of that key to a {@link CounterHashMap}, if not
27
- * it creates a new {@link CounterHashMap}. Then, it puts the given predicted class String to the counterHashMap and
28
- * also put this counterHashMap to the matrix {@link Map} together with the given actual class String.
29
- *
30
- * @param actualClass String input actual class.
31
- * @param predictedClass String input predicted class.
32
- */
33
- classify(actualClass, predictedClass) {
34
- let counterHashMap;
33
+ counterHashMap.put(predictedClass);
34
+ this.matrix.set(actualClass, counterHashMap);
35
+ }
36
+ /**
37
+ * The addConfusionMatrix method takes a {@link ConfusionMatrix} as an input and loops through actual classes of that {@link Map}
38
+ * and initially gets one row at a time. Then it puts the current row to the matrix {@link Map} together with the actual class string.
39
+ *
40
+ * @param confusionMatrix {@link ConfusionMatrix} input.
41
+ */
42
+ addConfusionMatrix(confusionMatrix) {
43
+ for (let actualClass of confusionMatrix.matrix.keys()) {
44
+ let rowToBeAdded = confusionMatrix.matrix.get(actualClass);
35
45
  if (this.matrix.has(actualClass)) {
36
- counterHashMap = this.matrix.get(actualClass);
46
+ let currentRow = this.matrix.get(actualClass);
47
+ currentRow.add(rowToBeAdded);
48
+ this.matrix.set(actualClass, currentRow);
37
49
  }
38
50
  else {
39
- counterHashMap = new CounterHashMap_1.CounterHashMap();
40
- }
41
- counterHashMap.put(predictedClass);
42
- this.matrix.set(actualClass, counterHashMap);
43
- }
44
- /**
45
- * The addConfusionMatrix method takes a {@link ConfusionMatrix} as an input and loops through actual classes of that {@link Map}
46
- * and initially gets one row at a time. Then it puts the current row to the matrix {@link Map} together with the actual class string.
47
- *
48
- * @param confusionMatrix {@link ConfusionMatrix} input.
49
- */
50
- addConfusionMatrix(confusionMatrix) {
51
- for (let actualClass of confusionMatrix.matrix.keys()) {
52
- let rowToBeAdded = confusionMatrix.matrix.get(actualClass);
53
- if (this.matrix.has(actualClass)) {
54
- let currentRow = this.matrix.get(actualClass);
55
- currentRow.add(rowToBeAdded);
56
- this.matrix.set(actualClass, currentRow);
57
- }
58
- else {
59
- this.matrix.set(actualClass, rowToBeAdded);
60
- }
51
+ this.matrix.set(actualClass, rowToBeAdded);
61
52
  }
62
53
  }
63
- /**
64
- * The sumOfElements method loops through the keys in matrix {@link Map} and returns the summation of all the values of the keys.
65
- * I.e: TP+TN+FP+FN.
66
- *
67
- * @return The summation of values.
68
- */
69
- sumOfElements() {
70
- let result = 0;
71
- for (let actualClass of this.matrix.keys()) {
72
- result += this.matrix.get(actualClass).sumOfCounts();
73
- }
74
- return result;
54
+ }
55
+ /**
56
+ * The sumOfElements method loops through the keys in matrix {@link Map} and returns the summation of all the values of the keys.
57
+ * I.e: TP+TN+FP+FN.
58
+ *
59
+ * @return The summation of values.
60
+ */
61
+ sumOfElements() {
62
+ let result = 0;
63
+ for (let actualClass of this.matrix.keys()) {
64
+ result += this.matrix.get(actualClass).sumOfCounts();
75
65
  }
76
- /**
77
- * The trace method loops through the keys in matrix {@link Map} and if the current key contains the actual key,
78
- * it accumulates the corresponding values. I.e: TP+TN.
79
- *
80
- * @return Summation of values.
81
- */
82
- trace() {
83
- let result = 0;
84
- for (let actualClass of this.matrix.keys()) {
85
- if (this.matrix.get(actualClass).has(actualClass)) {
86
- result += this.matrix.get(actualClass).get(actualClass);
87
- }
66
+ return result;
67
+ }
68
+ /**
69
+ * The trace method loops through the keys in matrix {@link Map} and if the current key contains the actual key,
70
+ * it accumulates the corresponding values. I.e: TP+TN.
71
+ *
72
+ * @return Summation of values.
73
+ */
74
+ trace() {
75
+ let result = 0;
76
+ for (let actualClass of this.matrix.keys()) {
77
+ if (this.matrix.get(actualClass).has(actualClass)) {
78
+ result += this.matrix.get(actualClass).get(actualClass);
88
79
  }
89
- return result;
90
80
  }
91
- /**
92
- * The columnSum method takes a String predicted class as input, and loops through the keys in matrix {@link HashMap}.
93
- * If the current key contains the predicted class String, it accumulates the corresponding values. I.e: TP+FP.
94
- *
95
- * @param predictedClass String input predicted class.
96
- * @return Summation of values.
97
- */
98
- columnSum(predictedClass) {
99
- let result = 0;
100
- for (let actualClass of this.matrix.keys()) {
101
- if (this.matrix.get(actualClass).has(predictedClass)) {
102
- result += this.matrix.get(actualClass).get(predictedClass);
103
- }
81
+ return result;
82
+ }
83
+ /**
84
+ * The columnSum method takes a String predicted class as input, and loops through the keys in matrix {@link HashMap}.
85
+ * If the current key contains the predicted class String, it accumulates the corresponding values. I.e: TP+FP.
86
+ *
87
+ * @param predictedClass String input predicted class.
88
+ * @return Summation of values.
89
+ */
90
+ columnSum(predictedClass) {
91
+ let result = 0;
92
+ for (let actualClass of this.matrix.keys()) {
93
+ if (this.matrix.get(actualClass).has(predictedClass)) {
94
+ result += this.matrix.get(actualClass).get(predictedClass);
104
95
  }
105
- return result;
106
- }
107
- /**
108
- * The getAccuracy method returns the result of TP+TN / TP+TN+FP+FN
109
- *
110
- * @return the result of TP+TN / TP+TN+FP+FN
111
- */
112
- getAccuracy() {
113
- return this.trace() / this.sumOfElements();
114
96
  }
115
- /**
116
- * The precision method loops through the class labels and returns the resulting Array which has the result of TP/FP+TP.
117
- *
118
- * @return The result of TP/FP+TP.
119
- */
120
- precision() {
121
- let result = new Array(this.classLabels.length).fill(0);
122
- for (let i = 0; i < this.classLabels.length; i++) {
123
- let actualClass = this.classLabels[i];
124
- if (this.matrix.has(actualClass)) {
125
- result[i] = this.matrix.get(actualClass).get(actualClass) / this.columnSum(actualClass);
126
- }
97
+ return result;
98
+ }
99
+ /**
100
+ * The getAccuracy method returns the result of TP+TN / TP+TN+FP+FN
101
+ *
102
+ * @return the result of TP+TN / TP+TN+FP+FN
103
+ */
104
+ getAccuracy() {
105
+ return this.trace() / this.sumOfElements();
106
+ }
107
+ /**
108
+ * The precision method loops through the class labels and returns the resulting Array which has the result of TP/FP+TP.
109
+ *
110
+ * @return The result of TP/FP+TP.
111
+ */
112
+ precision() {
113
+ let result = new Array(this.classLabels.length).fill(0);
114
+ for (let i = 0; i < this.classLabels.length; i++) {
115
+ let actualClass = this.classLabels[i];
116
+ if (this.matrix.has(actualClass)) {
117
+ result[i] = this.matrix.get(actualClass).get(actualClass) / this.columnSum(actualClass);
127
118
  }
128
- return result;
129
119
  }
130
- /**
131
- * The recall method loops through the class labels and returns the resulting Array which has the result of TP/FN+TP.
132
- *
133
- * @return The result of TP/FN+TP.
134
- */
135
- recall() {
136
- let result = new Array(this.classLabels.length).fill(0);
137
- for (let i = 0; i < this.classLabels.length; i++) {
138
- let actualClass = this.classLabels[i];
139
- if (this.matrix.has(actualClass)) {
140
- result[i] = this.matrix.get(actualClass).get(actualClass) / this.matrix.get(actualClass).sumOfCounts();
141
- }
120
+ return result;
121
+ }
122
+ /**
123
+ * The recall method loops through the class labels and returns the resulting Array which has the result of TP/FN+TP.
124
+ *
125
+ * @return The result of TP/FN+TP.
126
+ */
127
+ recall() {
128
+ let result = new Array(this.classLabels.length).fill(0);
129
+ for (let i = 0; i < this.classLabels.length; i++) {
130
+ let actualClass = this.classLabels[i];
131
+ if (this.matrix.has(actualClass)) {
132
+ result[i] = this.matrix.get(actualClass).get(actualClass) / this.matrix.get(actualClass).sumOfCounts();
142
133
  }
143
- return result;
144
134
  }
145
- /**
146
- * The fMeasure method loops through the class labels and returns the resulting Array which has the average of
147
- * recall and precision.
148
- *
149
- * @return The average of recall and precision.
150
- */
151
- fMeasure() {
152
- let precision = this.precision();
153
- let recall = this.recall();
154
- let result = new Array(this.classLabels.length).fill(0);
155
- for (let i = 0; i < this.classLabels.length; i++) {
156
- result[i] = 2 / (1 / precision[i] + 1 / recall[i]);
157
- }
158
- return result;
135
+ return result;
136
+ }
137
+ /**
138
+ * The fMeasure method loops through the class labels and returns the resulting Array which has the average of
139
+ * recall and precision.
140
+ *
141
+ * @return The average of recall and precision.
142
+ */
143
+ fMeasure() {
144
+ let precision = this.precision();
145
+ let recall = this.recall();
146
+ let result = new Array(this.classLabels.length).fill(0);
147
+ for (let i = 0; i < this.classLabels.length; i++) {
148
+ result[i] = 2 / (1 / precision[i] + 1 / recall[i]);
159
149
  }
160
- /**
161
- * The weightedFMeasure method loops through the class labels and returns the resulting Array which has the weighted average of
162
- * recall and precision.
163
- *
164
- * @return The weighted average of recall and precision.
165
- */
166
- weightedFMeasure() {
167
- let fMeasure = this.fMeasure();
168
- let sum = 0;
169
- for (let i = 0; i < this.classLabels.length; i++) {
170
- let actualClass = this.classLabels[i];
171
- sum += fMeasure[i] * this.matrix.get(actualClass).sumOfCounts();
172
- }
173
- return sum / this.sumOfElements();
150
+ return result;
151
+ }
152
+ /**
153
+ * The weightedFMeasure method loops through the class labels and returns the resulting Array which has the weighted average of
154
+ * recall and precision.
155
+ *
156
+ * @return The weighted average of recall and precision.
157
+ */
158
+ weightedFMeasure() {
159
+ let fMeasure = this.fMeasure();
160
+ let sum = 0;
161
+ for (let i = 0; i < this.classLabels.length; i++) {
162
+ let actualClass = this.classLabels[i];
163
+ sum += fMeasure[i] * this.matrix.get(actualClass).sumOfCounts();
174
164
  }
165
+ return sum / this.sumOfElements();
175
166
  }
176
- exports.ConfusionMatrix = ConfusionMatrix;
177
- });
167
+ }
168
+ exports.ConfusionMatrix = ConfusionMatrix;
178
169
  //# sourceMappingURL=ConfusionMatrix.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfusionMatrix.js","sourceRoot":"","sources":["../../source/Performance/ConfusionMatrix.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,iFAA4E;IAE5E,MAAa,eAAe;QAKxB;;;;WAIG;QACH,YAAY,WAA0B;YAR9B,WAAM,GAAwC,IAAI,GAAG,EAAkC,CAAA;YAS3F,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAClC,CAAC;QAED;;;;;;;;WAQG;QACH,QAAQ,CAAC,WAAmB,EAAE,cAAsB;YAChD,IAAI,cAAsC,CAAA;YAC1C,IAA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CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAED;;;;;OAKG;IACH,gBAAgB;QACZ,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC/B,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC/C,IAAI,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YACtC,GAAG,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,WAAW,EAAE,CAAC;QACpE,CAAC;QACD,OAAO,GAAG,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;IACtC,CAAC;CACJ;AA5KD,0CA4KC"}
@@ -1,35 +1,26 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DetailedClassificationPerformance = void 0;
4
+ const ClassificationPerformance_1 = require("./ClassificationPerformance");
5
+ class DetailedClassificationPerformance extends ClassificationPerformance_1.ClassificationPerformance {
6
+ confusionMatrix;
7
+ /**
8
+ * A constructor that sets the accuracy and errorRate as 1 - accuracy via given {@link ConfusionMatrix} and also sets the confusionMatrix.
9
+ *
10
+ * @param confusionMatrix {@link ConfusionMatrix} input.
11
+ */
12
+ constructor(confusionMatrix) {
13
+ super(confusionMatrix.getAccuracy());
14
+ this.confusionMatrix = confusionMatrix;
5
15
  }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./ClassificationPerformance"], factory);
16
+ /**
17
+ * Accessor for the confusionMatrix.
18
+ *
19
+ * @return ConfusionMatrix.
20
+ */
21
+ getConfusionMatrix() {
22
+ return this.confusionMatrix;
8
23
  }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.DetailedClassificationPerformance = void 0;
13
- const ClassificationPerformance_1 = require("./ClassificationPerformance");
14
- class DetailedClassificationPerformance extends ClassificationPerformance_1.ClassificationPerformance {
15
- /**
16
- * A constructor that sets the accuracy and errorRate as 1 - accuracy via given {@link ConfusionMatrix} and also sets the confusionMatrix.
17
- *
18
- * @param confusionMatrix {@link ConfusionMatrix} input.
19
- */
20
- constructor(confusionMatrix) {
21
- super(confusionMatrix.getAccuracy());
22
- this.confusionMatrix = confusionMatrix;
23
- }
24
- /**
25
- * Accessor for the confusionMatrix.
26
- *
27
- * @return ConfusionMatrix.
28
- */
29
- getConfusionMatrix() {
30
- return this.confusionMatrix;
31
- }
32
- }
33
- exports.DetailedClassificationPerformance = DetailedClassificationPerformance;
34
- });
24
+ }
25
+ exports.DetailedClassificationPerformance = DetailedClassificationPerformance;
35
26
  //# sourceMappingURL=DetailedClassificationPerformance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DetailedClassificationPerformance.js","sourceRoot":"","sources":["../../source/Performance/DetailedClassificationPerformance.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,2EAAsE;IAGtE,MAAa,iCAAkC,SAAQ,qDAAyB;QAI5E;;;;WAIG;QACH,YAAY,eAAgC;YACxC,KAAK,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC,CAAC;YACrC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;QAC1C,CAAC;QAED;;;;WAIG;QACH,kBAAkB;YACd,OAAO,IAAI,CAAC,eAAe,CAAA;QAC/B,CAAC;KACJ;IAtBD,8EAsBC"}
1
+ {"version":3,"file":"DetailedClassificationPerformance.js","sourceRoot":"","sources":["../../source/Performance/DetailedClassificationPerformance.ts"],"names":[],"mappings":";;;AAAA,2EAAsE;AAGtE,MAAa,iCAAkC,SAAQ,qDAAyB;IAE3D,eAAe,CAAiB;IAEjD;;;;OAIG;IACH,YAAY,eAAgC;QACxC,KAAK,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC,CAAC;QACrC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;IAC1C,CAAC;IAED;;;;OAIG;IACH,kBAAkB;QACd,OAAO,IAAI,CAAC,eAAe,CAAA;IAC/B,CAAC;CACJ;AAtBD,8EAsBC"}