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