Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def cluster_centroids_(self):
if hasattr(self, '_enc_cluster_centroids'):
return decode_centroids(self._enc_cluster_centroids, self._enc_map)
else:
raise AttributeError("'{}' object has no attribute 'cluster_centroids_' "
"because the model is not yet fitted.")
def cluster_centroids_(self):
if hasattr(self, '_enc_cluster_centroids'):
return [
self._enc_cluster_centroids[0],
decode_centroids(self._enc_cluster_centroids[1], self._enc_map)
]
else:
raise AttributeError("'{}' object has no attribute 'cluster_centroids_' "
"because the model is not yet fitted.")