-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
ENH Adding callable function option to bicluster method #29196
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
base: main
Are you sure you want to change the base?
Conversation
Could you provide some literature where other normalization are used to assess if we should include the feature or not. I think that the test would be enough. We will need an entry in the changelog file |
Method of normalizing and converting singular vectors into | ||
biclusters. May be one of 'scale', 'bistochastic', or 'log'. | ||
The authors recommend using 'log'. If the data is sparse, | ||
however, log normalization will not work, which is why the | ||
default is 'bistochastic'. | ||
Callable must take a 2D array and return a 2D array. | ||
|
||
.. warning:: | ||
if `method='log'`, the data must not be sparse. |
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.
if `method='log'`, the data must not be sparse. | |
if `method='log'`, the data must not be sparse. | |
.. versionadded:: 1.6 | |
The support for passing a callable was added. |
if self.method == "bistochastic": | ||
if callable(self.method): | ||
normalized_data = self.method(X) | ||
n_sv += 1 |
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.
If someone add a log
based normalization then this would be incorrect, isn't it?
What does this implement/fix? Explain your changes.
This PR adds the option to provide your own custom callable to the SpectralBiclustering class
Any other comments?
The current implementation is constrained to a few normalizations from the original work; other normalizations could be helpful to others.