train_test_split

Function train_test_split 

Source
pub fn train_test_split(
    x: Array2<f64>,
    y: Array2<f64>,
    split_ratio: f64,
) -> Result<(Array2<f64>, Array2<f64>, Array2<f64>, Array2<f64>), Box<dyn Error>>
Expand description

Function to split dataset into train and test sets

§Parameters:

  • x: Array2<f64> - Feature matrix
  • y: Array2<f64> - Target matrix
  • split_ratio: f64 - Ratio for the training set (e.g., 0.8 for 80% train, 20% test)

§Returns:

  • Result<(Array2<f64>, Array2<f64>, Array2<f64>, Array2<f64>), Box<dyn Error>>
    • Tuple containing (x_train, y_train, x_test, y_test)