nano_predict: Calculate Predictions

View source: R/nano_predict.R

nano_predictR Documentation

Calculate Predictions

Description

Calculates predictions from model stored in a nano object.

Usage

nano_predict(nano, model_no, data_type = "train", fold = NULL)

Arguments

nano

a nano object.

model_no

a numeric. Position of model in nano to calculate predictions off.

data_type

a character. Subset of dataset to calculate predictions off.

fold

a numeric. Fold number to calculate predictions off.

Details

data_type can take the values: "train", "test", "holdout". However, these values must first exist in the "data_id" column of the relevant dataset. To calculate the predictions of a specific fold (if cross-validation was performed), used the fold argument. If the fold argument is specified, then the data_type argument will be ignored.

Value

a data.table with two columns, actual and predicted.

Examples

## Not run: 
if(interactive()){
 library(h2o)
 library(nano)
 
 h2o.init()
 
 # import dataset
 data(property_prices)
 
 # create model
 nano <- nano_automl(data     = data, 
                     response = "sale_price")
                     
 # calculate training predictions
 pred <- nano_predict(nano, 1, "train")
 
 }

## End(Not run)

Nanoputian628/nano documentation built on Oct. 30, 2023, 3:28 p.m.