Skip to content

Commit

Permalink
Fix flaky ModelInsight tests (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
TuanNguyen27 authored and tovbinm committed Aug 30, 2019
1 parent 9e2d48a commit b91ffe3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/src/test/scala/com/salesforce/op/ModelInsightsTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ class ModelInsightsTest extends FlatSpec with PassengerSparkFixtureTest with Dou
}
}

val tol = 0.03
val tol = 0.1
it should "correctly return the descaled coefficient for linear regression, " +
"when standardization is on" in {

Expand All @@ -755,8 +755,8 @@ class ModelInsightsTest extends FlatSpec with PassengerSparkFixtureTest with Dou
val bigCoeffSum = orginalbigCoeff * math.sqrt(smallFeatureVariance) / labelStd + descaledbigCoeff
val absError2 = math.abs(originalsmallCoeff * math.sqrt(bigFeatureVariance) / labelStd - descaledsmallCoeff)
val smallCoeffSum = originalsmallCoeff * math.sqrt(bigFeatureVariance) / labelStd + descaledsmallCoeff
absError / bigCoeffSum < tol shouldBe true
absError2 / smallCoeffSum < tol shouldBe true
absError should be < tol * bigCoeffSum / 2
absError2 should be < tol * smallCoeffSum / 2
}

it should "correctly return the descaled coefficient for logistic regression, " +
Expand All @@ -771,8 +771,8 @@ class ModelInsightsTest extends FlatSpec with PassengerSparkFixtureTest with Dou
val bigCoeffSum = orginalbigCoeff * math.sqrt(smallFeatureVariance) + descaledbigCoeff
val absError2 = math.abs(originalsmallCoeff * math.sqrt(mediumFeatureVariance) - descaledsmallCoeff)
val smallCoeffSum = originalsmallCoeff * math.sqrt(mediumFeatureVariance) + descaledsmallCoeff
absError / bigCoeffSum < tol shouldBe true
absError2 / smallCoeffSum < tol shouldBe true
absError should be < tol * bigCoeffSum / 2
absError2 should be < tol * smallCoeffSum / 2
}

it should "correctly return moments calculation and cardinality calculation for numeric features" in {
Expand Down

0 comments on commit b91ffe3

Please sign in to comment.