preprocessing.PolynomialFeatures
Usage
import { PolynomialFeatures } from 'machinelearn/preprocessing';
const poly = new PolynomialFeatures();
const X = [[0, 1], [2, 3], [4, 5]];
poly.transform(X);
// Result:
// [ [ 1, 0, 1, 0, 0, 1 ],
// [ 1, 2, 3, 4, 6, 9 ],
// [ 1, 4, 5, 16, 20, 25 ] ]
Constructors
Methods
Constructors
constructor
⊕ PolynomialFeatures(degree: `object`)
Defined in preprocessing/data.ts:609
Parameters:
Param | Type | Default | Description |
---|---|---|---|
options.degree | number | 2 |
Returns: PolynomialFeatures
Methods
λ transform
Transforms the input data
Defined in preprocessing/data.ts:629
Parameters:
Param | Type | Default | Description |
---|---|---|---|
X | number[][] | null | a matrix |
Returns:
number[][]