Ask Your Question
0

What does the parameter "stratify" refer to in the "train_test_split" method of scikit learn?

asked 2022-05-28 11:00:00 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-02-18 16:00:00 +0000

david gravatar image

The parameter "stratify" in the "traintestsplit" method of scikit learn refers to the optional argument that is used to ensure that the split is representative of the data. When the "stratify" parameter is set to a categorical variable, the split is ensured to have the same ratio of the categorical variable in each subset as the original dataset. This is useful when the categorical variable is imbalanced, and we want to ensure that each subset has a representative sample of the different categories.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-05-28 11:00:00 +0000

Seen: 1 times

Last updated: Feb 18 '22