Last active
March 11, 2019 10:38
-
-
Save jrzaurin/115fb3c2a266be7d0a0af82998ea500b to your computer and use it in GitHub Desktop.
This file contains 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
if not Path('mlruns').exists(): | |
client = MlflowClient() | |
n_experiments=0 | |
elif not reuse_experiment: | |
client = MlflowClient() | |
n_experiments = len(client.list_experiments()) | |
experiment_name = 'experiment_' + str(n_experiments) | |
client.create_experiment(name=experiment_name) | |
with mlflow.start_run(experiment_id=n_experiments): | |
model = lgb.LGBMClassifier(**best) | |
model.fit(X,y, | |
feature_name=colnames, | |
categorical_feature=categorical_columns | |
) | |
for name, value in best.items(): | |
mlflow.log_param(name, value) | |
mlflow.log_metric('binary_logloss', trials.best_trial['result']['loss']) | |
mlflow.sklearn.log_model(model, "model") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment