Last active
July 13, 2019 01:25
-
-
Save ikanez/350cc4eeb030a23f8231c2cd03550739 to your computer and use it in GitHub Desktop.
Tracking parameters for MLflow
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
for param in parameters_list: | |
# start mlflow run | |
with mlflow.start_run(run_name='arima_param'): | |
# log parameters | |
mlflow.log_param('param-qs', param[0]) | |
mlflow.log_param('param-ps', param[1]) | |
try: | |
model = SARIMAX(btc_month.close_box, order=(param[0], d, param[1])).fit(disp=-1) | |
except ValueError: | |
print('bad parameter combination:', param) | |
continue | |
aic = model.aic | |
# log metric | |
mlflow.log_metric("metric", model.aic) | |
if aic < best_aic: | |
best_model = model | |
best_aic = aic | |
best_param = param | |
results.append([param, model.aic]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment