-
Notifications
You must be signed in to change notification settings - Fork 147
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] Added R-Clustering clusterer to aeon #2382
base: main
Are you sure you want to change the base?
Conversation
Thank you for contributing to
|
hi, thanks for this but if we include this clusterer we want it to use our version of Rocket transformers which are optimised for numba |
sure, I will try to reimplement it and use aeon Rocket transformers |
…_branch # Conflicts: # aeon/clustering/_r_cluster.py
@chrisholder While reviewing the code, I identified an architectural issue. The R cluster implementation cannot have separate fit and predict methods because it relies on PCA for dimensionality reduction. For example, if PCA determines the optimal dimension during training to be 13, and we attempt to predict on test data with fewer than 13 dimensions, it results in an error. Even if we create a new PCA and apply fit_transform on the test data, we would need to retrain KMeans, which is what I did. However, I don't believe this is an optimal solution. Could you suggest a better approach to handle this scenario? |
PCA has a separate fit and transform step, so you can PCA fit_transform in fit, save the transform then just PCA transform in transform? |
If we transform test data(while predicting that is predicting this test data without fitting it using _predict method) with a number of features less than the n_components of PCA, it will cause an error, So we cannot predict test data having number of features less than that of n_components of PCA. |
Please respond to the reviews in text instead of just resolving them unless it is a simple change. Feel free to ask for clarification. There are still issues IMO.
Why would there be less features in predict? |
Considering the case where we train the clusterer on a large dataset but only need to make predictions on a smaller dataset with fewer features |
Bit confused on what you mean by fewer features. The algorithm explicitly does not allow unequal length series in the tags. Also, this appears to be done after the ROCKET transform, so I don't think it would have a different number of features either way? |
Yes, I was referring to the data after it has been transformed by ROCKET. If the number of features ends up being lower than PCA's n_component, it can cause some issues. I fixed it by training a new KMeans model, but do you have any suggestions for a better method?(It was one of error caused in testing,when I did not add this exception handling) |
ROCKET should not be producing a different amount of features. No fitting should be going on in predict here I feel. |
Removing the fitting step in the predict function,results in the following error: ValueError: n_components=9 must be between 0 and min(n_samples, n_features)=5 with svd_solver='full'(in testing as you can see below). I thought this could be resolved by fitting a new KMeans model. However, if you have a better approach, could you please share it |
Reference Issues/PRs
#2132
What does this implement/fix? Explain your changes.
added R clustering model for aeon
Does your contribution introduce a new dependency? If yes, which one?
no
Any other comments?
PR checklist
For all contributions
For new estimators and functions
__maintainer__
at the top of relevant files and want to be contacted regarding its maintenance. Unmaintained files may be removed. This is for the full file, and you should not add yourself if you are just making minor changes or do not want to help maintain its contents.For developers with write access