-
Notifications
You must be signed in to change notification settings - Fork 101
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
Hyperparameter optimization #128
Hyperparameter optimization #128
Conversation
Still need to improve the web UI, but this works for now. |
The model/estimator whose hyperparameters are to be optimized. | ||
model_params : dict or list of dict | ||
Dictionary with parameter names as keys and lists of parameter values | ||
to try as values, or a list of such dictionaries. |
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.
When is this a list of dicts versus a dict? Trying to wrap my head around the different use cases...
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 never will be in the webapp usage, but package-API users who know a bit about hyperparameter optimization may want to utilize this - check out http://scikit-learn.org/stable/modules/generated/sklearn.grid_search.GridSearchCV.html
Sphinx is suddenly failing in the Drone build... All tests passing locally though. |
👹 Did you rebase everything after the latest merge of doc stuff? The error I see in Drone shouldn't be happening with the new import trickery. |
I agree - but only the last few commits are failing and I definitely didn't On Tue, Dec 22, 2015 at 2:30 PM, Brett Naul notifications@github.com
|
9398e1b
to
935d7fc
Compare
Does anything happen if you |
Ok, just rebased again and pushed - looks happy now. |
What do you all think of the idea of the optimize-hyperparameters-and-fit-to-training-data function returning the the best-fitting estimator only, as opposed to the |
dest_type) or \ | ||
(params_to_optimize and k in params_to_optimize and \ | ||
isinstance(ast.literal_eval(model_params[k]), list) \ | ||
and (type(x) in dest_types_list for x in \ |
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.
Yikes...guess there's no way for this to be simple but maybe it would help a bit to define ast.literal_eval(model_params[k])
before the if
block. Also, should there be an all
around the last list comprehension?
@acrellin I can also see arguments for both sides but I guess I'd vote for returning the |
This looks good to me 👍; wanna rebase so we can see that sweet green 💵? |
cf9422d
to
6761809
Compare
This failed the first time for some reason (said RethinkDB wasn't running) but re-building fixed it. |
I've seen that before, too... A bit troubling |
|
||
""" | ||
# To fit with fixed, non-optimized params, must be wrapped in list | ||
if isinstance(model_params, dict): |
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.
if isinstance(model_params, dict):
model_params = [model_params]
for param_dict in model_params:
...
All tests are passing on my machine (both with Python 3.5 and a clean 2.7 virtual env), and none of the relevant data files have changes between http://nipy.bic.berkeley.edu:8080/github.com/mltsp/mltsp/hyperparameter_optimization/6761809af2e20bafe7c3ec7b9b415047382f7134 and http://nipy.bic.berkeley.edu:8080/github.com/mltsp/mltsp/hyperparameter_optimization/fa3c460e84b35c9f2c28f80f80110efc2595a3af. Anyone have any ideas re: the sudden |
fa3c460
to
4e1d191
Compare
4e1d191
to
5592074
Compare
👍 @stefanv ? |
@@ -199,3 +208,20 @@ def extract_data_archive(archive_path, extract_dir=None): | |||
file_paths = [f for f in all_paths if not os.path.isdir(f)] | |||
archive.close() | |||
return file_paths | |||
|
|||
|
|||
def robust_literal_eval_dict(input_dict): |
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, how about:
def robust_literal_eval(value):
try:
return ast.literal_eval(value)
except:
return value
and then
d = {k: robust_literal_eval(v) for k, v in some_dict.items()}
…onaries in build_model; update test_build_model
…checking logic; update tests
2037a9f
to
170f185
Compare
👍 looks really good--thanks for your patience with us, Ari :) |
Add estimator hyperparameter optimization capability; misc. performance improvements and bug fixes. Fixes #103