AttributeError: 'clusteval' object has no attribute 'results'... DUP of closed issue #5?
junefeld opened this issue · 2 comments
junefeld commented
I've tried versions from 2.0.0 to beta, all resulting in the same issue as described in Issue 5.
I'm on the latest HDBSCAN version of 0.8.27, and the beta version of Clusteval...
My array is as follows:
umap_rs_embed[:10]
array([[-0.16568227, 2.3830128 , 0.9952151 ],
[-0.16470274, 0.91874045, 1.6843276 ],
[-0.10057875, 1.0044663 , 4.231984 ],
[ 7.218489 , 3.189865 , 1.6015646 ],
[ 1.7666751 , 2.4235313 , 1.2277056 ],
[-0.02537769, 1.1624466 , 4.175513 ],
[ 1.4869809 , -0.8690608 , 2.6568232 ],
[-0.05031788, -0.30832335, 0.93605393],
[ 1.2532264 , 1.6826892 , 0.4620979 ],
[ 1.3145269 , 1.3296161 , 3.9630399 ]], dtype=float32)
And the result of fitting is:
# Import library
from clusteval import clusteval
import hdbscan
# Set the method
ce = clusteval(method='hdbscan')
# Evaluate
results = ce.fit(umap_rs_embed)
AttributeError Traceback (most recent call last)
<ipython-input-6-68904b3307b8> in <module>
5 ce = clusteval(method='hdbscan')
6 # Evaluate
----> 7 results = ce.fit(umap_rs_embed)
~\Desktop\scripting\apps\trajectory\lib\site-packages\clusteval\clusteval.py in fit(self, X)
170
171 # Compute the dendrogram threshold
--> 172 if (self.cluster!='kmeans') and (self.results['labx'] is not None) and (len(np.unique(self.results['labx']))>1):
173 # print(self.results['labx'])
174 max_d, max_d_lower, max_d_upper = _compute_dendrogram_threshold(self.Z, self.results['labx'], verbose=self.verbose)
AttributeError: 'clusteval' object has no attribute 'results'
erdogant commented
Thank you for reporting!
I made a fix. Can you check whether it works for you again?
pip install -U clusteval
import clusteval
print(clusteval.__version__)
Version should be >= 2.0.4
erdogant commented
I also noticed a small typo in your input arguments.
method='hdbscan' should be cluster='hdbscan'
# Import library
from clusteval import clusteval
import hdbscan
# Set the method
ce = clusteval(cluster='hdbscan')
# Evaluate
results = ce.fit(umap_rs_embed)