monotonic_inc#
- pygam.penalties.monotonic_inc(n, coef)[source]#
Builds a penalty matrix for P-Splines with continuous features. Penalizes violation of a monotonic increasing feature function.
- Parameters:
- nint
number of splines
- coefarray-like, coefficients of the feature function
- Returns:
- penalty matrixsparse csc matrix of shape (n,n)