Learn R Programming

mnj (version 1.0)

mnj.pred: Predict function

Description

A custom predict function for FlexBoost

Usage

mnj.pred(object, X, type = c("response", "prob"), n_tree = NULL)

Arguments

object

Tree information

X

Variable of train data

type

Class or probability

n_tree

Number of trees

Details

This is a predict function of FlexBoost. FlexBoost consists of two predict functions. One is built-in function in R and the other is this custom predict function for FlexBoost. This custom predict function is needed for the calculation of the final strong classifier. It returns the expected input data's labels.

Examples

Run this code
# NOT RUN {
data <- read.csv(url("http://bit.ly/flex_iris"), TRUE)
model <- flex(data[,1:2], data[,6], 10, 0.1, 3, 2)
mnj.pred(model, data[,1:2], "response", NULL)
# }

Run the code above in your browser using DataLab