Created
April 30, 2020 08:50
Star
You must be signed in to star a gist
Get infos about the AutoML best model and then serialize the model
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
lb <- aml@leaderboard | |
for (model_auto_ml in 1:nrow(lb)){ | |
auto_ml_model_id <- | |
as.list(lb$model_id)[model_auto_ml][1] | |
auto_ml_auc <- | |
as.list(lb$auc)[model_auto_ml][1] | |
auto_ml_logloss <- | |
as.list(lb$logloss)[model_auto_ml][1] | |
auto_ml_aucpr <- | |
as.list(lb$aucpr)[model_auto_ml][1] | |
auto_ml_mean_per_class_error <- | |
as.list(lb$mean_per_class_error)[model_auto_ml][1] | |
auto_ml_rmse <- | |
as.list(lb$rmse)[model_auto_ml][1] | |
auto_ml_mse <- | |
as.list(lb$mse)[model_auto_ml][1] | |
log_info("AutoML - model_id: {auto_ml_model_id} - auc: {auto_ml_auc} - logloss: {auto_ml_logloss} - aucpr: {auto_ml_aucpr} - mean_per_class_error: {auto_ml_mean_per_class_error} - rmse: {auto_ml_rmse} - mse: {auto_ml_mse}") | |
} | |
log_info("AutoML Winning Model - model_id: {aml@leader@model_id} - algorithm: {aml@leader@algorithm} - seed: {aml@leader@parameters$seed} - metalearner_nfolds: {aml@leader@parameters$metalearner_nfolds} - training_frame: {aml@leader@parameters$training_frame} - validation_frame: {aml@leader@parameters$validation_frame}") | |
model_file_path <- | |
get_artifact_path("", MODELS_DIR) | |
log_info("Model destination path: {model_file_path}") | |
model_path <- h2o.saveModel(object=aml@leader, | |
path=model_file_path, | |
force=TRUE) | |
log_info("Model artifact path: {model_path}") | |
end_time_pipeline <- Sys.time() | |
log_debug('Training pipeline end time - {end_time_pipeline}') | |
time_elapsed_pipeline <- end_time_pipeline - start_time_pipeline | |
log_debug('Training pipeline time elapsed - {time_elapsed_pipeline[1]} mins') | |
log_debug('Training pipeline finished') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment