h2oai / h2o-3

H2O is an Open Source, Distributed, Fast & Scalable Machine Learning Platform: Deep Learning, Gradient Boosting (GBM) & XGBoost, Random Forest, Generalized Linear Modeling (GLM with Elastic Net), K-Means, PCA, Generalized Additive Models (GAM), RuleFit, Support Vector Machine (SVM), Stacked Ensembles, Automatic Machine Learning (AutoML), etc.
http://h2o.ai
Apache License 2.0
6.86k stars 2k forks source link

AutoML R Object throws error when one model trained #12718

Open exalate-issue-sync[bot] opened 1 year ago

exalate-issue-sync[bot] commented 1 year ago

I am seeing errors when using the automl model in R if only one model was built:

{code:R} data.hex = h2o.importFile(path = "https://s3.amazonaws.com/h2o-public-test-data/smalldata/demos/bank-additional-full.csv", destination_frame = "data.hex") myX = 1:20 myY="y" automl <- h2o.automl(x = myX, y = myY, training_frame = data.hex, max_runtime_secs = 1, project_name = "automl")

automl An object of class "H2OAutoML" Slot "project_name": [1] "automl"

Slot "leader": Error in is.H2OFrame(x) : trying to get slot "metrics" from an object of a basic class ("NULL") with no slots {code}

exalate-issue-sync[bot] commented 1 year ago

Erin LeDell commented: This is caused because there are no models built in the specified time-frame (and when you print the object it tries to collect and print model metrics for the leader). If you look only at the leaderboard, that will print fine (1-row with NAs), but not if you try to print the automl object itself. One way to address this is to forcing that one model is always trained in AutoML even it it exceeds max_runtime_secs. The other way is to check if the leaderboard is NA and print a message saying "there are no models in the leaderboard."

hasithjp commented 1 year ago

JIRA Issue Migration Info

Jira Issue: PUBDEV-5866 Assignee: Tomas Fryda Reporter: Megan Kurka State: Open Fix Version: N/A Attachments: N/A Development PRs: N/A