-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InsightLOCOTest Refactor #412
InsightLOCOTest Refactor #412
Conversation
…ogrifAI into LocoTestRefactor merge master
Thanks for the contribution! It looks like @AdamChit is an internal user so signing the CLA is not required. However, we need to confirm this. |
Codecov Report
@@ Coverage Diff @@
## master #412 +/- ##
==========================================
- Coverage 86.99% 83.31% -3.68%
==========================================
Files 337 337
Lines 11078 11078
Branches 369 597 +228
==========================================
- Hits 9637 9230 -407
- Misses 1441 1848 +407
Continue to review full report at Codecov.
|
testData: RecordInsightsTestData[LogisticRegressionModel] | ||
): Unit = { | ||
private def assertAggregatedWithPredicate(predicate: OpVectorColumnHistory => Boolean, | ||
testData: RecordInsightsTestData[LogisticRegressionModel]): Unit = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert the formatting here to the way it was before to match scala style guidelines?
@@ -202,7 +202,8 @@ class RecordInsightsLOCOTest extends FlatSpec with TestSparkContext with RecordI | |||
} | |||
} | |||
|
|||
it should "return the most predictive features for data generated with a strong relation to the label" in { | |||
describe("data strongly related to label. ") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description doesn't seem to match the following section. Can you add something more descriptive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -96,7 +96,7 @@ class RecordInsightsLOCOTest extends FlatSpec with TestSparkContext with RecordI | |||
) | |||
) | |||
// scalastyle:on | |||
Spec[RecordInsightsLOCO[_]] should "work with randomly generated features and binary logistic regression" in { | |||
it ("should work with randomly generated features and binary logistic regression") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace it
with Spec[RecordInsightsLOCO[_]]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one comment - replace it
with Spec[RecordInsightsLOCO[_]]
@@ -202,7 +202,8 @@ class RecordInsightsLOCOTest extends FlatSpec with TestSparkContext with RecordI | |||
} | |||
} | |||
|
|||
it should "return the most predictive features for data generated with a strong relation to the label" in { | |||
describe("return the most predictive features for data that is strongly related to label. ") { | |||
// Generate the data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should wrap data generation in an informative describe
or add informers info
. This part still feels too long
code coverage decrease not due to changes in this PR |
Related issues
Long test that needs to be refactored with the main goal of making it more readable and breaking it up into separate tests
Describe the proposed solution
First Change from FlatSpec to FunSpec then break up the test into 5 different test cases
Describe alternatives you've considered
could of put the data generation code into a function, but generating data is expensive so we wouldn't want to make repeated calls to it