Type Definition linfa::dataset::Dataset

source · []
pub type Dataset<D, T, I = Ix2> = DatasetBase<ArrayBase<OwnedRepr<D>, Ix2>, ArrayBase<OwnedRepr<T>, I>>;
Expand description

Dataset

The most commonly used typed of dataset. It contains a number of records stored as an Array2 and each record may correspond to multiple targets. The targets are stored as an Array1 or Array2.

Implementations

Split dataset into two disjoint chunks

This function splits the observations in a dataset into two disjoint chunks. The splitting threshold is calculated with the ratio. If the input Dataset contains n samples then the two new Datasets will have respectively n * ratio and n - (n*ratio) samples. For example a ratio of 0.9 allocates 90% to the first chunks and 10% to the second. This is often used in training, validation splitting procedures.

Parameters
  • ratio: the ratio of samples in the input Dataset to include in the first output one
Returns

The input Dataset split into two according to the input ratio.

Panics

Panic occurs when the input record or targets are not in row-major layout.