Tree Methods API Reference
Functions
ChemometricsTools.CART — Method.(M::CART)(x)This is a universal CART object predict function.
ChemometricsTools.ClassificationTree — Method.ClassificationTree(x, y; gainfn = entropy, maxdepth = 4, minbranchsize = 3)Builds a CART object using either gini or entropy as a partioning method. Y must be a one hot encoded 2-Array. Predictions can be formed by calling the following function from the CART object: (M::CART)(x).
*Note: this is a purely nonrecursive decision tree. The julia compiler doesn't like storing structs of nested things. I wrote it the recursive way in the past and it was quite slow, I think this is true also of interpretted languages like R/Python...So here it is, nonrecursive tree's!
ChemometricsTools.OneHotOdds — Method.OneHotOdds(Y)Calculates the odds of a one-hot formatted probability matrix. Returns a tuple.
ChemometricsTools.RegressionTree — Method.RegressionTree(x, y; gainfn = ssd, maxdepth = 4, minbranchsize = 3)Builds a CART object using ssd as a partioning method. Y must be a one column Array. Predictions can be formed by calling the following function from the CART object: (M::CART)(x).
*Note: this is a purely nonrecursive decision tree. The julia compiler doesn't like storing structs of nested things. I wrote it the recursive way in the past and it was quite slow, I think this is true also of interpretted languages like R/Python...So here it is, nonrecursive tree's!
ChemometricsTools.entropy — Method.entropy(v)Calculates the Shannon-Entropy of a probability vector v. Returns a scalar. A common gain function used in tree methods.
ChemometricsTools.gini — Method.gini(p)Calculates the GINI coefficient of a probability vector p. Returns a scalar. A common gain function used in tree methods.
ChemometricsTools.ssd — Method.ssd(p)Calculates the sum squared deviations from a decision tree split. Accepts a vector of values, and the mean of that vector. Returns a scalar. A common gain function used in tree methods.