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,67 +1,57 @@
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", "./LaryFilter", "../Attribute/BinaryAttribute", "../Attribute/AttributeType"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.LaryToBinary = void 0;
13
- const LaryFilter_1 = require("./LaryFilter");
14
- const BinaryAttribute_1 = require("../Attribute/BinaryAttribute");
15
- const AttributeType_1 = require("../Attribute/AttributeType");
16
- class LaryToBinary extends LaryFilter_1.LaryFilter {
17
- /**
18
- * Converts the data definition with L-ary discrete attributes, to data definition with binary discrete attributes.
19
- */
20
- convertDataDefinition() {
21
- let dataDefinition = this.dataSet.getDataDefinition();
22
- let size = dataDefinition.attributeCount();
23
- for (let i = 0; i < size; i++) {
24
- if (this.attributeDistributions[i].size > 0) {
25
- for (let j = 0; j < this.attributeDistributions[i].size; j++) {
26
- dataDefinition.addAttribute(AttributeType_1.AttributeType.BINARY);
27
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LaryToBinary = void 0;
4
+ const LaryFilter_1 = require("./LaryFilter");
5
+ const BinaryAttribute_1 = require("../Attribute/BinaryAttribute");
6
+ const AttributeType_1 = require("../Attribute/AttributeType");
7
+ class LaryToBinary extends LaryFilter_1.LaryFilter {
8
+ /**
9
+ * Converts the data definition with L-ary discrete attributes, to data definition with binary discrete attributes.
10
+ */
11
+ convertDataDefinition() {
12
+ let dataDefinition = this.dataSet.getDataDefinition();
13
+ let size = dataDefinition.attributeCount();
14
+ for (let i = 0; i < size; i++) {
15
+ if (this.attributeDistributions[i].size > 0) {
16
+ for (let j = 0; j < this.attributeDistributions[i].size; j++) {
17
+ dataDefinition.addAttribute(AttributeType_1.AttributeType.BINARY);
28
18
  }
29
19
  }
30
- this.removeDiscreteAttributesFromDataDefinition(size);
31
20
  }
32
- /**
33
- * Converts discrete attributes of a single instance to binary discrete version using 1-of-L encoding. For example, if
34
- * an attribute has values red, green, blue; this attribute will be converted to 3 binary attributes where
35
- * red will have the value true false false, green will have the value false true false, and blue will have the value false false true.
36
- *
37
- * @param instance The instance to be converted.
38
- */
39
- convertInstance(instance) {
40
- let size = instance.attributeSize();
41
- for (let i = 0; i < size; i++) {
42
- if (this.attributeDistributions[i].size > 0) {
43
- let index = this.attributeDistributions[i].getIndex(instance.getAttribute(i).toString());
44
- for (let j = 0; j < this.attributeDistributions[i].size; j++) {
45
- if (j != index) {
46
- instance.addAttribute(new BinaryAttribute_1.BinaryAttribute(false));
47
- }
48
- else {
49
- instance.addAttribute(new BinaryAttribute_1.BinaryAttribute(true));
50
- }
21
+ this.removeDiscreteAttributesFromDataDefinition(size);
22
+ }
23
+ /**
24
+ * Converts discrete attributes of a single instance to binary discrete version using 1-of-L encoding. For example, if
25
+ * an attribute has values red, green, blue; this attribute will be converted to 3 binary attributes where
26
+ * red will have the value true false false, green will have the value false true false, and blue will have the value false false true.
27
+ *
28
+ * @param instance The instance to be converted.
29
+ */
30
+ convertInstance(instance) {
31
+ let size = instance.attributeSize();
32
+ for (let i = 0; i < size; i++) {
33
+ if (this.attributeDistributions[i].size > 0) {
34
+ let index = this.attributeDistributions[i].getIndex(instance.getAttribute(i).toString());
35
+ for (let j = 0; j < this.attributeDistributions[i].size; j++) {
36
+ if (j != index) {
37
+ instance.addAttribute(new BinaryAttribute_1.BinaryAttribute(false));
38
+ }
39
+ else {
40
+ instance.addAttribute(new BinaryAttribute_1.BinaryAttribute(true));
51
41
  }
52
42
  }
53
43
  }
54
- this.removeDiscreteAttributesFromInstance(instance, size);
55
- }
56
- /**
57
- * Constructor for L-ary discrete to binary discrete filter.
58
- *
59
- * @param dataSet The instances whose L-ary discrete attributes will be converted to binary discrete attributes.
60
- */
61
- constructor(dataSet) {
62
- super(dataSet);
63
44
  }
45
+ this.removeDiscreteAttributesFromInstance(instance, size);
46
+ }
47
+ /**
48
+ * Constructor for L-ary discrete to binary discrete filter.
49
+ *
50
+ * @param dataSet The instances whose L-ary discrete attributes will be converted to binary discrete attributes.
51
+ */
52
+ constructor(dataSet) {
53
+ super(dataSet);
64
54
  }
65
- exports.LaryToBinary = LaryToBinary;
66
- });
55
+ }
56
+ exports.LaryToBinary = LaryToBinary;
67
57
  //# sourceMappingURL=LaryToBinary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LaryToBinary.js","sourceRoot":"","sources":["../../source/Filter/LaryToBinary.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6CAAwC;IAGxC,kEAA6D;IAC7D,8DAAyD;IAEzD,MAAa,YAAa,SAAQ,uBAAU;QAExC;;WAEG;QACH,qBAAqB;YACjB,IAAI,cAAc,GAAG,IAAI,CAAC,OAAO,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C5B,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;gBAC1C,IAAI,KAAK,GAAG,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;gBACzF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC3D,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;wBACb,QAAQ,CAAC,YAAY,CAAC,IAAI,iCAAe,CAAC,KAAK,CAAC,CAAC,CAAC;oBACtD,CAAC;yBAAM,CAAC;wBACJ,QAAQ,CAAC,YAAY,CAAC,IAAI,iCAAe,CAAC,IAAI,CAAC,CAAC,CAAC;oBACrD,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC;QACD,IAAI,CAAC,oCAAoC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACH,YAAY,OAAgB;QACxB,KAAK,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;CACJ;AAlDD,oCAkDC"}
@@ -1,47 +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.Normalize = void 0;
4
+ const FeatureFilter_1 = require("./FeatureFilter");
5
+ const ContinuousAttribute_1 = require("../Attribute/ContinuousAttribute");
6
+ class Normalize extends FeatureFilter_1.FeatureFilter {
7
+ averageInstance;
8
+ standardDeviationInstance;
9
+ /**
10
+ * Constructor for normalize feature filter. It calculates and stores the mean (m) and standard deviation (s) of
11
+ * the sample.
12
+ *
13
+ * @param dataSet Instances whose continuous attribute values will be normalized.
14
+ */
15
+ constructor(dataSet) {
16
+ super(dataSet);
17
+ this.averageInstance = dataSet.getInstanceList().average();
18
+ this.standardDeviationInstance = dataSet.getInstanceList().standardDeviation();
5
19
  }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./FeatureFilter", "../Attribute/ContinuousAttribute"], factory);
20
+ convertDataDefinition() {
8
21
  }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Normalize = void 0;
13
- const FeatureFilter_1 = require("./FeatureFilter");
14
- const ContinuousAttribute_1 = require("../Attribute/ContinuousAttribute");
15
- class Normalize extends FeatureFilter_1.FeatureFilter {
16
- /**
17
- * Constructor for normalize feature filter. It calculates and stores the mean (m) and standard deviation (s) of
18
- * the sample.
19
- *
20
- * @param dataSet Instances whose continuous attribute values will be normalized.
21
- */
22
- constructor(dataSet) {
23
- super(dataSet);
24
- this.averageInstance = dataSet.getInstanceList().average();
25
- this.standardDeviationInstance = dataSet.getInstanceList().standardDeviation();
26
- }
27
- convertDataDefinition() {
28
- }
29
- /**
30
- * Normalizes the continuous attributes of a single instance. For all i, new x_i = (x_i - m_i) / s_i.
31
- *
32
- * @param instance Instance whose attributes will be normalized.
33
- */
34
- convertInstance(instance) {
35
- for (let i = 0; i < instance.attributeSize(); i++) {
36
- if (instance.getAttribute(i) instanceof ContinuousAttribute_1.ContinuousAttribute) {
37
- let xi = instance.getAttribute(i);
38
- let mi = this.averageInstance.getAttribute(i);
39
- let si = this.standardDeviationInstance.getAttribute(i);
40
- xi.setValue((xi.getValue() - mi.getValue()) / si.getValue());
41
- }
22
+ /**
23
+ * Normalizes the continuous attributes of a single instance. For all i, new x_i = (x_i - m_i) / s_i.
24
+ *
25
+ * @param instance Instance whose attributes will be normalized.
26
+ */
27
+ convertInstance(instance) {
28
+ for (let i = 0; i < instance.attributeSize(); i++) {
29
+ if (instance.getAttribute(i) instanceof ContinuousAttribute_1.ContinuousAttribute) {
30
+ let xi = instance.getAttribute(i);
31
+ let mi = this.averageInstance.getAttribute(i);
32
+ let si = this.standardDeviationInstance.getAttribute(i);
33
+ xi.setValue((xi.getValue() - mi.getValue()) / si.getValue());
42
34
  }
43
35
  }
44
36
  }
45
- exports.Normalize = Normalize;
46
- });
37
+ }
38
+ exports.Normalize = Normalize;
47
39
  //# sourceMappingURL=Normalize.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Normalize.js","sourceRoot":"","sources":["../../source/Filter/Normalize.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,mDAA8C;IAG9C,0EAAqE;IAErE,MAAa,SAAU,SAAQ,6BAAa;QAKxC;;;;;WAKG;QACH,YAAY,OAAgB;YACxB,KAAK,CAAC,OAAO,CAAC,CAAC;YACf,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE,CAAC;YAC3D,IAAI,CAAC,yBAAyB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,iBAAiB,EAAE,CAAC;QACnF,CAAC;QAED,qBAAqB;QACrB,CAAC;QAED;;;;WAIG;QACH,eAAe,CAAC,QAAkB;YAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,aAAa,EAAE,EAAE,CAAC,EAAE,EAAE;gBAC/C,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,yCAAmB,EAAE;oBACzD,IAAI,EAAE,GAAyB,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;oBACxD,IAAI,EAAE,GAAyB,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;oBACpE,IAAI,EAAE,GAAyB,IAAI,CAAC,yBAAyB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;oBAC9E,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,C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(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", "./TrainedFeatureFilter", "nlptoolkit-math/dist/Vector", "../Attribute/ContinuousAttribute", "../Attribute/AttributeType"], factory);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Pca = void 0;
4
+ const TrainedFeatureFilter_1 = require("./TrainedFeatureFilter");
5
+ const Vector_1 = require("nlptoolkit-math/dist/Vector");
6
+ const ContinuousAttribute_1 = require("../Attribute/ContinuousAttribute");
7
+ const AttributeType_1 = require("../Attribute/AttributeType");
8
+ class Pca extends TrainedFeatureFilter_1.TrainedFeatureFilter {
9
+ covarianceExplained = 0.99;
10
+ eigenvectors = new Array();
11
+ numberOfDimensions = -1;
12
+ /**
13
+ * The convertDataDefinition method gets the data definitions of the dataSet and removes all the attributes. Then adds
14
+ * new attributes as CONTINUOUS.
15
+ */
16
+ convertDataDefinition() {
17
+ let dataDefinition = this.dataSet.getDataDefinition();
18
+ dataDefinition.removeAllAttributes();
19
+ for (let i = 0; i < this.eigenvectors.length; i++) {
20
+ dataDefinition.addAttribute(AttributeType_1.AttributeType.CONTINUOUS);
21
+ }
8
22
  }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Pca = void 0;
13
- const TrainedFeatureFilter_1 = require("./TrainedFeatureFilter");
14
- const Vector_1 = require("nlptoolkit-math/dist/Vector");
15
- const ContinuousAttribute_1 = require("../Attribute/ContinuousAttribute");
16
- const AttributeType_1 = require("../Attribute/AttributeType");
17
- class Pca extends TrainedFeatureFilter_1.TrainedFeatureFilter {
18
- /**
19
- * Constructor that sets the dataSet and dimension. Then calls train method.
20
- *
21
- * @param dataSet DataSet that will be used.
22
- * @param numberOfDimensionsOrCovarianceExplained Dimension number.
23
- */
24
- constructor(dataSet, numberOfDimensionsOrCovarianceExplained) {
25
- super(dataSet);
26
- this.covarianceExplained = 0.99;
27
- this.eigenvectors = new Array();
28
- this.numberOfDimensions = -1;
29
- if (numberOfDimensionsOrCovarianceExplained != undefined) {
30
- if (Number.isInteger(numberOfDimensionsOrCovarianceExplained)) {
31
- this.numberOfDimensions = numberOfDimensionsOrCovarianceExplained;
32
- }
33
- else {
34
- this.covarianceExplained = numberOfDimensionsOrCovarianceExplained;
35
- }
36
- }
37
- this.train();
23
+ /**
24
+ * The convertInstance method takes an {@link Instance} as an input and creates a {@link Vector} attributes from continuousAttributes.
25
+ * After removing all attributes of given instance, it then adds new {@link ContinuousAttribute} by using the dot
26
+ * product of attribute Vector and the eigenvectors.
27
+ *
28
+ * @param instance Instance that will be converted to {@link ContinuousAttribute} by using eigenvectors.
29
+ */
30
+ convertInstance(instance) {
31
+ let attributes = new Vector_1.Vector(instance.continuousAttributes());
32
+ instance.removeAllAttributes();
33
+ for (let eigenvector of this.eigenvectors) {
34
+ instance.addAttribute(new ContinuousAttribute_1.ContinuousAttribute(attributes.dotProduct(eigenvector)));
38
35
  }
39
- /**
40
- * The convertDataDefinition method gets the data definitions of the dataSet and removes all the attributes. Then adds
41
- * new attributes as CONTINUOUS.
42
- */
43
- convertDataDefinition() {
44
- let dataDefinition = this.dataSet.getDataDefinition();
45
- dataDefinition.removeAllAttributes();
46
- for (let i = 0; i < this.eigenvectors.length; i++) {
47
- dataDefinition.addAttribute(AttributeType_1.AttributeType.CONTINUOUS);
48
- }
36
+ }
37
+ /**
38
+ * The train method creates an averageVector from continuousAttributeAverage and a covariance {@link Matrix} from that averageVector.
39
+ * Then finds the eigenvectors of that covariance matrix and removes its unnecessary eigenvectors.
40
+ */
41
+ train() {
42
+ let averageVector = new Vector_1.Vector(this.dataSet.getInstanceList().continuousAttributeAverage());
43
+ let covariance = this.dataSet.getInstanceList().covariance(averageVector);
44
+ this.eigenvectors = covariance.characteristics();
45
+ if (this.numberOfDimensions != -1) {
46
+ this.removeAllEigenvectorsExceptTheMostImportantK();
49
47
  }
50
- /**
51
- * The convertInstance method takes an {@link Instance} as an input and creates a {@link Vector} attributes from continuousAttributes.
52
- * After removing all attributes of given instance, it then adds new {@link ContinuousAttribute} by using the dot
53
- * product of attribute Vector and the eigenvectors.
54
- *
55
- * @param instance Instance that will be converted to {@link ContinuousAttribute} by using eigenvectors.
56
- */
57
- convertInstance(instance) {
58
- let attributes = new Vector_1.Vector(instance.continuousAttributes());
59
- instance.removeAllAttributes();
60
- for (let eigenvector of this.eigenvectors) {
61
- instance.addAttribute(new ContinuousAttribute_1.ContinuousAttribute(attributes.dotProduct(eigenvector)));
62
- }
48
+ else {
49
+ this.removeUnnecessaryEigenvectors();
63
50
  }
64
- /**
65
- * The train method creates an averageVector from continuousAttributeAverage and a covariance {@link Matrix} from that averageVector.
66
- * Then finds the eigenvectors of that covariance matrix and removes its unnecessary eigenvectors.
67
- */
68
- train() {
69
- let averageVector = new Vector_1.Vector(this.dataSet.getInstanceList().continuousAttributeAverage());
70
- let covariance = this.dataSet.getInstanceList().covariance(averageVector);
71
- this.eigenvectors = covariance.characteristics();
72
- if (this.numberOfDimensions != -1) {
73
- this.removeAllEigenvectorsExceptTheMostImportantK();
51
+ }
52
+ /**
53
+ * Constructor that sets the dataSet and dimension. Then calls train method.
54
+ *
55
+ * @param dataSet DataSet that will be used.
56
+ * @param numberOfDimensionsOrCovarianceExplained Dimension number.
57
+ */
58
+ constructor(dataSet, numberOfDimensionsOrCovarianceExplained) {
59
+ super(dataSet);
60
+ if (numberOfDimensionsOrCovarianceExplained != undefined) {
61
+ if (Number.isInteger(numberOfDimensionsOrCovarianceExplained)) {
62
+ this.numberOfDimensions = numberOfDimensionsOrCovarianceExplained;
74
63
  }
75
64
  else {
76
- this.removeUnnecessaryEigenvectors();
65
+ this.covarianceExplained = numberOfDimensionsOrCovarianceExplained;
77
66
  }
78
67
  }
79
- /**
80
- * The removeUnnecessaryEigenvectors methods takes an ArrayList of Eigenvectors. It first calculates the summation
81
- * of eigenValues. Then it finds the eigenvectors which have lesser summation than covarianceExplained and removes these
82
- * eigenvectors.
83
- */
84
- removeUnnecessaryEigenvectors() {
85
- let sum = 0.0, currentSum = 0.0;
86
- for (let eigenvector of this.eigenvectors) {
87
- sum += eigenvector.getEigenValue();
68
+ this.train();
69
+ }
70
+ /**
71
+ * The removeUnnecessaryEigenvectors methods takes an ArrayList of Eigenvectors. It first calculates the summation
72
+ * of eigenValues. Then it finds the eigenvectors which have lesser summation than covarianceExplained and removes these
73
+ * eigenvectors.
74
+ */
75
+ removeUnnecessaryEigenvectors() {
76
+ let sum = 0.0, currentSum = 0.0;
77
+ for (let eigenvector of this.eigenvectors) {
78
+ sum += eigenvector.getEigenValue();
79
+ }
80
+ for (let i = 0; i < this.eigenvectors.length; i++) {
81
+ if (currentSum / sum < this.covarianceExplained) {
82
+ currentSum += this.eigenvectors[i].getEigenValue();
88
83
  }
89
- for (let i = 0; i < this.eigenvectors.length; i++) {
90
- if (currentSum / sum < this.covarianceExplained) {
91
- currentSum += this.eigenvectors[i].getEigenValue();
92
- }
93
- else {
94
- this.eigenvectors.splice(i, 1);
95
- i--;
96
- }
84
+ else {
85
+ this.eigenvectors.splice(i, 1);
86
+ i--;
97
87
  }
98
88
  }
99
- /**
100
- * The removeAllEigenvectorsExceptTheMostImportantK method takes an {@link Array} of {@link Eigenvector}s and removes the
101
- * surplus eigenvectors when the number of eigenvectors is greater than the dimension.
102
- */
103
- removeAllEigenvectorsExceptTheMostImportantK() {
104
- this.eigenvectors.splice(this.numberOfDimensions, this.eigenvectors.length - this.numberOfDimensions);
105
- }
106
89
  }
107
- exports.Pca = Pca;
108
- });
90
+ /**
91
+ * The removeAllEigenvectorsExceptTheMostImportantK method takes an {@link Array} of {@link Eigenvector}s and removes the
92
+ * surplus eigenvectors when the number of eigenvectors is greater than the dimension.
93
+ */
94
+ removeAllEigenvectorsExceptTheMostImportantK() {
95
+ this.eigenvectors.splice(this.numberOfDimensions, this.eigenvectors.length - this.numberOfDimensions);
96
+ }
97
+ }
98
+ exports.Pca = Pca;
109
99
  //# sourceMappingURL=Pca.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pca.js","sourceRoot":"","sources":["../../source/Filter/Pca.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,iEAA4D;IAI5D,wDAAmD;IACnD,0EAAqE;IAErE,8DAAyD;IAEzD,MAAa,GAAI,SAAQ,2CAAoB;QAgDzC;;;;;WAKG;QACH,YAAY,OAAgB,EAAE,uCAAgD;YAC1E,KAAK,CAAC,OAAO,CAAC,CAAC;YArDF,wBAAmB,GAAW,IAAI,CAAA;YAC3C,iBAAY,GAAuB,IAAI,KAAK,EAAe,CAAA;YAClD,uBAAkB,GAAY,CAAC,CAAC,CAAA;YAoD7C,IAAI,uCAAuC,IAAI,SAAS,EAAC;gBACrD,IAAI,MAAM,CAAC,SAAS,CAAC,uCAAuC,CAAC,EAAC;oBAC1D,IAAI,CAAC,kBAAkB,GAAG,uCAAuC,CAAA;iBACpE;qBAAM;oBACH,IAAI,CAAC,mBAAmB,GAAG,uCAAuC,CAAA;iBACrE;aACJ;YACD,IAAI,CAAC,KAAK,EAAE,CAAA;QAChB,CAAC;QA1DD;;;WAGG;QACH,qBAAqB;YACjB,IAAI,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;YACtD,cAAc,CAAC,mBAAmB,EAAE,CAAC;YACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC/C,cAAc,CAAC,YAAY,CAAC,6BAAa,CAAC,UAAU,CAAC,CAAC;aACzD;QACL,CAAC;QAED;;;;;;WAMG;QACH,eAAe,CAAC,QAAkB;YAC9B,IAAI,UAAU,GAAY,IAAI,eAAM,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC,CAAC;YACtE,QAAQ,CAAC,mBAAmB,EAAE,CAAC;YA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CAAC,CAAC,aAAa,EAAE,CAAC;YACvD,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC/B,CAAC,EAAE,CAAC;YACR,CAAC;QACL,CAAC;IACL,CAAC;IAED;;;OAGG;IACK,4CAA4C;QAChD,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAA;IACzG,CAAC;CAEJ;AA9FD,kBA8FC"}
@@ -5,7 +5,7 @@ export declare abstract class TrainedFeatureFilter extends FeatureFilter {
5
5
  /**
6
6
  * Constructor that sets the dataSet.
7
7
  *
8
- * @param dataSet DataSet that will bu used.
8
+ * @param dataSet DataSet that will be used.
9
9
  */
10
10
  constructor(dataSet: DataSet);
11
11
  }
@@ -1,26 +1,16 @@
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.TrainedFeatureFilter = void 0;
4
+ const FeatureFilter_1 = require("./FeatureFilter");
5
+ class TrainedFeatureFilter extends FeatureFilter_1.FeatureFilter {
6
+ /**
7
+ * Constructor that sets the dataSet.
8
+ *
9
+ * @param dataSet DataSet that will be used.
10
+ */
11
+ constructor(dataSet) {
12
+ super(dataSet);
5
13
  }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./FeatureFilter"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.TrainedFeatureFilter = void 0;
13
- const FeatureFilter_1 = require("./FeatureFilter");
14
- class TrainedFeatureFilter extends FeatureFilter_1.FeatureFilter {
15
- /**
16
- * Constructor that sets the dataSet.
17
- *
18
- * @param dataSet DataSet that will bu used.
19
- */
20
- constructor(dataSet) {
21
- super(dataSet);
22
- }
23
- }
24
- exports.TrainedFeatureFilter = TrainedFeatureFilter;
25
- });
14
+ }
15
+ exports.TrainedFeatureFilter = TrainedFeatureFilter;
26
16
  //# sourceMappingURL=TrainedFeatureFilter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TrainedFeatureFilter.js","sourceRoot":"","sources":["../../source/Filter/TrainedFeatureFilter.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,mDAA8C;IAG9C,MAAsB,oBAAqB,SAAQ,6BAAa;QAI5D;;;;WAIG;QACH,YAAY,OAAgB;YACxB,KAAK,CAAC,OAAO,CAAC,CAAC;QACnB,CAAC;KAEJ;IAbD,oDAaC"}
1
+ {"version":3,"file":"TrainedFeatureFilter.js","sourceRoot":"","sources":["../../source/Filter/TrainedFeatureFilter.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAG9C,MAAsB,oBAAqB,SAAQ,6BAAa;IAI5D;;;;OAIG;IACH,YAAY,OAAgB;QACxB,KAAK,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;CAEJ;AAbD,oDAaC"}
@@ -1,61 +1,51 @@
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", "./Instance"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CompositeInstance = void 0;
13
- const Instance_1 = require("./Instance");
14
- class CompositeInstance extends Instance_1.Instance {
15
- /**
16
- * Constructor of {@link CompositeInstance} class which takes a class label, attributes and an {@link ArrayList} of
17
- * possible labels as inputs. It generates a new composite instance with given labels, attributes and possible labels.
18
- *
19
- * @param classLabel Class label of the composite instance.
20
- * @param attributes Attributes of the composite instance.
21
- * @param possibleClassLabels Possible labels of the composite instance.
22
- */
23
- constructor(classLabel, attributes, possibleClassLabels) {
24
- super(classLabel, attributes);
25
- this.possibleClassLabels = new Array();
26
- if (possibleClassLabels != undefined) {
27
- this.possibleClassLabels = possibleClassLabels;
28
- }
29
- }
30
- /**
31
- * Accessor for the possible class labels.
32
- *
33
- * @return Possible class labels of the composite instance.
34
- */
35
- getPossibleClassLabels() {
36
- return this.possibleClassLabels;
37
- }
38
- /**
39
- * Mutator method for possible class labels.
40
- *
41
- * @param possibleClassLabels Ner value of possible class labels.
42
- */
43
- setPossibleClassLabels(possibleClassLabels) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CompositeInstance = void 0;
4
+ const Instance_1 = require("./Instance");
5
+ class CompositeInstance extends Instance_1.Instance {
6
+ possibleClassLabels = new Array();
7
+ /**
8
+ * Constructor of {@link CompositeInstance} class which takes a class label, attributes and an {@link ArrayList} of
9
+ * possible labels as inputs. It generates a new composite instance with given labels, attributes and possible labels.
10
+ *
11
+ * @param classLabel Class label of the composite instance.
12
+ * @param attributes Attributes of the composite instance.
13
+ * @param possibleClassLabels Possible labels of the composite instance.
14
+ */
15
+ constructor(classLabel, attributes, possibleClassLabels) {
16
+ super(classLabel, attributes);
17
+ if (possibleClassLabels != undefined) {
44
18
  this.possibleClassLabels = possibleClassLabels;
45
19
  }
46
- /**
47
- * Converts composite instance to {@link String}.
48
- *
49
- * @return String representation of composite instance.
50
- */
51
- toString() {
52
- let result = super.toString();
53
- for (let possibleClassLabel of this.possibleClassLabels) {
54
- result += ";" + possibleClassLabel;
55
- }
56
- return result.toString();
20
+ }
21
+ /**
22
+ * Accessor for the possible class labels.
23
+ *
24
+ * @return Possible class labels of the composite instance.
25
+ */
26
+ getPossibleClassLabels() {
27
+ return this.possibleClassLabels;
28
+ }
29
+ /**
30
+ * Mutator method for possible class labels.
31
+ *
32
+ * @param possibleClassLabels Ner value of possible class labels.
33
+ */
34
+ setPossibleClassLabels(possibleClassLabels) {
35
+ this.possibleClassLabels = possibleClassLabels;
36
+ }
37
+ /**
38
+ * Converts composite instance to {@link String}.
39
+ *
40
+ * @return String representation of composite instance.
41
+ */
42
+ toString() {
43
+ let result = super.toString();
44
+ for (let possibleClassLabel of this.possibleClassLabels) {
45
+ result += ";" + possibleClassLabel;
57
46
  }
47
+ return result.toString();
58
48
  }
59
- exports.CompositeInstance = CompositeInstance;
60
- });
49
+ }
50
+ exports.CompositeInstance = CompositeInstance;
61
51
  //# sourceMappingURL=CompositeInstance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CompositeInstance.js","sourceRoot":"","sources":["../../source/Instance/CompositeInstance.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,yCAAoC;IAGpC,MAAa,iBAAkB,SAAQ,mBAAQ;QAI3C;;;;;;;WAOG;QACH,YAAY,UAAkB,EAAE,UAA6B,EAAE,mBAAmC;YAC9F,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;YAX1B,wBAAmB,GAAkB,IAAI,KAAK,EAAU,CAAA;YAY5D,IAAI,mBAAmB,IAAI,SAAS,EAAC;gBACjC,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAA;aACjD;QACL,CAAC;QAED;;;;WAIG;QACH,sBAAsB;YAClB,OAAO,IAAI,CAAC,mBAAmB,CAAA;QACnC,CAAC;QAED;;;;WAIG;QACH,sBAAsB,CAAC,mBAAkC;YACrD,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAA;QAClD,CAAC;QAED;;;;WAIG;QACH,QAAQ;YACJ,IAAI,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC9B,KAAK,IAAI,kBAAkB,IAAI,IAAI,CAAC,mBAAmB,EAAE;gBACrD,MAAM,IAAI,GAAG,GAAG,kBAAkB,CAAC;aACtC;YACD,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC7B,CAAC;KACJ;IAjDD,8CAiDC"}
1
+ {"version":3,"file":"CompositeInstance.js","sourceRoot":"","sources":["../../source/Instance/CompositeInstance.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