polyfeaturestransform

Generate polynomial features for test data.

Syntax

X_poly = polyfeaturestransform(parameters,X)

Inputs

X
Input data for which polynomial features are going to be generated.
Type: double
Dimension: matrix
parameters
Struct containing degree used by polyFeatures function.
Type: double | integer
Dimension: struct

Outputs

X_poly
Polynomial features of input.
Type: integer
Dimension: vector | matrix

Example

Usage of polyfeaturestransform

X = [0 1;
     2 3;
     4 5];
X_test = [1 5];	 
[X_poly, parameters] = polyfeatures(X, 3);
X_test_poly = polyfeaturestransform(parameters, X_test)
> X_test_poly
X_test_poly = [Matrix] 1 x 9
1 5 1 5 25 1 5 25 125