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

Remove default value of objective function and objective config field. #458

Merged
merged 30 commits into from Feb 13, 2019

Conversation

desilinguist
Copy link
Member

  • Remove objective field and remove default values for `objectives.
  • Remove code for normalizing and error checking the two fields since there is now only one.
  • Add an additional check that objectives is not empty when running an experiment.
  • Tweak parallelization to deal with empty objectives, e.g., when not doing grid search.
  • Make default value of grid_objective to be None for train() and cross_validate() and add a check in train() that raises an exception if we are doing grid search and the objective is not specified. We don't need a similar check for cross_validate() since that calls train() underlyingly anyway.
  • Make metric a required parameter for learning_curve().
  • Add new test for empty objectives and remove unnecessary tests e.g., for the removed objective field.
  • Fix tests that were using objective to now use objectives, explicitly specify functions where needed, and explicitly specify that we are doing grid search.
  • Fix tests that were relying on score to not use that since that is the objective function value on the test set and will not be computed when there is no such function or when we aren't doing grid search.
  • Ignore grid_objectives if we aren't doing grid search since this would prevent unnecessary computation when grid search is False but the user still specified a list of objectives.
  • Add new tests.
  • Flake8 formatting fixes in several places.

Please test this quite throughly as this is a major backwards incompatible change.

- Remove code for normalizing and error checking the two since there is now only one field.
- Add an additional check that `objectives` is not empty when running an experiment.
- Make default value of `grid_objective` to be `None` for `train()` and `cross_validate()` and add a check in `train()` that raises an exception if we are doing grid search and the objective is not specified.
- Make `metric` a required parameter for `learning_curve()`.
- flake8 fixes.
- No longer need test for the removed `objective` field.
- Fix other tests that were using `objective` to now use `objectives`.
- flake8 fixes
- Since there's no longer a default value.
- flake8 fixes.
- We only need to check this for specific tasks.
- To check that missing objectives is fine for this task.
- Since there are no default objectives now.
- We don't want the objective in the name of the output files if (a) it was not specified to begin with or (b) if there was only one objective since then it's obvious which file is which.
 - It will not be available if we aren't doing grid search
- This would prevent unnecesary computation in cases when grid search was false but the user still specified a list of objectives.
- replace 'objective' with 'objectives'
- explicitly specify grid search in places
- do not rely on default values of objectives
- shorter docstrings
- Specify `grid_objective` explicitly when calling `train()`.
- Some flake8 fixes
- For some reason the same file was being appended to.
@desilinguist desilinguist requested review from a user and mulhod February 11, 2019 22:16
@desilinguist desilinguist self-assigned this Feb 11, 2019
@desilinguist desilinguist added this to In progress in SKLL Release v2.5 via automation Feb 11, 2019
@desilinguist desilinguist added this to the 2.0 milestone Feb 11, 2019
@coveralls
Copy link

coveralls commented Feb 11, 2019

Coverage Status

Coverage decreased (-0.08%) to 92.642% when pulling 570d324 on remove-default-objective into 0b13413 on master.

@desilinguist
Copy link
Member Author

Something going on with Travis/Coveralls integration again. Re-running builds.

@desilinguist
Copy link
Member Author

desilinguist commented Feb 12, 2019

Yeah, I don't really know why coveralls is reporting 3 new lines as being uncovered. I don't see an issue since that function is called multiple times in learning curve tests.

@mulhod
Copy link
Contributor

mulhod commented Feb 12, 2019

Even going back to the last build with respect to _train_and_score, it seems like the function is not covered, at least according to Coveralls. I would guess that it claims this because when it's used it is called via parallel(joblib.delayed(_train_and_score)....

@desilinguist
Copy link
Member Author

yeah that's what I was thinking as well @mulhod 👍

Copy link
Contributor

@mulhod mulhod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I peeked into the coverage "issue" also and, while I suspect the reason the uncovered function is uncovered due to parallelization, I could not figure out why Coveralls would suddenly be claiming 3 lines as newly uncovered. ¯\(ツ)

skll/config.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@jbiggsets jbiggsets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! Two extremely minor comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants