-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add clustering to provide low tile detalization #86
base: main
Are you sure you want to change the base?
Conversation
Looks very nice! 1] Testing without clustering: https://bertt.github.io/clustering/demo/nocluster/ 2] Testing with clustering enabled: https://bertt.github.io/clustering/demo/clustered/ Some general remarks (I still have to look at the code):
From: "refine": "ADD" To "refine": "REPLACE" So in theory the clustered tiles should disappear when zooming in (and not add the clustered points to the instances)... Some more testing needed here. |
Hello @bertt I'll try to take into account all your notes step by step. Starting with Accord.MachineLearning dependency: I tried the following:
This is my first expierience in c# (mainly I am the python programmer), and I am not familiar with machine learning frameworks ecosystem in c#. The only alternative I could find is agglomerative clustering framework: https://github.com/pedrodbs/Aglomera. It's not in read-only state, but last commit was 5 years ago, which is also a bit frustrating. Should I try Aglomera instead of Accord.MachineLearning? Or maybe you could recommend other suitable frameworks, implementing either MiniBatchKmeans or Agglomerative clustering? |
No for now we can keep Accord.MachineLearning, if in the future a better solution pops up we can consider a switch |
Hello @bertt, Could you please clarify how exactly my tests should be implemented? Link to the examples, if any, would be of great help. |
For unit testing the clustering function something like: https://github.com/bertt/Accord.MachineLearning.Demo/blob/main/src/Accord.MachineLearning.Demo/Accord.MachineLearning.Demo.TestProject/UnitTest1.cs#L7 For the integration test maybe you can add sample data to create_testdata.sql? I think the data of the small dataset with the blocks in issue #85 is sufficient |
Thanks for unit test, I appended it to the project. I also appended sql script to create and populate test table and updated README.md. I don't know, should I change refine strategy depending on clustering usage in the code? Or some extra tests are needed here before doing something? |
looks quite complete like this :-) About the Refine method, I think I'll add another parameter so users can set the method (add/replace - default add). |
New optional paramater is added,
use_clustering
. By default it's false, and tiles with number of instances greater thanmax_features_per_tile
aren't rendered - as before. Whenuse_clustering
is true, tiles with number of instances greater thanmax_features_per_tile
are generated with exactlymax_features_per_tile
instances, obtained in the following way:max_features_per_tile
. MiniBatchKMeans algorithm is used to perform clustering;Related to #85