SoftClassForest: Implementing a Random Forest of SDTs.

Description Usage Arguments Details Value Examples

Description

SoftClassForest creates categorical Random Forests of Soft Decision Trees while returning the fitted classification given by the majority vote of individual SDTs.

Usage

1
2
SoftClassForest(trainresponses, train, test, ntry, ntrees, depth,
  bag = TRUE)

Arguments

trainresponses

A matrix or data frame of responses 0 and 1 for the training set with length equal to the number of observations in the training set and width equal to the number of possible classifications.

train

A matrix or data frame consisting of all possible variables to attempt for the training set.

test

A matrix or data frame consisting of all possible variables to attempt for the test set.

ntry

A numeric of the number of variables from the num.features to attempt to split. This is useful for building random forests. For a standard tree, choose ntry = num.features.

ntrees

A numeric of the number of SDTs to build in the Random Forest.

depth

A numeric of the number of the depth each SDT should be. Here this ends with 2^{depth - 1} terminal nodes.

bag

Logical if Random Forests should be built with bootstrap aggregating (TRUE) or raw data (FALSE).

Details

SoftClassForest individually fits a Random Forest for each possible classification response using SoftForestPredFeeder function one classification at a time. The result from each one of these SDTs is a fitted probability of 0 or 1. Once all classifications have a fitted probability, the observation is classified as the maximum a posteriori probability. Given a Random Forest of SDTs, the final Random Forest classification goes to the majority vote from the SDTs.

Value

A vector of the final classifications based on the Random Forest generated.

Examples

1
2
3
Responses = SoftClassMatrix(as.vector(iris$Species))
SoftClassForest(trainresponses = Responses, train = iris[,1:4], test = iris[,1:4], 
ntry = 2, ntrees = 15, depth = 2, bag = TRUE)

SoftRandomForest documentation built on May 15, 2019, 5:05 p.m.