Skip to content

Commit 505c859

Browse files
committed
find most likely result
1 parent a6cb197 commit 505c859

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed
Binary file not shown.

src/classification/DistanceClassification.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,25 @@ private void testClassificationModel() {
171171

172172

173173
}
174-
174+
float min = Float.valueOf(this.predictedTestData[i][0][1]);
175+
int tempIndex = 0;
175176
for (int j = 0; j <this.numberOfClasses; j++) {
176-
this.sortedProbability[i][j] = Integer.valueOf(this.predictedTestData[i][j][1]);
177+
if (min > Float.valueOf(this.predictedTestData[i][j][1])) {
178+
min = Float.valueOf(this.predictedTestData[i][j][1]);
179+
tempIndex = j;
180+
181+
}
182+
177183

178184
}
185+
this.sortedProbability[i][0] = tempIndex;
186+
System.out.println(this.sortedProbability[i][0]);
179187

180188

189+
if (i == 5) {
190+
break;
191+
}
181192

182-
break;
183193
//int[] tempProbability = new int[this.numberOfClasses];
184194
/*
185195
for (int j = 0; j < this.numberOfClasses; j++) {

0 commit comments

Comments
 (0)