Learn R Programming

MultivariateRandomForest (version 1.1)

Multi_D_mod: Information Gain

Description

Compute the cost function of a node of samples in a tree

Usage

Multi_D_mod(y, V_inv, Command)

Arguments

y
Output Features for the samples of the node
V_inv
Covariance matrix of Output Feature matrix
Command
1 for RF and 2 for MRF depending on the method

Value

cost or Entropy of samples in a node of a tree

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 where in univariate trees node cost is measured as the Euclidean distance. Mahalanobis Distance captures the distance of the sample point from the mean of the node along the principal component axes.

References

De Maesschalck, Roy, Delphine Jouan-Rimbaud, and Desire L. Massart. "The mahalanobis distance." Chemometrics and intelligent laboratory systems 50.1 (2000): 1-18.

Examples

Run this code
y=matrix(runif(10*2),10,2)
V_inv=stats::cov(y)
Command=2
#Command=2 for MRF and 1 for RF
#This function calculates information gain of a node
Cost=Multi_D_mod(y,V_inv,Command)

Run the code above in your browser using DataLab