Implement quadratic regularization for TRF (Issue #16)#20
Open
Hugo-W wants to merge 1 commit into
Open
Conversation
- Add support for quadratic regularization matrix M in solvers.py - Add create_laplacian_matrix() and create_quadratic_regularizer() helper functions - Update TRFEstimator to accept quadratic_reg parameter (None, matrix, or 'smoothness'/'laplacian') - Add standardized coefficients computation (standardized_coef_ attribute) - Pass M matrix through to _svd_regress() in both fit() and _fitlists() - Minimal implementation with block-diagonal Laplacian for per-feature smoothness constraints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements quadratic regularization for TRF estimation as described in Issue #16.
Changes Made
solvers.py
svd_solver()support for quadratic regularization matrixM(solves (A+M)x = b using eigendecomposition)create_laplacian_matrix()helper function for smoothness constraintscreate_quadratic_regularizer()factory function_svd_regress()to accept and passMparametermodels.py
quadratic_regparameter toTRFEstimator.__init__()(accepts None, numpy array, or string 'smoothness'/'laplacian')fit()and_fitlists()to build and passMmatrix to_svd_regress()standardized_coef_attribute with standardized beta coefficientsUsage Example
Testing
Related Issues
Closes #16