Repository navigation
(s)kmean setMeans is now setting the number of clusters right #349
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
Open
tremblap
wants to merge
9
commits into
flucoma:main
Choose a base branch
from
tremblap:fix/setting-centroids
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
969e003
(s)kmean setMeans is now setting the number of clusters right
tremblap e9a6058
Update include/flucoma/algorithms/public/KMeans.hpp
tremblap 7dc95d6
updates the client's parameters as requested
tremblap 78b7b7f
Merge branch 'main' into fix/setting-centroids
tremblap 62204cd
fixed the client-side numclusters when setMeans, load and read
tremblap e524971
now for skmeans
tremblap d0f9a96
Normalise loads/reads right
tremblap 13567dd
RobustScale read/load rightly to the client
tremblap eff696f
UMAP now loads/reads dims to client
tremblap File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably the
numClustersparameter can now be incorrect aftersetMeans. So this method actually needs to update the params and return these.Something like (untested)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ParamValueswill need to be defined near the top of the class, like in the MLP objects:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is interesting, as the current public code does not behave the way I thought it would - changing the numCluster should always reset the algo to unFitted, but it currently doesn't.
could we fix that the same way? In effect, the expected behaviour for me:
should i just put a separate bug report and a fix for that? Or am I just all confused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
studying MLP code, I can see that the clients check if (!mAlgorithm.trained()) return Error(NoDataFitted); but i cannot find how it makes it 'untrained' when any parameter (like network structure) is changed. mTracker is only checked once in fit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an example of the misunderstood behaviour by yours truly:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loadandreadhave absolutely horrible special case handling in the host wrappers that happens to deal with updating the parameters. There's not any machinery for ad hoc messages that would return updated parameters (likesetMeans).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I say it works, I mean that I have a debugger with the process and I go line for line, I see in all cases the mAlgo being changed, and the
newParamstoo. the only diff is in the 'updated' client - one updates, the other not.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It will 'work', but only up to the point where the host needs to actually store the updated parameters, which it won't do without a new overload being added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok so should I put a bug report for load/read not working for kmeans, or will sorting this PR sort the other case too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loadandreadnot working is its own issue, though I suspect it's because the default implementation for data clients doesn't return updated parameters (MLP overrides the default).