Struct coniferous::CARTree [−][src]
pub struct CARTree { /* fields omitted */ }
The model for a decision tree backed by the CART algorithm. A binary tree.
Methods
impl CARTree
[src]
impl CARTree
pub fn predict(&self, x: &[f64]) -> u64
[src]
pub fn predict(&self, x: &[f64]) -> u64
Given a vector of x values, predict the corresponding category. Requires that the decision tree has already been fit.
In Review
Should this method potentially take a reference as opposed to ownership?
pub fn fit(x: &[Vec<f64>], y: &[u64], params: DTParameters) -> CARTree
[src]
pub fn fit(x: &[Vec<f64>], y: &[u64], params: DTParameters) -> CARTree
let x1 = vec![0.0, 1.0, 2.0]; let x2 = vec![2.0, 1.0, 0.0]; let x = vec![x1, x2]; // In this case, x[0] == x1 && x[0][2] == 2.0