Description Usage Arguments Value Author(s) See Also Examples
View source: R/criteria.calculator.R
Calculates the Entropy or Gini Index of a particular node before (or without)
a split. This function is used inside the
criteria.after.split.calculator
method.
1 2 | criteria.calculator(x.node = data.frame(), y.new.node = c(),
entropy = TRUE)
|
x.node |
numericized data frame of covariates of a particular node
(can be obtained by applying |
y.new.node |
numericized vector of class type ( |
entropy |
|
A list containing the following items:
criteria |
the value of the Entropy or the Gini Index of a particular node. |
ent.status |
logical value ( |
Hyunjin Cho, h56cho@uwaterloo.ca Rebecca Su, y57su@uwaterloo.ca
criteria.after.split.calculator
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## example: iris dataset
library(forestRK) # load the package forestRK
# covariates of training data set
x.train <- x.organizer(iris[,1:4], encoding = "num")[c(1:25,51:75,101:125),]
# numericized class types of observations of training dataset
y.train <- y.organizer(iris[c(1:25,51:75,101:125),5])$y.new
## criteria.calculator() example
## calculate the Entropy of the original training dataset
criteria.calculator(x.node = x.train, y.new.node = y.train)
## calculate the Gini Index of the original training dataset
criteria.calculator(x.node = x.train, y.new.node = y.train, entropy = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.