Subset argument while chosing a subset in a Dataframe

While working on the Naive Bayes, I came across the subset argument, and don’t understand what it does.
For example-

train_emails = fetch_20newsgroups(categories = ['',''], subset = 'train')

What does the subset=‘train’ bit do? How will my code be affected if I do not use it?

Sorry about replying with just a link but the quickest route would be to check the docs-

Relevant section:
subset ‘train’ or ‘test’, ‘all’, optional
Select the dataset to load: ‘train’ for the training set, ‘test’ for the test set, ‘all’ for both, with shuffled ordering.

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.