h2o4gpu (version 0.2.0)

transform.h2o4gpu_model: Transform a Dataset using Trained H2O4GPU Estimator

Description

This function transforms the given new data using a trained H2O4GPU model.

Usage

# S3 method for h2o4gpu_model
transform(object, x, ...)

Arguments

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).

Examples

Run this code
# 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)

# }

Run the code above in your browser using DataLab