Description Usage Arguments References
View source: R/sklearn_train_test_split.R
A function to split a dataset into training and validation set, stratified by the target column.
1 2 3 4 5 6 7 8 | sklearn_train_test_split(
dataset,
target_col,
split,
seed = NULL,
return_only_index = FALSE,
stratify = TRUE
)
|
dataset |
A data.table object. The dataset used for training. |
target_col |
A character string. The name of the target column. |
split |
A numeric. Ratio to split 'dataset' into training set and validation set (default: 0.7). The allowed value range is 0 < validation_split < 1. |
seed |
A integer (default: NULL). Please use this argument in order to generate reproducible results. |
return_only_index |
A logical (default: FALSE). If FALSE,, the return value is a list containing the split data.tables. If TRUE, only the sampled row numbers are returned. |
stratify |
A logical. If the the dataset should be splitted in a stratified fashion (does only work for categorical variables; default: TRUE). |
https://scikit-learn.org/stable/modules/generated/sklearn. model_selection.train_test_split.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.