@Doug: Sorry I was typing my previous response from my phone.

The snippet of code that I was talking about can be found at:
https://github.com/glouppe/scikit-learn/blob/master/sklearn/ensemble/forest.py#L93

Cheers,

Gilles

On Wednesday, 26 September 2012, Gilles Louppe <[email protected]> wrote:
> Hi,
>
> The ensemble classes handle the problem you describe already. Have a look
at the implementation of predict_proba of BaseForestClassifier in
ensemble.py if you want to do that yourself by hand.
>
> Hope this helps.
>
> Gilles
>
> On Wednesday, 26 September 2012, Mathieu Blondel <[email protected]>
wrote:
>>
>>
>> On Wed, Sep 26, 2012 at 3:52 AM, Doug Coleman <[email protected]>
wrote:
>>>
>>> If you examine the code, fit() "warms up" the optimization with some
>>> additional parameters, then calls _partial_fit().  partial_fit() just
>>> calls _partial_fit() directly. So, it looks like fit() and
>>> partial_fit() could take a `classes` parameter for SGDClassifier,
>>> rather than __init__. It seems a bit confused, actually, since
>>> SGDClassifier's __init__ takes a class_weight dict for doing
>>> cost-sensitive learning but then partial_fit() takes a classes
>>> vector--what if they contradict each other?
>>
>> partial_fit should behave exactly like fit if you call it only once. So,
for your use case, I would just use partial_fit with the classes parameter.
>> # The difference between fit and partial_fit is that fit erases the
previous model on subsequent calls whereas partial_fit starts from the
previous model.
>> Mathieu
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to