Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h2o.explain gives an error when the AutoML object was trained with a fold_column #7632

Closed
exalate-issue-sync bot opened this issue May 11, 2023 · 1 comment
Assignees

Comments

@exalate-issue-sync
Copy link

There’s an error if you used a {{fold_column}} arg for AutoML. This seems to be related to {{model@parameters$x}} storing extra columns (like {{fold_column}}).

{code:r}library(h2o)

h2o.init()

#Import the titanic dataset
f <- "https://s3.amazonaws.com/h2o-public-test-data/smalldata/gbm_test/titanic.csv"
titanic <- h2o.importFile(f)

Set response column as a factor

y <- "survived"
titanic[y] <- as.factor(titanic[y])
x <- c('home.dest', 'cabin', 'embarked')

Split the dataset into train and test & add fold column

splits <- h2o.splitFrame(titanic, seed = 1, ratios = c(0.8))
train <- splits[[1]]
test <- splits[[2]]
train$fold <- h2o.kfold_column(train, nfolds = 5, seed = 1)

aml <- h2o.automl(y = y, x = x,
training_frame = train,
fold_column = "fold",
max_models = 5,
seed = 1)

h2o.explain(aml, test){code}

Gives this error:

{code:r}Error in [.H2OFrame(newdata, , x) :
No column(s) 'fold' found in pclass,survived,name,sex,age,sibsp,parch,ticket,fare,cabin,embarked,boat,body,home.dest
In addition: Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
Test/Validation dataset is missing column 'fold': substituting in a column of NaN
2: In doTryCatch(return(expr), name, parentenv, handler) :
Test/Validation dataset is missing column 'fold': substituting in a column of NaN{code}

@h2o-ops
Copy link
Collaborator

h2o-ops commented May 14, 2023

JIRA Issue Details

Jira Issue: PUBDEV-8016
Assignee: Tomas Fryda
Reporter: Erin LeDell
State: Resolved
Fix Version: 3.32.1.1
Attachments: N/A
Development PRs: N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants