2014-10-14 15:20 GMT-04:00 M Asad <masad....@gmail.com>:
> Hi,
>
> I am kind of new to scikit, however I have learned a alot of things now.
>
> I am using scikit.ensemble.RandomForestRegressor to train on a data and
> predict using some input samples later.
> What I am trying to do now is to access the actual values that make up each
> leaf node.
>
> I have managed to get the index of each leaf node used for prediction by
> using apply() function
> And I can also access the prediction value by calling
> forestReg.estimators_[i].tree_.value[j] where i is the tree index and j is
> the index of the leaf node.
>
> Does anyone have any idea how I can get all the values that make up a leaf
> node? I have set min_samples_leaf = 5 so each leaf node comprises of at
> least 5 samples.

I am not exactly sure about what you are trying to do but maybe having
a look at the source code of the `predict` method of the trees will
help:

https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/_tree.pyx#L2417

-- 
Olivier

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to