pub fn split_iv_woe(
        &self,
        split_idx: usize,
        start: usize,
        stop: usize,
    ) -> ((f64, f64), (f64, f64)) {
        // vals_ is in sorted order, so we need to find
        // the first position of the record that is less
        // than our split_value
        // This means the split_idx, will be one after our actual
        // split value, thus the left hand side will include
        // the split value.
        let split_idx = split_idx + 1 + start;

        // Accumulate the left hand side.
        let lhs_zero_dist =
            sum_of_cuml_subarray(&self.cuml_zero_ct_, start, split_idx - 1) / self.total_zero_;
        let lhs_ones_dist =
            sum_of_cuml_subarray(&self.cuml_ones_ct_, start, split_idx - 1) / self.total_ones_;
        let lhs_woe = (lhs_ones_dist / lhs_zero_dist).ln();
        let lhs_iv = (lhs_ones_dist - lhs_zero_dist) * lhs_woe;

        // Accumulate the right hand side.
        let rhs_zero_dist =
            sum_of_cuml_subarray(&self.cuml_zero_ct_, split_idx, stop - 1) / self.total_zero_;
        let rhs_ones_dist =
            sum_of_cuml_subarray(&self.cuml_ones_ct_, split_idx, stop - 1) / self.total_ones_;
        let rhs_woe = (rhs_ones_dist / rhs_zero_dist).ln();
        let rhs_iv = (rhs_ones_dist - rhs_zero_dist) * rhs_woe;

        ((lhs_iv, lhs_woe), (rhs_iv, rhs_woe))
    }
/// Split the feature and calculate information value
/// and weight of evidence for the records bellow and
/// above the split.
Split the feature and calculate information value
and weight of evidence for the records bellow and
above the split.
Split the feature and calculate information value and weight of evidence for the records bellow and above the split .
pub fn split_iv_woe(
        &self,
        split_idx: usize,
        start: usize,
        stop: usize,
    ) -> ((f64, f64), (f64, f64)) {
        // vals_ is in sorted order, so we need to find
        // the first position of the record that is less
        // than our split_value
        // This means the split_idx, will be one after our actual
        // split value, thus the left hand side will include
        // the split value.
        let split_idx = split_idx + 1 + start;
        // Accumulate the left hand side.
        let lhs_zero_dist =
            sum_of_cuml_subarray(&self.cuml_zero_ct_, start, split_idx - 1) / self.total_zero_;
        let lhs_ones_dist =
            sum_of_cuml_subarray(&self.cuml_ones_ct_, start, split_idx - 1) / self.total_ones_;
        let lhs_woe = (lhs_ones_dist / lhs_zero_dist).ln();
        let lhs_iv = (lhs_ones_dist - lhs_zero_dist) * lhs_woe;
        // Accumulate the right hand side.
        let rhs_zero_dist =
            sum_of_cuml_subarray(&self.cuml_zero_ct_, split_idx, stop - 1) / self.total_zero_;
        let rhs_ones_dist =
            sum_of_cuml_subarray(&self.cuml_ones_ct_, split_idx, stop - 1) / self.total_ones_;
        let rhs_woe = (rhs_ones_dist / rhs_zero_dist).ln();
        let rhs_iv = (rhs_ones_dist - rhs_zero_dist) * rhs_woe;
        ((lhs_iv, lhs_woe), (rhs_iv, rhs_woe))
    }
pub fn split_iv_woe ( & self , split_idx : usize , start : usize , stop : usize , ) -> ( ( f64 , f64 ) , ( f64 , f64 ) ) { // vals_ is in sorted order, so we need to find // the first position of the record that is less // than our split_value // This means the split_idx, will be one after our actual // split value, thus the left hand side will include // the split value. let split_idx = split_idx + 1 + start ; // Accumulate the left hand side. let lhs_zero_dist = sum_of_cuml_subarray ( & self . cuml_zero_ct_ , start , split_idx - 1 ) / self . total_zero_ ; let lhs_ones_dist = sum_of_cuml_subarray ( & self . cuml_ones_ct_ , start , split_idx - 1 ) / self . total_ones_ ; let lhs_woe = ( lhs_ones_dist / lhs_zero_dist ) . ln ( ) ; let lhs_iv = ( lhs_ones_dist - lhs_zero_dist ) * lhs_woe ; // Accumulate the right hand side. let rhs_zero_dist = sum_of_cuml_subarray ( & self . cuml_zero_ct_ , split_idx , stop - 1 ) / self . total_zero_ ; let rhs_ones_dist = sum_of_cuml_subarray ( & self . cuml_ones_ct_ , split_idx , stop - 1 ) / self . total_ones_ ; let rhs_woe = ( rhs_ones_dist / rhs_zero_dist ) . ln ( ) ; let rhs_iv = ( rhs_ones_dist - rhs_zero_dist ) * rhs_woe ; ( ( lhs_iv , lhs_woe ) , ( rhs_iv , rhs_woe ) ) }
Split the feature and calculate information value
and weight of evidence for the records bellow and
above the split.
Split the feature and calculate information value and weight of evidence for the records bellow and above the split .
&self
split_idx
usize
start
usize
stop
usize