Skip to content

Commit bdd7be7

Browse files
authored
[ML] relaxing parameters on stratified split test (#54127) (#54169)
Relaxing the error rate a bit on two of the tests. Ran 1000s of times locally and never had a failure after these changes. closes #54122
1 parent e380a5a commit bdd7be7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/crossvalidation/StratifiedCrossValidationSplitterTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ public void testProcess_GivenRowsWithDependentVariableValue_AndTrainingPercentIs
179179

180180
double expectedTotalTrainingCount = ROWS_COUNT * trainingFraction;
181181
assertThat(trainingDocsCount + testDocsCount, equalTo((long) ROWS_COUNT));
182-
assertThat(trainingDocsCount, greaterThanOrEqualTo((long) Math.floor(expectedTotalTrainingCount - 1)));
183-
assertThat(trainingDocsCount, lessThanOrEqualTo((long) Math.ceil(expectedTotalTrainingCount + 1)));
182+
assertThat(trainingDocsCount, greaterThanOrEqualTo((long) (expectedTotalTrainingCount - 2)));
183+
assertThat(trainingDocsCount, lessThanOrEqualTo((long) Math.ceil(expectedTotalTrainingCount) + 2));
184184

185185
for (String classValue : classCardinalities.keySet()) {
186186
double expectedClassTrainingCount = totalRowsPerClass.get(classValue) * trainingFraction;
@@ -221,7 +221,7 @@ public void testProcess_SelectsTrainingRowsUniformly() {
221221
// should be close to the training percent, which is set to 0.5
222222
for (int rowTrainingCount : trainingCountPerRow) {
223223
double meanCount = rowTrainingCount / (double) runCount;
224-
assertThat(meanCount, is(closeTo(0.5, 0.1)));
224+
assertThat(meanCount, is(closeTo(0.5, 0.12)));
225225
}
226226
}
227227

0 commit comments

Comments
 (0)