Skip to content

SAM-kNN Classifier#1685

Open
jvaquet wants to merge 14 commits intoonline-ml:mainfrom
jvaquet:main
Open

SAM-kNN Classifier#1685
jvaquet wants to merge 14 commits intoonline-ml:mainfrom
jvaquet:main

Conversation

@jvaquet
Copy link
Copy Markdown

@jvaquet jvaquet commented May 16, 2025

Hey there,
I got in touch (#1677) a month ago about implementing the SAM-kNN Classifier for river. I think the implementation is pretty much ready, let me know what you think!

A couple remarks:

  • In order to pass the tests, I disabled check_emerging_features, check_disappearing_features and check_radically_disappearing_features in 05d2ea2/ 96a5618 as the classifier only works with a consistent feature set. Is this the intended way to go about this or did I miss something?
  • Currently the classifier only works for real-valued features. I would like to try adding categorical feature support by adding an option to select the LTM compression method between kmeans and kmodes. kmeans is the currently used default method and uses the sklearn implementation. kmodes would be another library that is not a dependency of river. Can this be implemented using a conditional import only when the option is selected? What is the project's policy on that?

Thanks everyone!

@jsvobo
Copy link
Copy Markdown
Contributor

jsvobo commented Mar 29, 2026

hello, I recently completed a PR regarding a non existent function inherited from past code in KNN engines, which throws errors if class list is refreshed.

It is solved and added in unreleased. PR #1756 issue #1755. I didnt check your whole code, so i am just posting it here, so you can check it out. your changes might need to be ported on top of mine:

  • changed class cleanup
  • added a function to engines and base, that returns relevant targets in the window

you might need to override the function refresh_targets in new engines if you've created one based on the base engine. I dont know your part, just suggesting. Better to have the classifiers have the same interface, and the engines too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants