Node_cost: Information Gain

Description Usage Arguments Details Value References Examples

View source: R/RcppExports.R

Description

Compute the cost function of a tree node

Usage

1
Node_cost(y, Inv_Cov_Y, Command)

Arguments

y

Output Features for the samples of the node

Inv_Cov_Y

Inverse of Covariance matrix of Output Response matrix for MRF(Input [0 0;0 0] for RF)

Command

1 for univariate Regression Tree (corresponding to RF) and 2 for Multivariate Regression Tree (corresponding to MRF)

Details

In multivariate trees (MRF) node cost is measured as the sum of squares of the Mahalanobis distance to capture the correlations in the data whereas in univariate trees node cost is measured as the sum of Euclidean distance square. Mahalanobis Distance captures the distance of the sample point from the mean of the node along the principal component axes.

Value

cost or entropy of samples in a node of a tree

References

Segal, Mark, and Yuanyuan Xiao. "Multivariate random forests." Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery 1.1 (2011): 80-87.

Examples

1
2
3
4
5
6
7
library(MultivariateRandomForest)
y=matrix(runif(10*2),10,2)
Inv_Cov_Y=solve(cov(y))
Command=2
#Command=2 for MRF and 1 for RF
#This function calculates information gain of a node
Cost=Node_cost(y,Inv_Cov_Y,Command)

Example output



MultivariateRandomForest documentation built on May 2, 2019, 1:05 p.m.