Skip to content

ENH method to index ParameterGrid points by parameter values #1842

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

Closed
wants to merge 4 commits into from

Conversation

jnothman
Copy link
Member

@jnothman jnothman commented Apr 7, 2013

This extension intends to solve #1020 for regular grids: it provides an index into the grid points output by ParameterGrid, such that results from GridSearchCV (particularly when returned as an array as in #1787) can be accessed by parameter value.

For example, I could get the mean test_score for each 'max_depth' value:

grid_search = GridSearchCV(clf, {'max_depth': range(1, 5), 'max_features': range(1, 3)})
grid_search.fit(...)
grid = ParameterGrid(grid_search.param_grid) # should we make it easier to get the ParameterGrid?
keys, index = grid.build_index(['max_depth'], ravel=True)
indexed = np.array(candidate.mean_validation_score for candidate in [grid_search.cv_scores_])[index]
print(indexed.mean(axis=1))

This PR aims to account for most of the functionality of #1034 within the current parameter search framework. The examples from there should be adopted.

@jnothman
Copy link
Member Author

jnothman commented Apr 7, 2013

Accessing this functionality from GridSearchCV should probably be less verbose...

@jnothman
Copy link
Member Author

Closing due to lack of interest.

@jnothman jnothman closed this Aug 10, 2014
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.

1 participant