-
Notifications
You must be signed in to change notification settings - Fork 69
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
Expose cv_folds and stratified #240
Conversation
1 similar comment
if num_cv_folds: | ||
try: | ||
cv_folds = int(num_cv_folds) | ||
except: |
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.
It's probably better to specify a ValueError
explicitly here.
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.
I'm not sure what you mean? There is a ValueError raised?
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.
Sorry, I meant that you want to catch a ValueError
explicitly in the except
clause.
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.
don't I do that?
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.
Here's the code I see:
if num_cv_folds:
try:
cv_folds = int(num_cv_folds)
except:
raise ValueError("The value for cv_folds should be an integer. " +
"You specified {}".format(num_cv_folds))
Here's what I am saying it should look like:
if num_cv_folds:
try:
cv_folds = int(num_cv_folds)
except ValueError:
raise ValueError("The value for cv_folds should be an integer. " +
"You specified {}".format(num_cv_folds))
Note the difference in the except
statement.
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.
Oh I see, will update.
…-nonstratified-xval Expose cv_folds and stratified
This PR addresses #222 and #160.
New options available in config file:
cv_folds
: specify the number of folds for cross validationrandom_folds
: when set to True, does not do stratified cross-validationAdded documentation for above options.
Added missing documentation for
grid_search_folds
.Fixed an apparent bug in
experiments.py
where the value ofgrid_search_folds
set in the config file was being overwritten as 3 for model training when the task was not cross validation.