So I think it should be as
# for n_estimators=10
clf = RandomForestClassifier(n_estimators=10, oob_score=True)
clf.fit(X,y)
print clf.oob_score_

clf.oob_score_ will give oob accuracy.

But I would also like to know what percent of data is used to calculate
this score?




On Wed, Sep 12, 2012 at 1:14 PM, Brian Holt <[email protected]> wrote:

> You're absolutely right, you can simply use the oob estimate as your
> measure of generalisability. No need for GridSearchCV...
> On Sep 12, 2012 12:09 PM, "Sheila the angel" <[email protected]>
> wrote:
>
>> Hello all,
>> I want to optimize n_estimators and max_features for ensemble
>> methods (say forRandomForestClassifier ).
>> Usually I use GridSearchCV() with cv=4 which do 4 fold cross validation
>> for data and gives best parameter/model.
>> In the document section 'out-of-bag-estimates'
>> http://scikit-learn.org/dev/modules/grid_search.html#out-of-bag-estimates
>> says 'left out portion can be used to estimate the generalization error
>> without having to rely on a separate validation set'.
>>
>> 'out-of-bag-estimates'  suggests GridSearchCV() is not needed in this
>> case!!
>> If so how do I get best parameter values and model.
>> Or I got the whole concept wrong?
>>
>> Thanks.
>> --
>> Sheila
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> 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
>>
>>
>
> ------------------------------------------------------------------------------
> 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
>
>
------------------------------------------------------------------------------
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