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.
- package/dist/Attribute/Attribute.js +6 -16
- package/dist/Attribute/Attribute.js.map +1 -1
- package/dist/Attribute/AttributeType.js +22 -32
- package/dist/Attribute/AttributeType.js.map +1 -1
- package/dist/Attribute/BinaryAttribute.js +14 -24
- package/dist/Attribute/BinaryAttribute.js.map +1 -1
- package/dist/Attribute/ContinuousAttribute.js +46 -55
- package/dist/Attribute/ContinuousAttribute.js.map +1 -1
- package/dist/Attribute/DiscreteAttribute.js +38 -48
- package/dist/Attribute/DiscreteAttribute.js.map +1 -1
- package/dist/Attribute/DiscreteIndexedAttribute.js +47 -55
- package/dist/Attribute/DiscreteIndexedAttribute.js.map +1 -1
- package/dist/DataSet/DataDefinition.js +115 -123
- package/dist/DataSet/DataDefinition.js.map +1 -1
- package/dist/DataSet/DataSet.js +268 -245
- package/dist/DataSet/DataSet.js.map +1 -1
- package/dist/DistanceMetric/DistanceMetric.js +2 -12
- package/dist/DistanceMetric/EuclidianDistance.js +27 -37
- package/dist/DistanceMetric/EuclidianDistance.js.map +1 -1
- package/dist/DistanceMetric/MahalanobisDistance.js +27 -36
- package/dist/DistanceMetric/MahalanobisDistance.js.map +1 -1
- package/dist/Experiment/BootstrapRun.js +31 -40
- package/dist/Experiment/BootstrapRun.js.map +1 -1
- package/dist/Experiment/Experiment.js +46 -53
- package/dist/Experiment/Experiment.js.map +1 -1
- package/dist/Experiment/KFoldRun.js +45 -54
- package/dist/Experiment/KFoldRun.js.map +1 -1
- package/dist/Experiment/KFoldRunSeparateTest.js +48 -58
- package/dist/Experiment/KFoldRunSeparateTest.js.map +1 -1
- package/dist/Experiment/MultipleRun.js +2 -12
- package/dist/Experiment/MxKFoldRun.js +31 -40
- package/dist/Experiment/MxKFoldRun.js.map +1 -1
- package/dist/Experiment/MxKFoldRunSeparateTest.js +35 -44
- package/dist/Experiment/MxKFoldRunSeparateTest.js.map +1 -1
- package/dist/Experiment/SingleRun.js +2 -12
- package/dist/Experiment/SingleRunWithK.js +39 -48
- package/dist/Experiment/SingleRunWithK.js.map +1 -1
- package/dist/Experiment/StratifiedKFoldRun.js +26 -36
- package/dist/Experiment/StratifiedKFoldRun.js.map +1 -1
- package/dist/Experiment/StratifiedKFoldRunSeparateTest.js +30 -40
- package/dist/Experiment/StratifiedKFoldRunSeparateTest.js.map +1 -1
- package/dist/Experiment/StratifiedMxKFoldRun.js +29 -39
- package/dist/Experiment/StratifiedMxKFoldRun.js.map +1 -1
- package/dist/Experiment/StratifiedMxKFoldRunSeparateTest.js +34 -43
- package/dist/Experiment/StratifiedMxKFoldRunSeparateTest.js.map +1 -1
- package/dist/Experiment/StratifiedSingleRunWithK.js +27 -36
- package/dist/Experiment/StratifiedSingleRunWithK.js.map +1 -1
- package/dist/FeatureSelection/BackwardSelection.js +26 -36
- package/dist/FeatureSelection/BackwardSelection.js.map +1 -1
- package/dist/FeatureSelection/FeatureSubSet.js +72 -82
- package/dist/FeatureSelection/FeatureSubSet.js.map +1 -1
- package/dist/FeatureSelection/FloatingSelection.js +25 -35
- package/dist/FeatureSelection/FloatingSelection.js.map +1 -1
- package/dist/FeatureSelection/ForwardSelection.js +25 -35
- package/dist/FeatureSelection/ForwardSelection.js.map +1 -1
- package/dist/FeatureSelection/SubSetSelection.js +69 -78
- package/dist/FeatureSelection/SubSetSelection.js.map +1 -1
- package/dist/Filter/DiscreteToContinuous.js +50 -60
- package/dist/Filter/DiscreteToContinuous.js.map +1 -1
- package/dist/Filter/DiscreteToIndexed.js +40 -50
- package/dist/Filter/DiscreteToIndexed.js.map +1 -1
- package/dist/Filter/FeatureFilter.js +23 -32
- package/dist/Filter/FeatureFilter.js.map +1 -1
- package/dist/Filter/LaryFilter.js +46 -55
- package/dist/Filter/LaryFilter.js.map +1 -1
- package/dist/Filter/LaryToBinary.js +48 -58
- package/dist/Filter/LaryToBinary.js.map +1 -1
- package/dist/Filter/Normalize.js +33 -41
- package/dist/Filter/Normalize.js.map +1 -1
- package/dist/Filter/Pca.js +86 -96
- package/dist/Filter/Pca.js.map +1 -1
- package/dist/Filter/TrainedFeatureFilter.js +14 -24
- package/dist/Filter/TrainedFeatureFilter.js.map +1 -1
- package/dist/Instance/CompositeInstance.js +46 -56
- package/dist/Instance/CompositeInstance.js.map +1 -1
- package/dist/Instance/Instance.js +145 -154
- package/dist/Instance/Instance.js.map +1 -1
- package/dist/InstanceList/InstanceList.js +466 -443
- package/dist/InstanceList/InstanceList.js.map +1 -1
- package/dist/InstanceList/InstanceListOfSameClass.js +23 -32
- package/dist/InstanceList/InstanceListOfSameClass.js.map +1 -1
- package/dist/InstanceList/Partition.js +167 -177
- package/dist/InstanceList/Partition.js.map +1 -1
- package/dist/Model/DecisionTree/DecisionCondition.js +71 -80
- package/dist/Model/DecisionTree/DecisionCondition.js.map +1 -1
- package/dist/Model/DecisionTree/DecisionNode.js +302 -311
- package/dist/Model/DecisionTree/DecisionNode.js.map +1 -1
- package/dist/Model/DecisionTree/DecisionStump.js +22 -32
- package/dist/Model/DecisionTree/DecisionStump.js.map +1 -1
- package/dist/Model/DecisionTree/DecisionTree.js +89 -98
- package/dist/Model/DecisionTree/DecisionTree.js.map +1 -1
- package/dist/Model/DummyModel.js +64 -73
- package/dist/Model/DummyModel.js.map +1 -1
- package/dist/Model/Ensemble/BaggingModel.js +34 -44
- package/dist/Model/Ensemble/BaggingModel.js.map +1 -1
- package/dist/Model/Ensemble/RandomForestModel.js +31 -41
- package/dist/Model/Ensemble/RandomForestModel.js.map +1 -1
- package/dist/Model/Ensemble/TreeEnsembleModel.js +55 -64
- package/dist/Model/Ensemble/TreeEnsembleModel.js.map +1 -1
- package/dist/Model/Model.js +130 -140
- package/dist/Model/Model.js.map +1 -1
- package/dist/Model/NeuralNetwork/DeepNetworkModel.js +162 -169
- package/dist/Model/NeuralNetwork/DeepNetworkModel.js.map +1 -1
- package/dist/Model/NeuralNetwork/LinearPerceptronModel.js +69 -78
- package/dist/Model/NeuralNetwork/LinearPerceptronModel.js.map +1 -1
- package/dist/Model/NeuralNetwork/MultiLayerPerceptronModel.js +112 -120
- package/dist/Model/NeuralNetwork/MultiLayerPerceptronModel.js.map +1 -1
- package/dist/Model/NeuralNetwork/NeuralNetworkModel.js +197 -201
- package/dist/Model/NeuralNetwork/NeuralNetworkModel.js.map +1 -1
- package/dist/Model/NonParametric/KnnInstance.js +21 -29
- package/dist/Model/NonParametric/KnnInstance.js.map +1 -1
- package/dist/Model/NonParametric/KnnModel.js +101 -108
- package/dist/Model/NonParametric/KnnModel.js.map +1 -1
- package/dist/Model/Parametric/GaussianModel.js +82 -91
- package/dist/Model/Parametric/GaussianModel.js.map +1 -1
- package/dist/Model/Parametric/KMeansModel.js +59 -67
- package/dist/Model/Parametric/KMeansModel.js.map +1 -1
- package/dist/Model/Parametric/LdaModel.js +83 -91
- package/dist/Model/Parametric/LdaModel.js.map +1 -1
- package/dist/Model/Parametric/NaiveBayesModel.js +119 -132
- package/dist/Model/Parametric/NaiveBayesModel.js.map +1 -1
- package/dist/Model/Parametric/QdaModel.js +70 -79
- package/dist/Model/Parametric/QdaModel.js.map +1 -1
- package/dist/Model/RandomModel.js +85 -92
- package/dist/Model/RandomModel.js.map +1 -1
- package/dist/Model/ValidatedModel.js +21 -31
- package/dist/Model/ValidatedModel.js.map +1 -1
- package/dist/Parameter/ActivationFunction.js +9 -19
- package/dist/Parameter/ActivationFunction.js.map +1 -1
- package/dist/Parameter/BaggingParameter.js +24 -33
- package/dist/Parameter/BaggingParameter.js.map +1 -1
- package/dist/Parameter/C45Parameter.js +34 -42
- package/dist/Parameter/C45Parameter.js.map +1 -1
- package/dist/Parameter/DeepNetworkParameter.js +48 -56
- package/dist/Parameter/DeepNetworkParameter.js.map +1 -1
- package/dist/Parameter/KMeansParameter.js +29 -38
- package/dist/Parameter/KMeansParameter.js.map +1 -1
- package/dist/Parameter/KnnParameter.js +25 -34
- package/dist/Parameter/KnnParameter.js.map +1 -1
- package/dist/Parameter/LinearPerceptronParameter.js +56 -62
- package/dist/Parameter/LinearPerceptronParameter.js.map +1 -1
- package/dist/Parameter/MultiLayerPerceptronParameter.js +38 -46
- package/dist/Parameter/MultiLayerPerceptronParameter.js.map +1 -1
- package/dist/Parameter/Parameter.js +21 -30
- package/dist/Parameter/Parameter.js.map +1 -1
- package/dist/Parameter/RandomForestParameter.js +25 -34
- package/dist/Parameter/RandomForestParameter.js.map +1 -1
- package/dist/Performance/ClassificationPerformance.js +24 -33
- package/dist/Performance/ClassificationPerformance.js.map +1 -1
- package/dist/Performance/ConfusionMatrix.js +149 -158
- package/dist/Performance/ConfusionMatrix.js.map +1 -1
- package/dist/Performance/DetailedClassificationPerformance.js +23 -32
- package/dist/Performance/DetailedClassificationPerformance.js.map +1 -1
- package/dist/Performance/ExperimentPerformance.js +184 -161
- package/dist/Performance/ExperimentPerformance.js.map +1 -1
- package/dist/Performance/Performance.js +21 -30
- package/dist/Performance/Performance.js.map +1 -1
- package/dist/StatisticalTest/Combined5x2F.js +41 -51
- package/dist/StatisticalTest/Combined5x2F.js.map +1 -1
- package/dist/StatisticalTest/Combined5x2t.js +42 -52
- package/dist/StatisticalTest/Combined5x2t.js.map +1 -1
- package/dist/StatisticalTest/Paired5x2t.js +40 -50
- package/dist/StatisticalTest/Paired5x2t.js.map +1 -1
- package/dist/StatisticalTest/PairedTest.js +31 -41
- package/dist/StatisticalTest/PairedTest.js.map +1 -1
- package/dist/StatisticalTest/Pairedt.js +38 -48
- package/dist/StatisticalTest/Pairedt.js.map +1 -1
- package/dist/StatisticalTest/Sign.js +50 -60
- package/dist/StatisticalTest/Sign.js.map +1 -1
- package/dist/StatisticalTest/StatisticalTestResult.js +65 -73
- package/dist/StatisticalTest/StatisticalTestResult.js.map +1 -1
- package/dist/StatisticalTest/StatisticalTestResultType.js +11 -21
- package/dist/StatisticalTest/StatisticalTestResultType.js.map +1 -1
- package/dist/index.js +95 -101
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
- package/tsconfig.json +4 -3
- package/source/tsconfig.json +0 -13
|
@@ -1,170 +1,161 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Instance = void 0;
|
|
4
|
+
const Attribute_1 = require("../Attribute/Attribute");
|
|
5
|
+
const ContinuousAttribute_1 = require("../Attribute/ContinuousAttribute");
|
|
6
|
+
const DiscreteAttribute_1 = require("../Attribute/DiscreteAttribute");
|
|
7
|
+
const Vector_1 = require("nlptoolkit-math/dist/Vector");
|
|
8
|
+
class Instance {
|
|
9
|
+
classLabel;
|
|
10
|
+
attributes = new Array();
|
|
11
|
+
/**
|
|
12
|
+
* Constructor for a single instance. Given the attributes and class label, it generates a new instance.
|
|
13
|
+
*
|
|
14
|
+
* @param classLabel Class label of the instance.
|
|
15
|
+
* @param attributes Attributes of the instance.
|
|
16
|
+
*/
|
|
17
|
+
constructor(classLabel, attributes) {
|
|
18
|
+
this.classLabel = classLabel;
|
|
19
|
+
if (attributes != undefined) {
|
|
20
|
+
this.attributes = attributes;
|
|
21
|
+
}
|
|
8
22
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class Instance {
|
|
18
|
-
/**
|
|
19
|
-
* Constructor for a single instance. Given the attributes and class label, it generates a new instance.
|
|
20
|
-
*
|
|
21
|
-
* @param classLabel Class label of the instance.
|
|
22
|
-
* @param attributes Attributes of the instance.
|
|
23
|
-
*/
|
|
24
|
-
constructor(classLabel, attributes) {
|
|
25
|
-
this.attributes = new Array();
|
|
26
|
-
this.classLabel = classLabel;
|
|
27
|
-
if (attributes != undefined) {
|
|
28
|
-
this.attributes = attributes;
|
|
29
|
-
}
|
|
23
|
+
/**
|
|
24
|
+
* Adds a new attribute.
|
|
25
|
+
*
|
|
26
|
+
* @param value Attribute to be added.
|
|
27
|
+
*/
|
|
28
|
+
addAttribute(value) {
|
|
29
|
+
if (value instanceof Attribute_1.Attribute) {
|
|
30
|
+
this.attributes.push(value);
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* @param value Attribute to be added.
|
|
35
|
-
*/
|
|
36
|
-
addAttribute(value) {
|
|
37
|
-
if (value instanceof Attribute_1.Attribute) {
|
|
38
|
-
this.attributes.push(value);
|
|
32
|
+
else {
|
|
33
|
+
if (!Number.isNaN(value)) {
|
|
34
|
+
this.attributes.push(new ContinuousAttribute_1.ContinuousAttribute(value));
|
|
39
35
|
}
|
|
40
36
|
else {
|
|
41
|
-
|
|
42
|
-
this.attributes.push(new ContinuousAttribute_1.ContinuousAttribute(value));
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
this.attributes.push(new DiscreteAttribute_1.DiscreteAttribute(value));
|
|
46
|
-
}
|
|
37
|
+
this.attributes.push(new DiscreteAttribute_1.DiscreteAttribute(value));
|
|
47
38
|
}
|
|
48
39
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Removes attribute with the given index from the attributes list.
|
|
61
|
-
*
|
|
62
|
-
* @param index Index of the attribute to be removed.
|
|
63
|
-
*/
|
|
64
|
-
removeAttribute(index) {
|
|
65
|
-
this.attributes.splice(index, 1);
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Removes all the attributes from the attributes list.
|
|
69
|
-
*/
|
|
70
|
-
removeAllAttributes() {
|
|
71
|
-
this.attributes = new Array();
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Accessor for a single attribute.
|
|
75
|
-
*
|
|
76
|
-
* @param index Index of the attribute to be accessed.
|
|
77
|
-
* @return Attribute with index 'index'.
|
|
78
|
-
*/
|
|
79
|
-
getAttribute(index) {
|
|
80
|
-
return this.attributes[index];
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Returns the number of attributes in the attributes list.
|
|
84
|
-
*
|
|
85
|
-
* @return Number of attributes in the attributes list.
|
|
86
|
-
*/
|
|
87
|
-
attributeSize() {
|
|
88
|
-
return this.attributes.length;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Adds a {@link Vector} of continuous attributes.
|
|
43
|
+
*
|
|
44
|
+
* @param vector {@link Vector} that has the continuous attributes.
|
|
45
|
+
*/
|
|
46
|
+
addVectorAttribute(vector) {
|
|
47
|
+
for (let i = 0; i < vector.size(); i++) {
|
|
48
|
+
this.attributes.push(new ContinuousAttribute_1.ContinuousAttribute(vector.getValue(i)));
|
|
89
49
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Removes attribute with the given index from the attributes list.
|
|
53
|
+
*
|
|
54
|
+
* @param index Index of the attribute to be removed.
|
|
55
|
+
*/
|
|
56
|
+
removeAttribute(index) {
|
|
57
|
+
this.attributes.splice(index, 1);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Removes all the attributes from the attributes list.
|
|
61
|
+
*/
|
|
62
|
+
removeAllAttributes() {
|
|
63
|
+
this.attributes = new Array();
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Accessor for a single attribute.
|
|
67
|
+
*
|
|
68
|
+
* @param index Index of the attribute to be accessed.
|
|
69
|
+
* @return Attribute with index 'index'.
|
|
70
|
+
*/
|
|
71
|
+
getAttribute(index) {
|
|
72
|
+
return this.attributes[index];
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Returns the number of attributes in the attributes list.
|
|
76
|
+
*
|
|
77
|
+
* @return Number of attributes in the attributes list.
|
|
78
|
+
*/
|
|
79
|
+
attributeSize() {
|
|
80
|
+
return this.attributes.length;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Returns the number of continuous and discrete indexed attributes in the attributes list.
|
|
84
|
+
*
|
|
85
|
+
* @return Number of continuous and discrete indexed attributes in the attributes list.
|
|
86
|
+
*/
|
|
87
|
+
continuousAttributeSize() {
|
|
88
|
+
let size = 0;
|
|
89
|
+
for (let attribute of this.attributes) {
|
|
90
|
+
size += attribute.continuousAttributeSize();
|
|
101
91
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
92
|
+
return size;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The continuousAttributes method creates a new {@link Array} result and it adds the continuous attributes of the
|
|
96
|
+
* attributes list and also it adds 1 for the discrete indexed attributes
|
|
97
|
+
* .
|
|
98
|
+
*
|
|
99
|
+
* @return result {@link Array} that has continuous and discrete indexed attributes.
|
|
100
|
+
*/
|
|
101
|
+
continuousAttributes() {
|
|
102
|
+
let result = new Array();
|
|
103
|
+
for (let attribute of this.attributes) {
|
|
104
|
+
for (let continuousAttribute of attribute.continuousAttributes()) {
|
|
105
|
+
result.push(continuousAttribute);
|
|
115
106
|
}
|
|
116
|
-
return result;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Accessor for the class label.
|
|
120
|
-
*
|
|
121
|
-
* @return Class label of the instance.
|
|
122
|
-
*/
|
|
123
|
-
getClassLabel() {
|
|
124
|
-
return this.classLabel;
|
|
125
107
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Accessor for the class label.
|
|
112
|
+
*
|
|
113
|
+
* @return Class label of the instance.
|
|
114
|
+
*/
|
|
115
|
+
getClassLabel() {
|
|
116
|
+
return this.classLabel;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Converts instance to a {@link String}.
|
|
120
|
+
*
|
|
121
|
+
* @return A string of attributes separated with comma character.
|
|
122
|
+
*/
|
|
123
|
+
toString() {
|
|
124
|
+
let result = "";
|
|
125
|
+
for (let attribute of this.attributes) {
|
|
126
|
+
result = result + attribute.toString() + ",";
|
|
138
127
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
128
|
+
result = result + this.classLabel;
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The getSubSetOfFeatures method takes a {@link FeatureSubSet} as an input. First it creates a result {@link Instance}
|
|
133
|
+
* with the class label, and adds the attributes of the given featureSubSet to it.
|
|
134
|
+
*
|
|
135
|
+
* @param featureSubSet {@link FeatureSubSet} an {@link Array} of indices.
|
|
136
|
+
* @return result Instance.
|
|
137
|
+
*/
|
|
138
|
+
getSubSetOfFeatures(featureSubSet) {
|
|
139
|
+
let result = new Instance(this.classLabel);
|
|
140
|
+
for (let i = 0; i < featureSubSet.size(); i++) {
|
|
141
|
+
result.addAttribute(this.attributes[featureSubSet.get(i)]);
|
|
152
142
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The toVector method returns a {@link Vector} of continuous attributes and discrete indexed attributes.
|
|
147
|
+
*
|
|
148
|
+
* @return {@link Vector} of continuous attributes and discrete indexed attributes.
|
|
149
|
+
*/
|
|
150
|
+
toVector() {
|
|
151
|
+
let values = new Array();
|
|
152
|
+
for (let attribute of this.attributes) {
|
|
153
|
+
for (let continuousAttribute of attribute.continuousAttributes()) {
|
|
154
|
+
values.push(continuousAttribute);
|
|
164
155
|
}
|
|
165
|
-
return new Vector_1.Vector(values);
|
|
166
156
|
}
|
|
157
|
+
return new Vector_1.Vector(values);
|
|
167
158
|
}
|
|
168
|
-
|
|
169
|
-
|
|
159
|
+
}
|
|
160
|
+
exports.Instance = Instance;
|
|
170
161
|
//# sourceMappingURL=Instance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Instance.js","sourceRoot":"","sources":["../../source/Instance/Instance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Instance.js","sourceRoot":"","sources":["../../source/Instance/Instance.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AACjD,0EAAqE;AACrE,sEAAiE;AACjE,wDAAmD;AAGnD,MAAa,QAAQ;IAEA,UAAU,CAAQ;IAC3B,UAAU,GAAqB,IAAI,KAAK,EAAa,CAAA;IAE7D;;;;;OAKG;IACH,YAAY,UAAkB,EAAE,UAA6B;QACzD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,UAAU,IAAI,SAAS,EAAC,CAAC;YACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAChC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,YAAY,CAAC,KAAU;QACnB,IAAI,KAAK,YAAY,qBAAS,EAAC,CAAC;YAC5B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC/B,CAAC;aAAM,CAAC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