Skip to content

Instantly share code, notes, and snippets.

@ikanez
Last active July 13, 2019 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikanez/350cc4eeb030a23f8231c2cd03550739 to your computer and use it in GitHub Desktop.
Save ikanez/350cc4eeb030a23f8231c2cd03550739 to your computer and use it in GitHub Desktop.
Tracking parameters for MLflow
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