Scale: Difference between revisions
imported>Jeremy No edit summary |
imported>Scott |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 6: | Line 6: | ||
:sx = scale(x,means,''stds,options'') | :sx = scale(x,means,''stds,options'') | ||
:sx = scale(x,means) | |||
===Description=== | ===Description=== | ||
Line 19: | Line 20: | ||
The optional input (options) is an options structure containing: | The optional input (options) is an options structure containing: | ||
* '''stdthreshold''': <tt>[0]</tt> scalar value or vector of standard deviation threshold values. If a standard deviation is below its corresponding threshold value, the threshold value will be used in lieu of the actual value. A scalar value is used as a threshold for all variables. | * '''stdthreshold''': <tt>[0]</tt> scalar value or vector of standard deviation threshold values. If a standard deviation is below its corresponding threshold value, the threshold value will be used in lieu of the actual value. A scalar value is used as a threshold for all variables. | ||
* '''samplemode''': <tt>[1]</tt> mode of x which should be considered the "sample" mode. Default is 1, rows. This is the mode over which the scaling and subtracting are done. | |||
===See Also=== | ===See Also=== | ||
[[auto]], [[gscaler]], [[medcn]], [[mncn]], [[npreprocess]], [[preprocess]], [[rescale]] | [[auto]], [[classcenter]], [[gloc]], [[gscale]], [[gscaler]], [[logdecay]], [[medcn]], [[mncn]], [[npreprocess]], [[preprocess]], [[rescale]] |
Latest revision as of 18:53, 8 June 2015
Purpose
Scales data using specified means and standard deviations.
Synopsis
- sx = scale(x,means,stds,options)
- sx = scale(x,means)
Description
sx = scale(x,means) subtracts a vector means from a matrix x and returns the result as sx. If means is the vector of means this routine mean centers x.
sx = scale(x,means,stds) subtracts a vector means from a matrix x, divides each column by the corresponding element in the vector stds and returns the result as sx. If means is the vector of means and stds is the vector of standard deviations this routine auto-scales x so that each column of sx has zero mean and unit variance.
The optional input (options) is defined below.
Options
The optional input (options) is an options structure containing:
- stdthreshold: [0] scalar value or vector of standard deviation threshold values. If a standard deviation is below its corresponding threshold value, the threshold value will be used in lieu of the actual value. A scalar value is used as a threshold for all variables.
- samplemode: [1] mode of x which should be considered the "sample" mode. Default is 1, rows. This is the mode over which the scaling and subtracting are done.
See Also
auto, classcenter, gloc, gscale, gscaler, logdecay, medcn, mncn, npreprocess, preprocess, rescale