1. Home
  2. Data Science
  3. Scikit-learn
  4. Why must the first call to partial_fit on a classifier…

Added 30 Nov -0001

Why must the first call to partial_fit on a classifier include the classes argument?

  1. It stops the estimator from resetting the learned coefficients each call
  2. It is only needed when the first batch contains fewer than two classes
  3. The estimator must fix the label set before it can map scores to columns Correct answer
  4. Because partial_fit cannot infer dtypes without an explicit array given

Correct answer

C. The estimator must fix the label set before it can map scores to columns

22 views

MCQSEXAM

Explanation

partial_fit updates an estimator incrementally, so the first batch may not contain every class and the model cannot infer the full label set from it. Passing classes fixes the output dimension of predict_proba across batches and keeps the column order stable. Omitting it raises a ValueError on the first call, and failing to shuffle between epochs biases the online update.

Reference

Asked in: NTS, PPSC IT, Interviews

Preparing for an exam?

Doubts & discussion

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

Ask a doubt about this MCQ

Shown after review. No links please.

More Scikit-learn MCQs

Practise all Scikit-learn MCQs

Similar MCQs