Type Definition linfa::dataset::Dataset [−][src]
type Dataset<D, T> = DatasetBase<ArrayBase<OwnedRepr<D>, Ix2>, ArrayBase<OwnedRepr<T>, Ix2>>;
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 Array2
.
Implementations
impl<F: Float, E> Dataset<F, E>
[src]
pub fn split_with_ratio(self, ratio: f32) -> (Self, Self)
[src]
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.