In model.fit(X, y, validation_split=0.2), which data is used for validation?
A
The last 20% of the samples, before shuffling
Correct answer
B
A random 20% chosen again each epoch
C
20% of the features rather than the samples
D
The first 20% of the samples, after shuffling
Correct answer
A. The last 20% of the samples, before shuffling
16 views
⚔️
Challenge a friend on TensorFlow
Same MCQs, timed, live leaderboard. Send the link on WhatsApp – no sign-up needed.
Create challenge
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
Doubts & discussionNot sure why the answer is A? Ask here and get an explanation.
Ask a doubt about this MCQ
‹ Previous MCQ What is the key difference between tf.Variable and tf.constant? Next MCQ › For multi-class labels given as integers (0, 1, 2…), which loss is appropriate?