$ ./guess_the_languageAI & ML
AI & ML · easy · #4

How many rows end up in X_test?

from sklearn.model_selection import train_test_split
# X has 1000 rows
X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.2, random_state=42)
  1. 200
  2. 800
  3. 20
  4. 100
test_size=0.2 holds out 20% of the 1000 rows, so 200 go to the test set.
Play AI & ML ▸