-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENH] Sort out clustering base class #2251
base: main
Are you sure you want to change the base?
Conversation
Thank you for contributing to
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hadifawaz1999 is this the one you wanted delayed?
Approving for if thats fine. Left some comments.
if hasattr(self, "n_clusters"): | ||
n_clusters = self.n_clusters | ||
else: | ||
n_clusters = len(np.unique(preds)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this could be risky down the line if there are non-int methods of generating n_clusters
, but no solution for now other than always using unique
.
@@ -173,10 +173,10 @@ def __init__( | |||
self.save_last_model = save_last_model | |||
self.best_file_name = best_file_name | |||
self.random_state = random_state | |||
self.n_clusters = n_clusters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can keep this for now, but I think @hadifawaz1999 said these would be better removed (n_clusters
should be input with estimator
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it should not be added as we're gonna remove it in a few days
if hasattr(self, "labels_"): | ||
return self.labels_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, everything should have this.
no the one am delaying is Chris's pr of deprecation, but the additions here to deep clustering i think should not be made @TonyBagnall as they're gonna be removed with the purging in a few days once all Aadya's prs are in |
could also do this at the same time @chrisholder ? |
Fixes #1530