Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fdef11f

Browse files
committed
trying to sort all probabilities
1 parent 505c859 commit fdef11f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed
Binary file not shown.

‎src/classification/DistanceClassification.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,23 @@ private void testClassificationModel() {
173173
}
174174
float min = Float.valueOf(this.predictedTestData[i][0][1]);
175175
int tempIndex = 0;
176+
this.sortedProbability[i][0] = tempIndex;
176177
for (int j = 0; j <this.numberOfClasses; j++) {
177178
if (min > Float.valueOf(this.predictedTestData[i][j][1])) {
178179
min = Float.valueOf(this.predictedTestData[i][j][1]);
179180
tempIndex = j;
180-
181+
if (this.sortedProbability[i][0] != 0) {
182+
for (int k = this.numberOfClasses -1; k > 0; k--) {
183+
this.sortedProbability[i][k] = this.sortedProbability[i][k -1];
184+
}
185+
}
186+
this.sortedProbability[i][0] = j;
181187
}
182-
183-
184188
}
185189
this.sortedProbability[i][0] = tempIndex;
186190
System.out.println(this.sortedProbability[i][0]);
191+
System.out.println(this.sortedProbability[i][1]);
192+
System.out.println(this.sortedProbability[i][2]);
187193

188194

189195
if (i == 5) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /