[][src]Function smartcore::model_selection::train_test_split

pub fn train_test_split<T: RealNumber, M: Matrix<T>>(
    x: &M,
    y: &M::RowVector,
    test_size: f32,
    shuffle: bool
) -> (M, M, M::RowVector, M::RowVector)

Splits data into 2 disjoint datasets.

  • x - features, matrix of size NxM where N is number of samples and M is number of attributes.
  • y - target values, should be of size N
  • test_size, (0, 1] - the proportion of the dataset to include in the test split.
  • shuffle, - whether or not to shuffle the data before splitting