Skip to content
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

Added smooth and non-smooth prediction functions with tests and comments #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ClaudioZeni
Copy link
Collaborator

Proposed changes

Added two predict functions to Clustering class.
One follows the Density Peaks criteria and assigns cluster labels based on the label of the closest neighbour of higher density.
Such density can be computed using PAk or kstarNN. This function predicts only labels and assigns probabilities that are always 1 or 0.
The second function employs a smoothed majority rule to assign labels and label probabilities.
Points in the kstar neighbourhood are weighted according to a normalized inverse square distance from the out-of-set point.
Label is then predicted according to weighted majority rule, and probabilities are given by the weighted population of each label.

Types of changes

[New Feature] Allows using Clustering to predict the labels and probability of each label for out-of-set points.

Checklist

  • [ x ] Lint and unit tests pass locally with my changes
  • [ x ] I have added tests that prove my fix is effective or that my feature works

@ClaudioZeni ClaudioZeni added the enhancement New feature or request label May 24, 2022
@ClaudioZeni ClaudioZeni linked an issue May 24, 2022 that may be closed by this pull request
@AldoGl AldoGl force-pushed the feature_predict_clustering branch from 356962e to 138ecc9 Compare June 29, 2022 15:05
@imacocco
Copy link
Collaborator

imacocco commented Jul 6, 2022

I think this PR can be accepted and merged. Is there some more work to do maybe?

@AldoGl
Copy link
Collaborator

AldoGl commented Jul 7, 2022

One small problem is that "density_est" does not appear in the docstring.

On the algorithm I think also @alexdepremia could give his opinion

@ClaudioZeni
Copy link
Collaborator Author

ClaudioZeni commented Oct 11, 2022 via email

@alexdepremia
Copy link
Collaborator

Hi, sorry for the late reply. I think it can be merged, but we should clearly state that it is an experimental feature (it has not been published).

@AldoGl AldoGl force-pushed the main branch 12 times, most recently from a70caa7 to 685e691 Compare December 27, 2022 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Predict function for clustering
4 participants