Polytransform

From Eigenvector Research Documentation Wiki
Revision as of 12:39, 27 September 2010 by imported>Donal (→‎Optional Inputs)
Jump to navigation Jump to search

Purpose

Add new variables to a dataset object or matrix formed as power transforms and cross terms of the original variables.

Synopsis

[DSOout, model] = polytransform(x, options);

Description

Add polynomial and cross terms to data matrix or dataset. Input dataset x has new transformed variables added. These can include existing variables raised to second, third, fourth power, or second order product of variables. The data can be preprocessed before transformed variables are calculated. preprocessingtype option specifies the type of preprocessing to apply, 'none', 'mncn', 'auto', or 'custom'. If 'custom' is specified then the 'preprocessing' option must be a valid preprocessing structure. If pca = 'on' the data are converted to PCA scores after preprocessing, but before the transformed variables are calculated.

Inputs

  • x = Dataset or matrix to be augmented by the addition of transformed variables.

Options

options is a structure array with the following fields:

  • display: [ {'on'} | 'off' ], governs level of display,
  • plots: ['none' | 'final' | {'auto'} |], governs plotting behavior
    • 'auto' makes plots if no output is requested {default}
  • cost':' [], vector of logarithmic cost biases for each class in y, cost is used to bias against misclassification of a particular class or classes {default = [] uses all zeros i.e. equal cost}.
  • prior':' [], vector of prior probabilities of observing each class. If any class prior is Inf, the frequency of observation of that class in the calibration is used as its prior probability. If all priors are Inf, this has the effect of providing the fewest incorrect predictions assuming that the probability of observing a given class in future samples is similar to the frequency that class in the calibration set. {default = [] uses all ones i.e. equal priors.}

Examples

If y is a 5 by 100 matrix, x is a 1 by 100 vector, and xi is a 1 by 91 vector then:

polyinterp(x,y,xi,11,3,1)

gives the 5 by 91 matrix of first-derivative row vectors resulting from an 11-point cubic interpolation to the 91 points in xi.

See Also