Skip to content
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

Use ParamGridBuilder in model selector grids to allow modifications #206

Merged
merged 1 commit into from Jan 11, 2019

Conversation

@tovbinm
Copy link
Collaborator

commented Jan 10, 2019

Related issues
It's difficult to reuse the model selector default grids, especially if one only wants to change a single param value.

Describe the proposed solution
We replace Array[ParamMap] with ParamGridBuilder to ease on that. For example user can now modify a single parameter maxBins like this and keep the rest of the grid the same:

val modelsAndParams = BinaryClassificationModelSelector.Defaults.modelsAndParams.map {
    case (e: OpRandomForestClassifier, grid) => e -> grid.addGrid(e.maxBins, Array(1, 2, 3)).build()
    case (e, grid) => e -> grid.build()
  }
val modelSelector = BinaryClassificationModelSelector.withCrossValidation(modelsAndParameters = modelsAndParams)

Describe alternatives you've considered
Many many others.

Additional context
This is still not over...

@tovbinm tovbinm requested a review from leahmcguire as a code owner Jan 10, 2019
@tovbinm tovbinm requested a review from Jauntbox Jan 10, 2019
@tovbinm tovbinm requested a review from kinfaikan Jan 10, 2019
@codecov

This comment has been minimized.

Copy link

commented Jan 10, 2019

Codecov Report

Merging #206 into master will increase coverage by 4.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #206      +/-   ##
==========================================
+ Coverage   82.25%   86.34%   +4.08%     
==========================================
  Files         310      310              
  Lines       10058    10132      +74     
  Branches      528      549      +21     
==========================================
+ Hits         8273     8748     +475     
+ Misses       1785     1384     -401
Impacted Files Coverage Δ
...ssification/MultiClassificationModelSelector.scala 97.56% <ø> (+1.9%) ⬆️
...ages/impl/regression/RegressionModelSelector.scala 98.11% <ø> (+2.11%) ⬆️
...sification/BinaryClassificationModelSelector.scala 98.24% <ø> (+1.81%) ⬆️
...op/stages/impl/selector/ModelSelectorFactory.scala 85.71% <100%> (-1.79%) ⬇️
...es/src/main/scala/com/salesforce/op/OpParams.scala 85.71% <0%> (-4.09%) ⬇️
...in/scala/com/salesforce/op/cli/gen/AvroField.scala 76.92% <0%> (+76.92%) ⬆️
...cala/com/salesforce/op/cli/gen/FileGenerator.scala 77.27% <0%> (+77.27%) ⬆️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f0c3fd9...2a6eedb. Read the comment docs.

@tovbinm tovbinm merged commit fd4c42c into master Jan 11, 2019
8 checks passed
8 checks passed
CodeFactor No issues found.
Details
Travis CI - Pull Request Build Passed
Details
ci/circleci: compile Your tests passed on CircleCI!
Details
ci/circleci: scala-style Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 82.25%)
Details
codecov/project 86.34% (+4.08%) compared to f0c3fd9
Details
salesforce-cla All contributors have signed the CLA
Details
@tovbinm tovbinm deleted the mt/builder branch Jan 11, 2019
@Jauntbox Jauntbox referenced this pull request Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.