Poly: Polynomial Basis

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Poly() is a utility function for polynomial transform.

Usage

1
Poly(x, degree = 1, interaction_only = TRUE, include_bias = TRUE)

Arguments

x

a data matrix, where rows are observations and columns are dimensions.

degree

degree of polynomial.

interaction_only

if TRUE, only interactions (products of distinct features) are produced.

include_bias

if TRUE, include a column of ones

Value

transformed matrix

Examples

1
2
x <- cbind(c(0, 1, 0, 1), 1 : 4)
Poly(x, degree = 2)

XiaoqiLu/PhD-Thesis documentation built on March 1, 2021, 10:49 a.m.