HealthCatalyst / healthcareai-py

Python tools for healthcare machine learning
http://healthcare.ai
MIT License
313 stars 186 forks source link

Allow custom Scikit params to be passed through in the advanced class #462

Closed mmastand closed 6 years ago

mmastand commented 6 years ago

I'd love to be able to use the hcai interface and tools but still be able to pass params like min_node_size, class_weight, and train_test_split_fraction to customize my models, grid search, or prevent overfitting.

levithatcher commented 6 years ago

@Aylr Said just confirmed that a dict can be passed for custom hyperparameter tuning

mmastand commented 6 years ago

Great, I am happily mistaken! Sorry to underestimate!

Aylr commented 6 years ago

Please see https://github.com/HealthCatalyst/healthcareai-py/blob/master/example_advanced.py and I'm happy to walk you a neat trick if this doesn't suffice!

Accessing the .advanced_features attribute on an instance of the SupervisedModelTrainer gives you the underlying advanced trainer. I routinely use this to mess with, say, random forest. For example: trainer.advanced_features.random_forest_classifier(hyperparameter_grid={stuff}) allows you the more control without giving up the goodness that SMT provides. Note you won't see graph output, so you'll have to make those plot calls.