Created
May 8, 2018 16:46
-
-
Save benoitdescamps/b4f0424bf9813f6c0a1a9ad71b3ac51c to your computer and use it in GitHub Desktop.
code snippet for Tuning Hyperparameters (part I): SuccessiveHalving
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SHSklearnEstimator(SHBaseEstimator): | |
def __init__(self,model,ressource_name=None): | |
self.model = model | |
self.ressource_name = ressource_name | |
self.env = None | |
def update(self,Xtrain,ytrain,Xval,yval,scoring,n_iterations): | |
self.set_params(**{'warm_start':True,self.ressource_name:n_iterations}) | |
self.model.fit(Xtrain,ytrain) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment