transform.h2o4gpu_model: Transform a Dataset using Trained H2O4GPU Estimator

Description Usage Arguments Examples

View source: R/model.R

Description

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

Usage

1
2
## 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

 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)

h2o4gpu documentation built on May 18, 2021, 1:07 a.m.