Created
May 8, 2018 16:47
-
-
Save benoitdescamps/49a7a8fb4847973880168a8cbb2511df 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