[scikit-learn] Issue with DecisionTreeClassifier

Ibrahim Dalal cs14btech11041 at iith.ac.in
Mon Aug 29 11:44:21 EDT 2016


Thanks Nelson.

Is there any way to access number of training samples in a node?
Thanks

On Mon, Aug 29, 2016 at 8:53 PM, Nelson Liu <nfliu at uw.edu> wrote:

> Hi,
> Yes, it's estimator.tree_.impurity
>
> Nelson
>
> On Mon, Aug 29, 2016, 09:18 Ibrahim Dalal via scikit-learn <
> scikit-learn at python.org> wrote:
>
>> Hi,
>>
>> Is there a way to extract impurity value of a node in
>> DecisionTreeClassifier? I am able to get this value in graph (using
>> export_grapgviz), but can't figure out how to get this value in my code. Is
>> there any attribute similar to estimator.tree_.children_left?
>>
>> Thanks
>>
>> On Mon, Aug 29, 2016 at 12:53 AM, Nelson Liu <nfliu at uw.edu> wrote:
>>
>>> That should be:
>>> node indicator = estimator.tree_.decision_path(X_test)
>>>
>>> PR welcome :)
>>>
>>> On Sun, Aug 28, 2016, 13:12 Ibrahim Dalal via scikit-learn <
>>> scikit-learn at python.org> wrote:
>>>
>>>> Dear Developers,
>>>>
>>>> DecisionTreeClassifier.decision_path() as used here
>>>> http://scikit-learn.org/dev/auto_examples/tree/unveil_
>>>> tree_structure.html is giving the following error:
>>>>
>>>> AttributeError: 'DecisionTreeClassifier' object has no attribute
>>>> 'decision_path'
>>>>
>>>> Kindly help.
>>>>
>>>> Thanks
>>>> _______________________________________________
>>>> 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
>>>
>>>
>> _______________________________________________
>> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20160829/aa3cd6e8/attachment.html>


More information about the scikit-learn mailing list