[scikit-learn] Fit and predict method

Venkataraman B venkataraman.bal at gmail.com
Sun Feb 24 08:46:30 EST 2019


Got it - thanks

On Sun, Feb 24, 2019 at 4:54 AM Vlad Niculae <zephyr14 at gmail.com> wrote:

> Hi,
>
> The `classifier` object in your code _is_ the model. In other words, after
> `fit`, the classifier object will have some new attributes (for instance
> `classifier.coef_` in the case of linear models), which are used to make
> predictions when you call `predict`.
>
> Hope this helps,
> Vlad
>
> On Sun, Feb 24, 2019, 05:34 Venkataraman B <venkataraman.bal at gmail.com>
> wrote:
>
>> Hi, I had a question on the predict and fit methods
>>
>> The fit method is used to build the model ie classifier.fit(X,y). But
>> when the predict method is called the model that is built is never passed.
>> You only pass the test set. So what model does the predict function use to
>> predict the output
>>
>> I am picking python after working on R and the predict function in R made
>> more sense because the model that was built is passed along with the test
>> set that has to be predicted
>>
>> Any response would be greatly appreciated
>> --
>> Regards, Venkataraman B
>>
> _______________________________________________
>> scikit-learn mailing list
>> scikit-learn at python.org
>> https://mail.python.org/mailman/listinfo/scikit-learn
>>
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
-- 
Regards, Venkataraman B
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20190224/72ffa6a6/attachment.html>


More information about the scikit-learn mailing list