Description Usage Arguments Examples
This function transforms the given new data using a trained H2O4GPU model.
1 2 |
object |
The h2o4gpu model object |
x |
The new data where each column represents a different predictor variable to be used in generating predictions. |
... |
Additional arguments (unused for now). |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
library(h2o4gpu)
# Prepare data
iris$Species <- as.integer(iris$Species) # convert to numeric data
# Randomly sample 80% of the rows for the training set
set.seed(1)
train_idx <- sample(1:nrow(iris), 0.8*nrow(iris))
train <- iris[train_idx, ]
test <- iris[-train_idx, ]
# Train a K-Means model
model_km <- h2o4gpu.kmeans(n_clusters = 3L) %>% fit(train)
# Transform test data
test_dist <- model_km %>% transform(test)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.