Created
January 19, 2022 03:35
-
-
Save kvnkho/8425b521852f74fd1a4b5fd72654f7ab to your computer and use it in GitHub Desktop.
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
@task | |
def get_models(): | |
space1 = Space(model=LogisticRegression, solver="lbfgs", C=Grid(10,20), penalty=Grid("l2","none")) | |
space2 = Space(model=RandomForestClassifier, max_samples=Rand(0.8,1), max_depth=RandInt(3,4)).sample(4) | |
space = [x.simple_value for x in list(space1+space2)] | |
models = [] | |
for model_params in space: | |
model = model_params.pop("model") | |
models.append(model(**model_params)) | |
return models |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment