sklearn_train_test_split: Sklearn train_test_split wrapper

Description Usage Arguments References

View source: R/sklearn_train_test_split.R

Description

A function to split a dataset into training and validation set, stratified by the target column.

Usage

1
2
3
4
5
6
7
8
sklearn_train_test_split(
  dataset,
  target_col,
  split,
  seed = NULL,
  return_only_index = FALSE,
  stratify = TRUE
)

Arguments

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).

References

https://scikit-learn.org/stable/modules/generated/sklearn. model_selection.train_test_split.html


kapsner/lightgbm.py documentation built on April 10, 2020, 4:49 p.m.