buildPredict: A closure that generates a function call for predicting new...

Description Usage Arguments Value Note

View source: R/OOP_util.R

Description

This function returns a function that will predict data for the specified model type. This functionality is necessary because not all the packages used by NPEL.Classification conform to the standard predict.* function model; hence this function standardizes the interface so it is straightforward to predict data from any of the model types used, using the same interface.

Usage

1
buildPredict(model)

Arguments

model

the model for which to build a predict function

Value

a predict function for that model type.

Note

The nearest neighbour models in package:FNN and package:class do not enclose their results in a class; when NPEL.Classification builds objects of these types it wraps them in a class so they are recognizable by S3 methods, and attaches the formula and data. Hence, if a model was built directly using these packages, the result will not run this function.


henkelstone/NPEL.Classification documentation built on May 17, 2019, 3:42 p.m.