Skip to content

Add coefficient extraction and variance-ratio controls to MorphologicalDeviationSc#2525

Merged
akenmorris merged 1 commit intomasterfrom
pca_loadings_for_morphodev
Mar 26, 2026
Merged

Add coefficient extraction and variance-ratio controls to MorphologicalDeviationSc#2525
akenmorris merged 1 commit intomasterfrom
pca_loadings_for_morphodev

Conversation

@nawazishkhan1-nk
Copy link
Copy Markdown
Contributor

Summary

This PR extends MorphologicalDeviationScore with coefficient access and exposes the functionality thru Python.

Changes Made

  • Added GetPCACoefficients(const Eigen::MatrixXd& X) to project samples onto the fitted PCA basis and return the coefficient matrix.

  • Added public retained-variance controls, to better allow manual variance control in MophoDevScoring:

    • SetRetainedVarianceRatio(double ratio)
    • GetRetainedVarianceRatio() const
  • Added Python bindings for:

    • GetPCACoefficients
    • SetRetainedVarianceRatio
    • GetRetainedVarianceRatio
  • Testing

    • Python binding tested manually by importing the module and calling the new methods on test set.
    • No new automated tests added.

Copy link
Copy Markdown
Contributor

@akenmorris akenmorris 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!

@akenmorris akenmorris merged commit 28bfe2d into master Mar 26, 2026
5 checks passed
@akenmorris akenmorris deleted the pca_loadings_for_morphodev branch March 26, 2026 15:00
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