Minmax: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Lyle
No edit summary
imported>Donal
No edit summary
 
Line 1: Line 1:
===Purpose===
===Purpose===


Min-Max scaling
Scale rows or columns of a matrix to range from 0 to 1.


===Synopsis===
===Synopsis===


:[xcorr,mins,maxs] = minmax(x,''options'');       %perform min-max scaling
:[xcorr,mins,maxs] = minmax(x,''options'');


===Description===
===Description===


Scales rows (or columns) of the input <tt>x</tt> to be have a minima of 0 and a maxima of 1.
Scales rows (or columns) of a matrix (x) so each row (or column) has a minimum of 0 and a maximum of 1.  The option "mode" specifies whether rows or columns are scaled to have unity range. Optional input (options) is described below.


====Inputs====
===Inputs===


* '''x''' = ''M'' by ''N'' matrix of data to be scaled (class "double" or "dataset").
* '''x''' = ''M'' by ''N'' matrix of data to be scaled (class "double" or "dataset").


====Optional Inputs====
===Options===
 
* '''options''' = Options structure. See details below.


''options'' =  a structure array with the following fields:
''options'' =  a structure array with the following fields:


* '''mode''': [ 1 ] dimension of data on which to calculate the minima and maxima for scaling. 1 = over rows (to scale variables); 2 = over columns (to scale samples). Default is 1.
* '''mode''': [ 1 ] dimension of data on which to calculate the minima and maxima for scaling. 1 = over rows (each row will have range [0,1]); 2 = over columns (each column will have range [0,1]). Default is 1.


====Outputs====
===Outputs===


* '''xcorr''' = the scaled data (xcorr will be the same class as x)
* '''xcorr''' = the scaled data (xcorr will be the same class as x)

Latest revision as of 15:33, 20 November 2018

Purpose

Scale rows or columns of a matrix to range from 0 to 1.

Synopsis

[xcorr,mins,maxs] = minmax(x,options);

Description

Scales rows (or columns) of a matrix (x) so each row (or column) has a minimum of 0 and a maximum of 1. The option "mode" specifies whether rows or columns are scaled to have unity range. Optional input (options) is described below.

Inputs

  • x = M by N matrix of data to be scaled (class "double" or "dataset").

Options

options = a structure array with the following fields:

  • mode: [ 1 ] dimension of data on which to calculate the minima and maxima for scaling. 1 = over rows (each row will have range [0,1]); 2 = over columns (each column will have range [0,1]). Default is 1.

Outputs

  • xcorr = the scaled data (xcorr will be the same class as x)
  • mins = vector of minima for each row (or column)
  • maxs = vector of maxima for each row (or column)


See Also

normaliz, preprocess, snv