Function discretize_equal_width

Source
pub fn discretize_equal_width<S>(
    array: &ArrayBase<S, Ix2>,
    n_bins: usize,
    encode: &str,
    axis: usize,
) -> Result<Array2<f64>>
where S: Data, S::Elem: Float + NumCast,
Expand description

Discretizes features using equal-width bins

§Arguments

  • array - The input array to discretize
  • n_bins - The number of bins to create
  • encode - The encoding method (‘onehot’ or ‘ordinal’)
  • axis - The axis along which to discretize (0 for columns, 1 for rows)

§Returns

  • Result<Array2<f64>> - The discretized array