Learn R Programming

latrend (version 1.1.0)

transformPredict: Helper function that matches the output to the specified newdata

Description

If Cluster is not provided, the prediction is outputted in long format per cluster, resulting in a longer data.frame than the newdata input

Usage

transformPredict(pred, model, newdata)

# S4 method for `NULL`,lcModel transformPredict(pred, model, newdata)

# S4 method for vector,lcModel transformPredict(pred, model, newdata)

# S4 method for matrix,lcModel transformPredict(pred, model, newdata)

# S4 method for data.frame,lcModel transformPredict(pred, model, newdata)

Arguments

pred

The prediction object

model

The model for which the prediction is made.

newdata

A data.frame containing the input data to predict for.

Value

A data.frame with the predictions, or a list of cluster-specific prediction frames