Addition of the function cleaning_cluster_population#149
Addition of the function cleaning_cluster_population#149ChiaraLionello wants to merge 18 commits intoGMPavanLab:mainfrom
Conversation
| NumPy array containing the label values. | ||
| The array should have dimensions corresponding | ||
| to either (n_atoms, n_frames) for 2D inputs, | ||
| or (n_atoms, n_frames, n_dims) for 3D inputs. |
There was a problem hiding this comment.
These are the labels, not the data... aren't they always a 2D array? Each atom at each frame has one integer label, even if the data were multivariate.
There was a problem hiding this comment.
For the same reason, I think all the logic in the function for the 3D case is never necessary.
There was a problem hiding this comment.
I think it depends how we do want to use this function. I've thought different applications:
- 2D labels: cleaning the labels to color the trajectory
- 2D labels: can come also from other clustering methods, not necessarily from onion, and can be used as above
- 3D labels: come from get_onion_analysis and can be use to redo the plot with the number of clusters and the unclassified fraction cleaned. By keeping this function out from get_onion_analysis you are free to change the threshold how many times you want without running the Onion calculation multiple times. In this case, I should also think a way to do that plot again. On the other hand, it's true that's enough to keep only the 2D option and then run it in a for cicle when we need it.
There's no problem for me to delete it in case; since it wasn't difficult to do I've added both the options.
| array is 2D (n_atoms, n_frames), the output will be a 2D array of | ||
| the same shape. Otherwise, if the input is 3D | ||
| (n_atoms, n_frames, n_dims), the output will also be a 3D array | ||
| of the same shape. |
There was a problem hiding this comment.
Same as before, labels are always 2D.
SimoneMartino98
left a comment
There was a problem hiding this comment.
Just two easy comments. I’ll leave the discussion on the label dimensions to @matteobecchi.
Anyway, nice work!
|
I've done everything that Simone asked. |
I have created the function the works for 2D and 3D labels' arrays. It cleans the clusters with low population.
Solved #136