A call such as model.fit(X, y).predict(X) works in scikit-learn because fit returns:
Correct answer
B. the estimator itself, so that calls can be chained
16 views
B. the estimator itself, so that calls can be chained
16 views
The API contract is that fit returns self, which is what allows fit and predict to be chained; the learned parameters are stored on that same object as attributes ending in an underscore.
Asked in: NTS, PPSC IT, Interviews
Not sure why the answer is B? Ask here and get an explanation.