pivot_on_split_exclude_missing

Function pivot_on_split_exclude_missing 

Source
pub fn pivot_on_split_exclude_missing(
    index: &mut [usize],
    feature: &[u16],
    split_value: u16,
) -> (usize, usize)
Expand description

Provided a list of index values, pivot those values around a specific split value so all of the values less than the split value are on one side, and then all of the values greater than or equal to the split value are above. Missing values, will be pushed to the bottom, a value of zero is missing in this case. Returns a tuple, the first is the first non-missing value index, the second is the first value that is greater than our provided split value.

WARNING!!! Currently, this function fails, if all the values are missing…

  • index - The index values to sort.
  • feature - The feature vector to use to sort the index by.
  • split_value - the split value to use to pivot on.