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

Expose cv_folds and stratified #240

Merged
merged 12 commits into from
Jul 11, 2015
Merged

Conversation

aoifecahill
Copy link
Collaborator

This PR addresses #222 and #160.

New options available in config file:
cv_folds: specify the number of folds for cross validation
random_folds: when set to True, does not do stratified cross-validation

Added documentation for above options.
Added missing documentation for grid_search_folds.

Fixed an apparent bug in experiments.py where the value of grid_search_folds set in the config file was being overwritten as 3 for model training when the task was not cross validation.

@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling c58fa9c on EducationalTestingService:feature/expose-nonstratified-xval into 8a9de86 on EducationalTestingService:master.

@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling 3f028d3 on EducationalTestingService:feature/expose-nonstratified-xval into 8a9de86 on EducationalTestingService:master.

@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling 3f028d3 on EducationalTestingService:feature/expose-nonstratified-xval into 8a9de86 on EducationalTestingService:master.

1 similar comment
@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling 3f028d3 on EducationalTestingService:feature/expose-nonstratified-xval into 8a9de86 on EducationalTestingService:master.

@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling 6529131 on EducationalTestingService:feature/expose-nonstratified-xval into 8a9de86 on EducationalTestingService:master.

@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling 3062046 on EducationalTestingService:feature/expose-nonstratified-xval into 8a9de86 on EducationalTestingService:master.

if num_cv_folds:
try:
cv_folds = int(num_cv_folds)
except:
Copy link
Member

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.

Copy link
Collaborator Author

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?

Copy link
Member

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.

Copy link
Collaborator Author

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?

Copy link
Member

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.

Copy link
Collaborator Author

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.

@desilinguist desilinguist self-assigned this Jul 11, 2015
desilinguist added a commit that referenced this pull request Jul 11, 2015
…-nonstratified-xval

Expose cv_folds and stratified
@desilinguist desilinguist merged commit da0837d into master Jul 11, 2015
@desilinguist desilinguist deleted the feature/expose-nonstratified-xval branch July 11, 2015 22:58
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

3 participants