#[non_exhaustive]pub struct StratifiedSplit {
pub training_fraction: f64,
pub validation_fraction: f64,
pub test_fraction: f64,
pub key: String,
/* private fields */
}pipeline-service only.Expand description
Assigns input data to the training, validation, and test sets so that the
distribution of values found in the categorical column (as specified by the
key field) is mirrored within each split. The fraction values determine
the relative sizes of the splits.
For example, if the specified column has three values, with 50% of the rows having value “A”, 25% value “B”, and 25% value “C”, and the split fractions are specified as 80/10/10, then the training set will constitute 80% of the training data, with about 50% of the training set rows having the value “A” for the specified column, about 25% having the value “B”, and about 25% having the value “C”.
Only the top 500 occurring values are used; any values not in the top 500 values are randomly assigned to a split. If less than three rows contain a specific value, those rows are randomly assigned.
Supported only for tabular Datasets.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.training_fraction: f64The fraction of the input data that is to be used to train the Model.
validation_fraction: f64The fraction of the input data that is to be used to validate the Model.
test_fraction: f64The fraction of the input data that is to be used to evaluate the Model.
key: StringRequired. The key is a name of one of the Dataset’s data columns. The key provided must be for a categorical column.
Implementations§
Source§impl StratifiedSplit
impl StratifiedSplit
pub fn new() -> Self
Sourcepub fn set_training_fraction<T: Into<f64>>(self, v: T) -> Self
pub fn set_training_fraction<T: Into<f64>>(self, v: T) -> Self
Sets the value of training_fraction.
§Example
let x = StratifiedSplit::new().set_training_fraction(42.0);Sourcepub fn set_validation_fraction<T: Into<f64>>(self, v: T) -> Self
pub fn set_validation_fraction<T: Into<f64>>(self, v: T) -> Self
Sets the value of validation_fraction.
§Example
let x = StratifiedSplit::new().set_validation_fraction(42.0);Sourcepub fn set_test_fraction<T: Into<f64>>(self, v: T) -> Self
pub fn set_test_fraction<T: Into<f64>>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for StratifiedSplit
impl Clone for StratifiedSplit
Source§fn clone(&self) -> StratifiedSplit
fn clone(&self) -> StratifiedSplit
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more