refactor: simplify nested loop for finding min and max values in training data
This commit is contained in:
@@ -23,14 +23,13 @@ public class Main {
|
|||||||
|
|
||||||
int minValue = Integer.MAX_VALUE;
|
int minValue = Integer.MAX_VALUE;
|
||||||
int maxValue = Integer.MIN_VALUE;
|
int maxValue = Integer.MIN_VALUE;
|
||||||
for (LabeledSequence sequence : train) {
|
for (LabeledSequence ls : train) {
|
||||||
for (LabeledSequence labeledSequence : train) {
|
for (int v : ls.sequence()) {
|
||||||
for (int v : labeledSequence.sequence()) {
|
|
||||||
if (v < minValue) minValue = v;
|
if (v < minValue) minValue = v;
|
||||||
if (v > maxValue) maxValue = v;
|
if (v > maxValue) maxValue = v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
minValue = minValue - 1;
|
minValue = minValue - 1;
|
||||||
maxValue = maxValue + 1;
|
maxValue = maxValue + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user