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

Initial commit for implementation of Affinity Propagation #28

Merged
merged 13 commits into from
Dec 10, 2024

Conversation

Yuan-Ru-Lin
Copy link
Contributor

Implement interface of Affinity Propagation to MLJ. The implementation mimics that of KMedoids and directly uses the existing MMI.predict

@ablaom
Copy link
Member

ablaom commented Nov 28, 2024

@Yuan-Ru-Lin I see this is a draft. Please go ahead and ping me when you are ready for a review. No hurry.

@Yuan-Ru-Lin Yuan-Ru-Lin marked this pull request as ready for review December 3, 2024 02:06
@Yuan-Ru-Lin
Copy link
Contributor Author

The code is ready to be reviewed. I basically just made the model Static, turned MMI.transform and MMI.fit into MMI.predict and added doc.

Two dependencies are added: LinearAlgebra and StatsBase for we need diagind, triu! and median to fill the diagonal part of the similarity matrix with the median similarity of all pairs. I am not familiar with handling compat so it may need your attention there.

Oh I should mention that I use GLMakie in the doc since it makes visualization easier. I'm not sure where I should add that as a dependency.

@Yuan-Ru-Lin
Copy link
Contributor Author

@ablaom Forgot to ping you!

Copy link

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 16 lines in your changes missing coverage. Please review.

Project coverage is 79.34%. Comparing base (3d8548b) to head (7d0453c).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/MLJClusteringInterface.jl 0.00% 16 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master      #28       +/-   ##
===========================================
- Coverage   96.10%   79.34%   -16.76%     
===========================================
  Files           1        1               
  Lines          77       92       +15     
===========================================
- Hits           74       73        -1     
- Misses          3       19       +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Project.toml Outdated Show resolved Hide resolved
@ablaom
Copy link
Member

ablaom commented Dec 5, 2024

@Yuan-Ru-Lin This is looking great. Thanks for taking the time to wrap your head around the MLJ API and the docstring requirements.

Can you add some basic test that include:

  • check the report contains what you think it does
  • generic interface test (just add AffinityPropagation here.
  • test that the preference=nothing fallback has expected behaviour.

You can bump Julia support in the Project to 1.10 (hopefully fixes your fail) and, if you know how, do the same bump in .github/workflows/ci.yaml - otherwise I can do it.

@Yuan-Ru-Lin
Copy link
Contributor Author

Hi @ablaom, I have

  • added tests for the model
  • bumped supported Julia version from 1.6 to 1.10 in both Project.toml and ci.yml
  • edit docs as you suggested.

@Yuan-Ru-Lin
Copy link
Contributor Author

Yuan-Ru-Lin commented Dec 9, 2024

@ablaom Morning from PST! The PR is ready to be reviewed again.

Copy link
Member

@ablaom ablaom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @Yuan-Ru-Lin for this valuable contribution.

@ablaom ablaom merged commit 4e3c06f into JuliaAI:master Dec 10, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants