Doubt while training the dataset

hello here why do we only use mnb.fit function and not fit_transform function?

hey @Sid10 ,

fit method is used with machine learning models to learn information , extract feature for future prediction , hence they don’t transform or change the data provided to them , they just learn some patterns based on them and perform calculations.

whereas , fit_transform means it will first understand the data and also transform it to some other values , just like we do preprocessing on data. For example LabelEncoder from sklearn. They implement funtion fit_transform . It take input as a list of various string classes ,and return a list of converted unique individual numeric labels .

I hope this would have resolved your doubt.
Thank You and Happy Learning :slightly_smiling_face:.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.