Internal function for making non-linear features.
makef(x, r, df, tol = 0.01, removeLin = T)
Input matrix, of dimension nobs x nvars
; each row is
an observation vector.
Vector of residuals.
Degrees of freedom for the fit.
A tolerance for same-ness or uniqueness of the x values. To be
passed to the smooth.spline()
function. Default is 0.01
.
If TRUE
(default), removes the linear component from
the newly created non-linear features.
A list:
Non-linear features associated with the features in x
.
A list of the spline fits of the residual against each feature. Useful for creating the non-linear features for new data.
If removeLin = TRUE
, a list of coefficients for
simple linear regression of non-linear feature on original feature. Useful
for creating the non-linear features for new data.