Row weights and making predictions in H2O #15512
Unanswered
hasithjp
asked this question in
Technical Notes
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Motivation
This technical note was inspired by the following question from a Data Science user:
I’ve trained a GLM and a RF using weights, but when I try to predict on a test data I get this error:
Discussion
If the user goes through the effort to create weights for training, they most likely want to use weights for validation (often a holdout set). We abort to prevent a user mistake. Only a pure test set without a response is accepted without weights, since no metrics are to be computed. Metrics need to know the row weights.
It's easy to add a trivial weights column to a validation frame. Here is an example of how to do that in R.
validation_frame$weights <- 1
Alternately, remove the response column from the data set to be predicted. Then metrics will not be computed and the error will not be hit.
Note that the name of the weights column is specified by the user when the model is built, and can be any name, not just "weights".
Example
JIRA Issue Migration Info
Jira Issue: TN-1
Assignee: TomK
Reporter: TomK
State: Resolved
Relates to: #14943
Beta Was this translation helpful? Give feedback.
All reactions