makef: Make non-linear features

Description Usage Arguments Value

View source: R/makef.R

Description

Internal function for making non-linear features.

Usage

1
makef(x, r, df, tol = 0.01, removeLin = T)

Arguments

x

Input matrix, of dimension nobs x nvars; each row is an observation vector.

r

Vector of residuals.

df

Degrees of freedom for the fit.

tol

A tolerance for same-ness or uniqueness of the x values. To be passed to the smooth.spline() function. Default is 0.01.

removeLin

If TRUE (default), removes the linear component from the newly created non-linear features.

Value

A list:

f

Non-linear features associated with the features in x.

spline_fit

A list of the spline fits of the residual against each feature. Useful for creating the non-linear features for new data.

lin_comp_fit

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.


relgam documentation built on Jan. 13, 2020, 5:06 p.m.