nlptoolkit-classification 1.0.7 → 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 (382) hide show
  1. package/README.md +1 -0
  2. package/dist/Attribute/Attribute.js +6 -16
  3. package/dist/Attribute/Attribute.js.map +1 -1
  4. package/dist/Attribute/AttributeType.js +22 -32
  5. package/dist/Attribute/AttributeType.js.map +1 -1
  6. package/dist/Attribute/BinaryAttribute.js +14 -24
  7. package/dist/Attribute/BinaryAttribute.js.map +1 -1
  8. package/dist/Attribute/ContinuousAttribute.js +46 -55
  9. package/dist/Attribute/ContinuousAttribute.js.map +1 -1
  10. package/dist/Attribute/DiscreteAttribute.d.ts +1 -1
  11. package/dist/Attribute/DiscreteAttribute.js +38 -48
  12. package/dist/Attribute/DiscreteAttribute.js.map +1 -1
  13. package/dist/Attribute/DiscreteIndexedAttribute.d.ts +2 -2
  14. package/dist/Attribute/DiscreteIndexedAttribute.js +47 -55
  15. package/dist/Attribute/DiscreteIndexedAttribute.js.map +1 -1
  16. package/dist/DataSet/DataDefinition.d.ts +11 -0
  17. package/dist/DataSet/DataDefinition.js +115 -112
  18. package/dist/DataSet/DataDefinition.js.map +1 -1
  19. package/dist/DataSet/DataSet.js +268 -245
  20. package/dist/DataSet/DataSet.js.map +1 -1
  21. package/dist/DistanceMetric/DistanceMetric.js +2 -12
  22. package/dist/DistanceMetric/EuclidianDistance.js +27 -37
  23. package/dist/DistanceMetric/EuclidianDistance.js.map +1 -1
  24. package/dist/DistanceMetric/MahalanobisDistance.js +27 -36
  25. package/dist/DistanceMetric/MahalanobisDistance.js.map +1 -1
  26. package/dist/Experiment/BootstrapRun.js +31 -40
  27. package/dist/Experiment/BootstrapRun.js.map +1 -1
  28. package/dist/Experiment/Experiment.d.ts +7 -7
  29. package/dist/Experiment/Experiment.js +46 -53
  30. package/dist/Experiment/Experiment.js.map +1 -1
  31. package/dist/Experiment/KFoldRun.d.ts +17 -2
  32. package/dist/Experiment/KFoldRun.js +45 -39
  33. package/dist/Experiment/KFoldRun.js.map +1 -1
  34. package/dist/Experiment/KFoldRunSeparateTest.d.ts +13 -2
  35. package/dist/Experiment/KFoldRunSeparateTest.js +48 -47
  36. package/dist/Experiment/KFoldRunSeparateTest.js.map +1 -1
  37. package/dist/Experiment/MultipleRun.js +2 -12
  38. package/dist/Experiment/MxKFoldRun.js +31 -40
  39. package/dist/Experiment/MxKFoldRun.js.map +1 -1
  40. package/dist/Experiment/MxKFoldRunSeparateTest.js +35 -44
  41. package/dist/Experiment/MxKFoldRunSeparateTest.js.map +1 -1
  42. package/dist/Experiment/SingleRun.js +2 -12
  43. package/dist/Experiment/SingleRunWithK.d.ts +18 -3
  44. package/dist/Experiment/SingleRunWithK.js +39 -33
  45. package/dist/Experiment/SingleRunWithK.js.map +1 -1
  46. package/dist/Experiment/StratifiedKFoldRun.js +26 -36
  47. package/dist/Experiment/StratifiedKFoldRun.js.map +1 -1
  48. package/dist/Experiment/StratifiedKFoldRunSeparateTest.js +30 -40
  49. package/dist/Experiment/StratifiedKFoldRunSeparateTest.js.map +1 -1
  50. package/dist/Experiment/StratifiedMxKFoldRun.js +29 -39
  51. package/dist/Experiment/StratifiedMxKFoldRun.js.map +1 -1
  52. package/dist/Experiment/StratifiedMxKFoldRunSeparateTest.js +34 -43
  53. package/dist/Experiment/StratifiedMxKFoldRunSeparateTest.js.map +1 -1
  54. package/dist/Experiment/StratifiedSingleRunWithK.js +27 -36
  55. package/dist/Experiment/StratifiedSingleRunWithK.js.map +1 -1
  56. package/dist/FeatureSelection/BackwardSelection.js +26 -36
  57. package/dist/FeatureSelection/BackwardSelection.js.map +1 -1
  58. package/dist/FeatureSelection/FeatureSubSet.js +72 -82
  59. package/dist/FeatureSelection/FeatureSubSet.js.map +1 -1
  60. package/dist/FeatureSelection/FloatingSelection.js +25 -35
  61. package/dist/FeatureSelection/FloatingSelection.js.map +1 -1
  62. package/dist/FeatureSelection/ForwardSelection.js +25 -35
  63. package/dist/FeatureSelection/ForwardSelection.js.map +1 -1
  64. package/dist/FeatureSelection/SubSetSelection.js +69 -78
  65. package/dist/FeatureSelection/SubSetSelection.js.map +1 -1
  66. package/dist/Filter/DiscreteToContinuous.js +50 -60
  67. package/dist/Filter/DiscreteToContinuous.js.map +1 -1
  68. package/dist/Filter/DiscreteToIndexed.js +40 -50
  69. package/dist/Filter/DiscreteToIndexed.js.map +1 -1
  70. package/dist/Filter/FeatureFilter.js +23 -32
  71. package/dist/Filter/FeatureFilter.js.map +1 -1
  72. package/dist/Filter/LaryFilter.d.ts +1 -1
  73. package/dist/Filter/LaryFilter.js +46 -55
  74. package/dist/Filter/LaryFilter.js.map +1 -1
  75. package/dist/Filter/LaryToBinary.js +48 -58
  76. package/dist/Filter/LaryToBinary.js.map +1 -1
  77. package/dist/Filter/Normalize.js +33 -41
  78. package/dist/Filter/Normalize.js.map +1 -1
  79. package/dist/Filter/Pca.js +86 -96
  80. package/dist/Filter/Pca.js.map +1 -1
  81. package/dist/Filter/TrainedFeatureFilter.d.ts +1 -1
  82. package/dist/Filter/TrainedFeatureFilter.js +14 -24
  83. package/dist/Filter/TrainedFeatureFilter.js.map +1 -1
  84. package/dist/Instance/CompositeInstance.js +46 -56
  85. package/dist/Instance/CompositeInstance.js.map +1 -1
  86. package/dist/Instance/Instance.js +145 -154
  87. package/dist/Instance/Instance.js.map +1 -1
  88. package/dist/InstanceList/InstanceList.js +466 -443
  89. package/dist/InstanceList/InstanceList.js.map +1 -1
  90. package/dist/InstanceList/InstanceListOfSameClass.js +23 -32
  91. package/dist/InstanceList/InstanceListOfSameClass.js.map +1 -1
  92. package/dist/InstanceList/Partition.d.ts +45 -0
  93. package/dist/InstanceList/Partition.js +176 -131
  94. package/dist/InstanceList/Partition.js.map +1 -1
  95. package/dist/Model/DecisionTree/DecisionCondition.d.ts +8 -0
  96. package/dist/Model/DecisionTree/DecisionCondition.js +71 -72
  97. package/dist/Model/DecisionTree/DecisionCondition.js.map +1 -1
  98. package/dist/Model/DecisionTree/DecisionNode.d.ts +38 -1
  99. package/dist/Model/DecisionTree/DecisionNode.js +302 -275
  100. package/dist/Model/DecisionTree/DecisionNode.js.map +1 -1
  101. package/dist/Model/DecisionTree/DecisionStump.d.ts +17 -0
  102. package/dist/Model/DecisionTree/DecisionStump.js +25 -0
  103. package/dist/Model/DecisionTree/DecisionStump.js.map +1 -0
  104. package/dist/Model/DecisionTree/DecisionTree.d.ts +24 -9
  105. package/dist/Model/DecisionTree/DecisionTree.js +90 -76
  106. package/dist/Model/DecisionTree/DecisionTree.js.map +1 -1
  107. package/dist/Model/DummyModel.d.ts +28 -3
  108. package/dist/Model/DummyModel.js +64 -50
  109. package/dist/Model/DummyModel.js.map +1 -1
  110. package/dist/{Classifier/Bagging.d.ts → Model/Ensemble/BaggingModel.d.ts} +8 -4
  111. package/dist/Model/Ensemble/BaggingModel.js +37 -0
  112. package/dist/Model/Ensemble/BaggingModel.js.map +1 -0
  113. package/dist/{Classifier/RandomForest.d.ts → Model/Ensemble/RandomForestModel.d.ts} +8 -4
  114. package/dist/Model/Ensemble/RandomForestModel.js +34 -0
  115. package/dist/Model/Ensemble/RandomForestModel.js.map +1 -0
  116. package/dist/Model/Ensemble/TreeEnsembleModel.d.ts +32 -0
  117. package/dist/Model/Ensemble/TreeEnsembleModel.js +61 -0
  118. package/dist/Model/Ensemble/TreeEnsembleModel.js.map +1 -0
  119. package/dist/Model/Model.d.ts +50 -0
  120. package/dist/Model/Model.js +131 -72
  121. package/dist/Model/Model.js.map +1 -1
  122. package/dist/Model/NeuralNetwork/DeepNetworkModel.d.ts +47 -0
  123. package/dist/Model/NeuralNetwork/DeepNetworkModel.js +180 -0
  124. package/dist/Model/NeuralNetwork/DeepNetworkModel.js.map +1 -0
  125. package/dist/Model/NeuralNetwork/LinearPerceptronModel.d.ts +31 -0
  126. package/dist/Model/NeuralNetwork/LinearPerceptronModel.js +75 -0
  127. package/dist/Model/NeuralNetwork/LinearPerceptronModel.js.map +1 -0
  128. package/dist/Model/NeuralNetwork/MultiLayerPerceptronModel.d.ts +39 -0
  129. package/dist/Model/NeuralNetwork/MultiLayerPerceptronModel.js +119 -0
  130. package/dist/Model/NeuralNetwork/MultiLayerPerceptronModel.js.map +1 -0
  131. package/dist/Model/{NeuralNetworkModel.d.ts → NeuralNetwork/NeuralNetworkModel.d.ts} +19 -5
  132. package/dist/Model/NeuralNetwork/NeuralNetworkModel.js +211 -0
  133. package/dist/Model/NeuralNetwork/NeuralNetworkModel.js.map +1 -0
  134. package/dist/Model/{KnnInstance.d.ts → NonParametric/KnnInstance.d.ts} +1 -1
  135. package/dist/Model/NonParametric/KnnInstance.js +25 -0
  136. package/dist/Model/NonParametric/KnnInstance.js.map +1 -0
  137. package/dist/Model/{KnnModel.d.ts → NonParametric/KnnModel.d.ts} +30 -6
  138. package/dist/Model/NonParametric/KnnModel.js +111 -0
  139. package/dist/Model/NonParametric/KnnModel.js.map +1 -0
  140. package/dist/Model/{GaussianModel.d.ts → Parametric/GaussianModel.d.ts} +20 -2
  141. package/dist/Model/Parametric/GaussianModel.js +95 -0
  142. package/dist/Model/Parametric/GaussianModel.js.map +1 -0
  143. package/dist/Model/Parametric/KMeansModel.d.ts +36 -0
  144. package/dist/Model/Parametric/KMeansModel.js +65 -0
  145. package/dist/Model/Parametric/KMeansModel.js.map +1 -0
  146. package/dist/Model/Parametric/LdaModel.d.ts +44 -0
  147. package/dist/Model/Parametric/LdaModel.js +90 -0
  148. package/dist/Model/Parametric/LdaModel.js.map +1 -0
  149. package/dist/Model/{NaiveBayesModel.d.ts → Parametric/NaiveBayesModel.d.ts} +30 -10
  150. package/dist/Model/Parametric/NaiveBayesModel.js +131 -0
  151. package/dist/Model/Parametric/NaiveBayesModel.js.map +1 -0
  152. package/dist/Model/Parametric/QdaModel.d.ts +30 -0
  153. package/dist/Model/Parametric/QdaModel.js +75 -0
  154. package/dist/Model/Parametric/QdaModel.js.map +1 -0
  155. package/dist/Model/RandomModel.d.ts +32 -2
  156. package/dist/Model/RandomModel.js +85 -60
  157. package/dist/Model/RandomModel.js.map +1 -1
  158. package/dist/Model/ValidatedModel.js +21 -31
  159. package/dist/Model/ValidatedModel.js.map +1 -1
  160. package/dist/Parameter/ActivationFunction.js +9 -19
  161. package/dist/Parameter/ActivationFunction.js.map +1 -1
  162. package/dist/Parameter/BaggingParameter.js +24 -33
  163. package/dist/Parameter/BaggingParameter.js.map +1 -1
  164. package/dist/Parameter/C45Parameter.d.ts +2 -2
  165. package/dist/Parameter/C45Parameter.js +34 -42
  166. package/dist/Parameter/C45Parameter.js.map +1 -1
  167. package/dist/Parameter/DeepNetworkParameter.d.ts +2 -2
  168. package/dist/Parameter/DeepNetworkParameter.js +48 -56
  169. package/dist/Parameter/DeepNetworkParameter.js.map +1 -1
  170. package/dist/Parameter/KMeansParameter.js +29 -38
  171. package/dist/Parameter/KMeansParameter.js.map +1 -1
  172. package/dist/Parameter/KnnParameter.d.ts +1 -1
  173. package/dist/Parameter/KnnParameter.js +25 -34
  174. package/dist/Parameter/KnnParameter.js.map +1 -1
  175. package/dist/Parameter/LinearPerceptronParameter.d.ts +4 -4
  176. package/dist/Parameter/LinearPerceptronParameter.js +56 -62
  177. package/dist/Parameter/LinearPerceptronParameter.js.map +1 -1
  178. package/dist/Parameter/MultiLayerPerceptronParameter.d.ts +2 -2
  179. package/dist/Parameter/MultiLayerPerceptronParameter.js +38 -46
  180. package/dist/Parameter/MultiLayerPerceptronParameter.js.map +1 -1
  181. package/dist/Parameter/Parameter.d.ts +1 -1
  182. package/dist/Parameter/Parameter.js +21 -30
  183. package/dist/Parameter/Parameter.js.map +1 -1
  184. package/dist/Parameter/RandomForestParameter.js +25 -34
  185. package/dist/Parameter/RandomForestParameter.js.map +1 -1
  186. package/dist/Performance/ClassificationPerformance.js +24 -33
  187. package/dist/Performance/ClassificationPerformance.js.map +1 -1
  188. package/dist/Performance/ConfusionMatrix.d.ts +1 -1
  189. package/dist/Performance/ConfusionMatrix.js +149 -158
  190. package/dist/Performance/ConfusionMatrix.js.map +1 -1
  191. package/dist/Performance/DetailedClassificationPerformance.js +23 -32
  192. package/dist/Performance/DetailedClassificationPerformance.js.map +1 -1
  193. package/dist/Performance/ExperimentPerformance.js +184 -161
  194. package/dist/Performance/ExperimentPerformance.js.map +1 -1
  195. package/dist/Performance/Performance.js +21 -30
  196. package/dist/Performance/Performance.js.map +1 -1
  197. package/dist/StatisticalTest/Combined5x2F.d.ts +12 -0
  198. package/dist/StatisticalTest/Combined5x2F.js +41 -39
  199. package/dist/StatisticalTest/Combined5x2F.js.map +1 -1
  200. package/dist/StatisticalTest/Combined5x2t.d.ts +13 -0
  201. package/dist/StatisticalTest/Combined5x2t.js +42 -39
  202. package/dist/StatisticalTest/Combined5x2t.js.map +1 -1
  203. package/dist/StatisticalTest/Paired5x2t.d.ts +12 -0
  204. package/dist/StatisticalTest/Paired5x2t.js +40 -38
  205. package/dist/StatisticalTest/Paired5x2t.js.map +1 -1
  206. package/dist/StatisticalTest/PairedTest.d.ts +12 -0
  207. package/dist/StatisticalTest/PairedTest.js +31 -29
  208. package/dist/StatisticalTest/PairedTest.js.map +1 -1
  209. package/dist/StatisticalTest/Pairedt.d.ts +12 -0
  210. package/dist/StatisticalTest/Pairedt.js +38 -36
  211. package/dist/StatisticalTest/Pairedt.js.map +1 -1
  212. package/dist/StatisticalTest/Sign.d.ts +17 -0
  213. package/dist/StatisticalTest/Sign.js +50 -43
  214. package/dist/StatisticalTest/Sign.js.map +1 -1
  215. package/dist/StatisticalTest/StatisticalTestResult.d.ts +30 -0
  216. package/dist/StatisticalTest/StatisticalTestResult.js +65 -43
  217. package/dist/StatisticalTest/StatisticalTestResult.js.map +1 -1
  218. package/dist/StatisticalTest/StatisticalTestResultType.js +11 -21
  219. package/dist/StatisticalTest/StatisticalTestResultType.js.map +1 -1
  220. package/dist/index.d.ts +88 -0
  221. package/dist/index.js +105 -0
  222. package/dist/index.js.map +1 -0
  223. package/package.json +9 -8
  224. package/source/Attribute/DiscreteAttribute.ts +1 -1
  225. package/source/Attribute/DiscreteIndexedAttribute.ts +2 -2
  226. package/source/DataSet/DataDefinition.ts +11 -0
  227. package/source/Experiment/BootstrapRun.ts +2 -2
  228. package/source/Experiment/Experiment.ts +10 -10
  229. package/source/Experiment/KFoldRun.ts +20 -5
  230. package/source/Experiment/KFoldRunSeparateTest.ts +16 -5
  231. package/source/Experiment/MxKFoldRun.ts +1 -1
  232. package/source/Experiment/MxKFoldRunSeparateTest.ts +1 -1
  233. package/source/Experiment/SingleRunWithK.ts +20 -5
  234. package/source/Experiment/StratifiedKFoldRun.ts +1 -1
  235. package/source/Experiment/StratifiedKFoldRunSeparateTest.ts +1 -1
  236. package/source/Experiment/StratifiedMxKFoldRun.ts +1 -1
  237. package/source/Experiment/StratifiedMxKFoldRunSeparateTest.ts +3 -3
  238. package/source/Experiment/StratifiedSingleRunWithK.ts +1 -1
  239. package/source/Filter/LaryFilter.ts +1 -1
  240. package/source/Filter/TrainedFeatureFilter.ts +1 -1
  241. package/source/InstanceList/Partition.ts +125 -65
  242. package/source/Model/DecisionTree/DecisionCondition.ts +8 -0
  243. package/source/Model/DecisionTree/DecisionNode.ts +56 -20
  244. package/source/Model/DecisionTree/DecisionStump.ts +26 -0
  245. package/source/Model/DecisionTree/DecisionTree.ts +44 -15
  246. package/source/Model/DummyModel.ts +40 -10
  247. package/source/{Classifier/Bagging.ts → Model/Ensemble/BaggingModel.ts} +15 -12
  248. package/source/{Classifier/RandomForest.ts → Model/Ensemble/RandomForestModel.ts} +14 -12
  249. package/source/Model/{TreeEnsembleModel.ts → Ensemble/TreeEnsembleModel.ts} +26 -18
  250. package/source/Model/Model.ts +77 -0
  251. package/source/Model/{DeepNetworkModel.ts → NeuralNetwork/DeepNetworkModel.ts} +59 -56
  252. package/source/Model/NeuralNetwork/LinearPerceptronModel.ts +81 -0
  253. package/source/Model/{MultiLayerPerceptronModel.ts → NeuralNetwork/MultiLayerPerceptronModel.ts} +46 -39
  254. package/source/Model/{NeuralNetworkModel.ts → NeuralNetwork/NeuralNetworkModel.ts} +20 -7
  255. package/source/Model/{KnnInstance.ts → NonParametric/KnnInstance.ts} +1 -1
  256. package/source/Model/{KnnModel.ts → NonParametric/KnnModel.ts} +48 -19
  257. package/source/Model/{GaussianModel.ts → Parametric/GaussianModel.ts} +21 -3
  258. package/source/Model/Parametric/KMeansModel.ts +72 -0
  259. package/source/Model/Parametric/LdaModel.ts +98 -0
  260. package/source/Model/{NaiveBayesModel.ts → Parametric/NaiveBayesModel.ts} +68 -25
  261. package/source/Model/Parametric/QdaModel.ts +83 -0
  262. package/source/Model/RandomModel.ts +54 -16
  263. package/source/Parameter/C45Parameter.ts +2 -2
  264. package/source/Parameter/DeepNetworkParameter.ts +2 -2
  265. package/source/Parameter/KnnParameter.ts +1 -1
  266. package/source/Parameter/LinearPerceptronParameter.ts +4 -4
  267. package/source/Parameter/MultiLayerPerceptronParameter.ts +2 -2
  268. package/source/Parameter/Parameter.ts +1 -1
  269. package/source/Performance/ConfusionMatrix.ts +1 -1
  270. package/source/StatisticalTest/Combined5x2F.ts +12 -0
  271. package/source/StatisticalTest/Combined5x2t.ts +13 -0
  272. package/source/StatisticalTest/Paired5x2t.ts +12 -0
  273. package/source/StatisticalTest/PairedTest.ts +12 -0
  274. package/source/StatisticalTest/Pairedt.ts +12 -0
  275. package/source/StatisticalTest/Sign.ts +17 -0
  276. package/source/StatisticalTest/StatisticalTestResult.ts +30 -0
  277. package/source/index.ts +88 -0
  278. package/tests/Classifier/C45Test.ts +2 -2
  279. package/tests/Classifier/DeepNetworkTest.ts +3 -5
  280. package/tests/Classifier/DummyTest.ts +2 -2
  281. package/tests/Classifier/KMeansTest.ts +2 -2
  282. package/tests/Classifier/KnnTest.ts +2 -2
  283. package/tests/Classifier/LdaTest.ts +2 -2
  284. package/tests/Classifier/LinearPerceptronTest.ts +2 -2
  285. package/tests/Classifier/MultiLayerPerceptronTest.ts +2 -3
  286. package/tests/Classifier/NaiveBayesTest.ts +2 -2
  287. package/tests/Classifier/QdaTest.ts +2 -2
  288. package/tests/Classifier/RandomForestTest.ts +2 -2
  289. package/tsconfig.json +4 -4
  290. package/dist/Classifier/Bagging.js +0 -45
  291. package/dist/Classifier/Bagging.js.map +0 -1
  292. package/dist/Classifier/C45.d.ts +0 -14
  293. package/dist/Classifier/C45.js +0 -43
  294. package/dist/Classifier/C45.js.map +0 -1
  295. package/dist/Classifier/C45Stump.d.ts +0 -13
  296. package/dist/Classifier/C45Stump.js +0 -32
  297. package/dist/Classifier/C45Stump.js.map +0 -1
  298. package/dist/Classifier/Classifier.d.ts +0 -40
  299. package/dist/Classifier/Classifier.js +0 -72
  300. package/dist/Classifier/Classifier.js.map +0 -1
  301. package/dist/Classifier/DeepNetwork.d.ts +0 -14
  302. package/dist/Classifier/DeepNetwork.js +0 -34
  303. package/dist/Classifier/DeepNetwork.js.map +0 -1
  304. package/dist/Classifier/Dummy.d.ts +0 -14
  305. package/dist/Classifier/Dummy.js +0 -32
  306. package/dist/Classifier/Dummy.js.map +0 -1
  307. package/dist/Classifier/KMeans.d.ts +0 -13
  308. package/dist/Classifier/KMeans.js +0 -39
  309. package/dist/Classifier/KMeans.js.map +0 -1
  310. package/dist/Classifier/Knn.d.ts +0 -14
  311. package/dist/Classifier/Knn.js +0 -32
  312. package/dist/Classifier/Knn.js.map +0 -1
  313. package/dist/Classifier/Lda.d.ts +0 -13
  314. package/dist/Classifier/Lda.js +0 -55
  315. package/dist/Classifier/Lda.js.map +0 -1
  316. package/dist/Classifier/LinearPerceptron.d.ts +0 -15
  317. package/dist/Classifier/LinearPerceptron.js +0 -35
  318. package/dist/Classifier/LinearPerceptron.js.map +0 -1
  319. package/dist/Classifier/MultiLayerPerceptron.d.ts +0 -15
  320. package/dist/Classifier/MultiLayerPerceptron.js +0 -35
  321. package/dist/Classifier/MultiLayerPerceptron.js.map +0 -1
  322. package/dist/Classifier/NaiveBayes.d.ts +0 -26
  323. package/dist/Classifier/NaiveBayes.js +0 -70
  324. package/dist/Classifier/NaiveBayes.js.map +0 -1
  325. package/dist/Classifier/Qda.d.ts +0 -13
  326. package/dist/Classifier/Qda.js +0 -53
  327. package/dist/Classifier/Qda.js.map +0 -1
  328. package/dist/Classifier/RandomClassifier.d.ts +0 -13
  329. package/dist/Classifier/RandomClassifier.js +0 -35
  330. package/dist/Classifier/RandomClassifier.js.map +0 -1
  331. package/dist/Classifier/RandomForest.js +0 -42
  332. package/dist/Classifier/RandomForest.js.map +0 -1
  333. package/dist/Model/DeepNetworkModel.d.ts +0 -45
  334. package/dist/Model/DeepNetworkModel.js +0 -187
  335. package/dist/Model/DeepNetworkModel.js.map +0 -1
  336. package/dist/Model/GaussianModel.js +0 -86
  337. package/dist/Model/GaussianModel.js.map +0 -1
  338. package/dist/Model/KMeansModel.d.ts +0 -28
  339. package/dist/Model/KMeansModel.js +0 -61
  340. package/dist/Model/KMeansModel.js.map +0 -1
  341. package/dist/Model/KnnInstance.js +0 -33
  342. package/dist/Model/KnnInstance.js.map +0 -1
  343. package/dist/Model/KnnModel.js +0 -95
  344. package/dist/Model/KnnModel.js.map +0 -1
  345. package/dist/Model/LdaModel.d.ts +0 -28
  346. package/dist/Model/LdaModel.js +0 -67
  347. package/dist/Model/LdaModel.js.map +0 -1
  348. package/dist/Model/LinearPerceptronModel.d.ts +0 -24
  349. package/dist/Model/LinearPerceptronModel.js +0 -91
  350. package/dist/Model/LinearPerceptronModel.js.map +0 -1
  351. package/dist/Model/MultiLayerPerceptronModel.d.ts +0 -33
  352. package/dist/Model/MultiLayerPerceptronModel.js +0 -123
  353. package/dist/Model/MultiLayerPerceptronModel.js.map +0 -1
  354. package/dist/Model/NaiveBayesModel.js +0 -107
  355. package/dist/Model/NaiveBayesModel.js.map +0 -1
  356. package/dist/Model/NeuralNetworkModel.js +0 -202
  357. package/dist/Model/NeuralNetworkModel.js.map +0 -1
  358. package/dist/Model/QdaModel.d.ts +0 -27
  359. package/dist/Model/QdaModel.js +0 -63
  360. package/dist/Model/QdaModel.js.map +0 -1
  361. package/dist/Model/TreeEnsembleModel.d.ts +0 -22
  362. package/dist/Model/TreeEnsembleModel.js +0 -64
  363. package/dist/Model/TreeEnsembleModel.js.map +0 -1
  364. package/index.js +0 -100
  365. package/source/Classifier/C45.ts +0 -34
  366. package/source/Classifier/C45Stump.ts +0 -23
  367. package/source/Classifier/Classifier.ts +0 -72
  368. package/source/Classifier/DeepNetwork.ts +0 -26
  369. package/source/Classifier/Dummy.ts +0 -23
  370. package/source/Classifier/KMeans.ts +0 -30
  371. package/source/Classifier/Knn.ts +0 -25
  372. package/source/Classifier/Lda.ts +0 -47
  373. package/source/Classifier/LinearPerceptron.ts +0 -27
  374. package/source/Classifier/MultiLayerPerceptron.ts +0 -27
  375. package/source/Classifier/NaiveBayes.ts +0 -66
  376. package/source/Classifier/Qda.ts +0 -46
  377. package/source/Classifier/RandomClassifier.ts +0 -26
  378. package/source/Model/KMeansModel.ts +0 -56
  379. package/source/Model/LdaModel.ts +0 -62
  380. package/source/Model/LinearPerceptronModel.ts +0 -83
  381. package/source/Model/QdaModel.ts +0 -57
  382. package/source/tsconfig.json +0 -13
@@ -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,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,EAAC;gBAC7B,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;aAChD;iBAAM;gBACH,cAAc,GAAG,IAAI,+BAAc,EAAU,CAAA;aAChD;YACD,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;YAClC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,cAAc,CAAC,CAAA;QAChD,CAAC;QAED;;;;;WAKG;QACH,kBAAkB,CAAC,eAAgC;YAC/C,KAAK,IAAI,WAAW,IAAI,eAAe,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE;gBACnD,IAAI,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;gBAC3D,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;oBAC9B,IAAI,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,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) {
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"}