Train - Test - Split Function
Train - Test - Split Function
3 documentation
Home Installation
Documentation
Examples
sklearn.model_selection.train_test_split
Quick utility that wraps input validation and next(ShuffleSplit().split(X, y)) and application to input
data into a single call for splitting (and optionally subsampling) data in a oneliner.
Examples
>>> import numpy as np >>>
>>> from sklearn.model_selection import train_test_split
>>> X, y = np.arange(10).reshape((5, 2)), range(5)
>>> X
array([[0, 1],
[2, 3],
[4, 5],
[6, 7],
[8, 9]])
» >>> list(y)
[0, 1, 2, 3, 4]
Probability calibration of
Previous Classifier comparison Column Transformer with Next
https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html 2/5
11/7/2019 sklearn.model_selection.train_test_split — scikit-learn 0.21.3 documentation
Previous Next
https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html 3/5
11/7/2019 sklearn.model_selection.train_test_split — scikit-learn 0.21.3 documentation
Previous Next
https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html 4/5
11/7/2019 sklearn.model_selection.train_test_split — scikit-learn 0.21.3 documentation
Previous Next
https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html 5/5