RF1: Random Forest classifier

Description Usage Arguments Value Examples

View source: R/RF1.R

Description

Classify the input with a Random forest classifier. Function uses a vector of tree depth and does a grid search with mtry parameter for the best training error. Once the best Parameters have been identified, it uses them to predict on the test data.

Usage

1
RF1(data, ntree.vec)

Arguments

data

A list generated by the function PrepareData. It is a list with two components. One is a vector of labels, the other is a data frame of features. The other element of the list is a data frame of test features.

ntree.vec

A vector vector of vaues of number of trees that should be tested.

Value

A list with a dataframe of errors a vector of predictions with the best parameters

Examples

1
2
3
4
path <- "/home/rishabh/mres/ml_comp/data/"
data <- PrepareData(path, mode = 2, sample = TRUE, size = 100)
ntree.vec <- seq(50, 100, 10)
RF1(data, ntree.vec)

rishi1226/classrish documentation built on May 27, 2019, 9:10 a.m.