sparselm.tools#
A variety of tools for fitting linear regression models to polish CE.
- sparselm.tools.constrain_coefficients(indices, high=None, low=None)[source]#
Constrain a fit method to keep coefficients within a specified range.
Use this as a standard decorator with parameters: - At runtime:
coefs = constrain_coefficients(indices, high, low)(fit_method)(X, y)
- In fit_method definitions:
@constrain_coefficients(indices, high, low) def your_fit_method(X, y):