fn comp_leaf_data(&self, set: &[(&f64, &NumericTruth)]) -> NumericLeafParam {
        let size = set.len();
        let truth = set.iter().fold(0, |sum, &(_, t)| match *t {
            NumericTruth::InClass => sum + 1,
            _ => sum,
        });

        let prob = (truth as f64) / (size as f64);
        return NumericLeafParam { probability: prob };
    }
/// Computes the leaf data (probability) using the rate of InClass Truth.
Computes the leaf data (probability) using the rate of InClass Truth.
Computes the leaf data ( probability ) using the rate of InClass Truth .
fn comp_leaf_data(&self, set: &[(&f64, &NumericTruth)]) -> NumericLeafParam {
        let size = set.len();
        let truth = set.iter().fold(0, |sum, &(_, t)| match *t {
            NumericTruth::InClass => sum + 1,
            _ => sum,
        });
        let prob = (truth as f64) / (size as f64);
        return NumericLeafParam { probability: prob };
    }
fn comp_leaf_data ( & self , set : & [ ( & f64 , & NumericTruth ) ] ) -> NumericLeafParam { let size = set . len ( ) ; let truth = set . iter ( ) . fold ( 0 , | sum , & ( _ , t ) | match * t { NumericTruth :: InClass => sum + 1 , _ => sum , } ) ; let prob = ( truth as f64 ) / ( size as f64 ) ; return NumericLeafParam { probability : prob } ; }
Computes the leaf data (probability) using the rate of InClass Truth.
Computes the leaf data ( probability ) using the rate of InClass Truth .
&self
set
&[(&f64, &NumericTruth)]