Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
Loading
from

Conversation

JoOkuma
Copy link

@JoOkuma JoOkuma commented Jun 5, 2024

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.

Copy link

github-actions bot commented Jun 5, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 5208a80. Link to the linter CI: here

@glemaitre
Copy link
Member

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 doc/whats_new/v1.6.rst to reflect the change.

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Member

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?

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.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.