transform.h2o4gpu_model {h2o4gpu}R Documentation

Transform a Dataset using Trained H2O4GPU Estimator

Description

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

Usage

## S3 method for class '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

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

[Package h2o4gpu version 0.3.3 Index]