Super learner
This user is a Super Learner. To become a Super Learner, you need to reach Level 8.
Last answered:

18 Apr 2022

Posted on:

15 Apr 2022

0

Resolved: Why do we use fit_predict() instead of just predict()?

Hello,

In the clustering results part of the video, why do we use fit_predict() instead of just predict()? We've already fitted the data in the line kmeans.fit(x). Why do we need to fit it again and then predict it with fit_predict()?

Thank you in advance!

Kind regards,
Desislava Hristowa

1 answers ( 1 marked as helpful)
Instructor
Posted on:

18 Apr 2022

1

Dear Desislava,

Thank you for your question!

You are correct, calling the fit_predict() method is not wrong, but introduces an additional unnecessary step. Calling the predict() method after the fitting process would indeed be better.

Kind regards,
365 Hristina

Submit an answer