You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BIRCH fails with "'_CFSubcluster' object has no attribute 'centroid_'" #6172
This issue occurs to me during an evaluation with growing feature set sizes. In under a second after the call to fit_predict on the BIRCH instance.
Strangely it works for smaller sets of features and does not run out of memory.
For my evaluation I employ 183719 datasets and construct feature sets of growing size. It works with 6 features, but returns this error with 12. I use the version 1.7.
Here is the full stack trace:
Traceback (most recent call last):
File "clusterer.py", line 27, in score
labels = self.clusterer.fit_predict(x)
File "/usr/lib/python2.7/dist-packages/sklearn/base.py", line 371, in fit_predict
self.fit(X)
File "/usr/lib/python2.7/dist-packages/sklearn/cluster/birch.py", line 424, in fit
return self._fit(X)
File "/usr/lib/python2.7/dist-packages/sklearn/cluster/birch.py", line 458, in _fit
split = self.root_.insert_cf_subcluster(subcluster)
File "/usr/lib/python2.7/dist-packages/sklearn/cluster/birch.py", line 193, in insert_cf_subcluster
subcluster)
File "/usr/lib/python2.7/dist-packages/sklearn/cluster/birch.py", line 212, in insert_cf_subcluster
closest_subcluster, new_subcluster1, new_subcluster2)
File "/usr/lib/python2.7/dist-packages/sklearn/cluster/birch.py", line 170, in update_split_subclusters
self.init_centroids_[ind] = new_subcluster1.centroid_
AttributeError: '_CFSubcluster' object has no attribute 'centroid_'
Sadly I'm not able to reproduce this with an minimal example
By the looks of it, sklearn.preprocessing.maxabs_scale seems to resolve the issue. Please consider raising a more specific error for large values with high variances.
Activity
amueller commentedon Jan 15, 2016
Can you give us the data maybe?
Nordwald commentedon Jan 18, 2016
Hey there,
the complete dataset covers more than 200 GB of disk space. I noticed the error does even appear with extreme downsampling.
An example vector:
Here is the variance of the data:
As you can see, all values are float.
Nordwald commentedon Jan 18, 2016
By the looks of it, sklearn.preprocessing.maxabs_scale seems to resolve the issue. Please consider raising a more specific error for large values with high variances.
jnothman commentedon Jun 14, 2017
What's the objective of this issue now:
jnothman commentedon Jun 14, 2017
I don't see it as something that will be fixed for this release.
adrinjalali commentedon Oct 16, 2018
Do we have a working example for the error? I can't reproduce it:
FIX initialise centroid_ in all cases