[scikit-learn] Accessing Clustering Feature Tree in Birch

Sema Atasever s.atasever at gmail.com
Wed Sep 13 03:37:02 EDT 2017


Dear Roman,

I tried to search through on the web but i didn't get any information or
example.

Could you give me an example of using _CFNode.centroids_?

I would appreciate it if you would help me.

On Wed, Aug 23, 2017 at 2:28 PM, Roman Yurchak <rth.yurchak at gmail.com>
wrote:

> > what are the data samples in this cluster
>
> Mehmet's response below works for exploring the hierarchical tree.
> However, Birch currently doesn't store the data samples that belong to a
> given subcluster. If you need that, as far as I know, a reasonable
> approximation can be obtained by computing the data samples that are
> closest to the centroid of the considered subcluster (accessible via
> _CFNode.centroids_) as compared to all other subcluster centroids at this
> hierarchical tree depth.
>
> Alternatively, the modifications in PR https://github.com/scikit-lear
> n/scikit-learn/pull/8808 aimed to make this process easier..
> --
> Roman
>
>
> On 23/08/17 13:44, Suzen, Mehmet wrote:
>
>> Hi Sema,
>>
>> You can access CFNode from the fit output, assign fit output, so you
>> can have the object.
>>
>> brc_fit = brc.fit(X)
>> brc_fit_cfnode = brc_fit.root_
>> <sklearn.cluster.birch._CFNode object at 0x7ff31acbf668>
>>
>> Then you can access CFNode, see here
>> https://kite.com/docs/python/sklearn.cluster.birch._CFNode
>>
>> Also, this example comparing mini batch kmeans.
>> http://scikit-learn.org/stable/auto_examples/cluster/plot_
>> birch_vs_minibatchkmeans.html
>>
>> Hope this was what you are after.
>>
>> Best,
>> Mehmet
>>
>> On 23 August 2017 at 10:55, Sema Atasever <s.atasever at gmail.com> wrote:
>>
>>> Dear scikit-learn members,
>>>
>>> Considering the "CF-tree" data structure :
>>>
>>> - How can i access Clustering Feature Tree in Birch?
>>>
>>> - For example, how many clusters are there in the hierarchy under the
>>> root
>>> node and what are the data samples in this cluster?
>>>
>>> - Can I get them separately for 3 trees?
>>>
>>> Best.
>>>
>>> _______________________________________________
>>> 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/20170913/596da3aa/attachment.html>


More information about the scikit-learn mailing list