msmbuilder / osprey

🦅Hyperparameter optimization for machine learning pipelines 🦅
http://msmbuilder.org/osprey
Apache License 2.0
74 stars 26 forks source link

Checks params for being serializable by Json #223

Closed RobertArbon closed 7 years ago

RobertArbon commented 7 years ago

Added is_json_serializable to utils.py + test case in test_utils.py. Added this check to the build_full_params() in execute_worker.py Added a nose test case called msmb_feat_select.

So now if a parameter isn't serializable with Json it doesn't get added to the param dictionary. Without this FeatureSelect was causing a crash when the params were being written to the database. Other estimator params (e.g. numpy arrays, mdtraj objects) will not get recorded.

However: numpy.int64 ARE NOT json_serializable numpy.float64 ARE json_serializable

So for int/jump variables to be recorded they must be cast to python native equivalents.

cxhernandez commented 7 years ago

Looks great! Thanks so much!