1. Home
  2. Data Science
  3. TensorFlow
  4. In model.fit(X, y, validation_split=0.2), which data is…

Added 2 Nov 2026

In model.fit(X, y, validation_split=0.2), which data is used for validation?

  1. The last 20% of the samples, before shuffling Correct answer
  2. A random 20% chosen again each epoch
  3. 20% of the features rather than the samples
  4. The first 20% of the samples, after shuffling

Correct answer

A. The last 20% of the samples, before shuffling

16 views

MCQSEXAM

Explanation

Keras takes the final 20% of the arrays before any shuffling. If the data is sorted, for example by class, shuffle it first or pass explicit validation_data.

Reference

Asked in: Data Science Interviews, AI Engineer Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More TensorFlow MCQs

Practise all TensorFlow MCQs

Similar MCQs