Skip to content

Conversation

@cajchristian
Copy link
Collaborator

@cajchristian cajchristian commented Sep 18, 2025

In some instances of using PCovC, the latent space will "converge" very quickly with changing alpha. This happens because Z is not necessarily O(1) when computed within the fit call. This PR solves this by adding an argument to have a StandardFlexibleScaler call within fit that scales Z and W. This will break backwards compatibility but can be made backwards compatible by using scale_z=False.

Contributor (creator of PR) checklist

  • Tests updated (for new features and bugfixes)?
  • Documentation updated (for new features)?
  • Issue referenced (for PRs that solve an issue)?

For Reviewer

  • CHANGELOG updated if important change?

📚 Documentation preview 📚: https://scikit-matter--270.org.readthedocs.build/en/270/

@cajchristian cajchristian changed the title Fix pcovc scaling Fixing pcovc scaling Sep 18, 2025
rosecers
rosecers previously approved these changes Sep 19, 2025
@rosecers rosecers self-requested a review September 19, 2025 00:51
@rosecers rosecers dismissed their stale review September 19, 2025 00:51

Did not see tests were failing, please check!

@PicoCentauri
Copy link
Collaborator

Yes I check the failures in a different PR

@cajchristian
Copy link
Collaborator Author

Forgot to fix doctests, whoops! Everything should be good now.

Copy link
Collaborator

@rosecers rosecers left a comment

Choose a reason for hiding this comment

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

Looks good! I like the default behavior being a warning versus automatic scaling.

@cajchristian cajchristian merged commit 1c2af45 into main Sep 24, 2025
10 checks passed
@cajchristian cajchristian deleted the fix_pcovc_scaling branch September 24, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants