Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

mapminmax mechanism in Neural Network

505 views
Skip to first unread message

Hayrettin Okut

unread,
Nov 8, 2010, 5:42:03 PM11/8/10
to
Hi all;

Does some knows what MATLAB does exacly (whis formula is used) for function mapminmax to scales the inputs and targets so that they fall in the range [-1,1].

Regards

Hoda abuzied

unread,
Dec 4, 2010, 8:48:04 AM12/4/10
to
"Hayrettin Okut" <fi...@mathworks.com> wrote in message <ib9ubr$n7s$1...@fred.mathworks.com>...

> Hi all;
>
> Does some knows what MATLAB does exacly (whis formula is used) for function mapminmax to scales the inputs and targets so that they fall in the range [-1,1].
>
> Regards

hey Hayrettin;
matlab uses the following algorithm to scale inputs & targets to fall in a certain range :
y = (ymax-ymin)*(x-xmin)/(xmax-xmin) + ymin;
where :
ymax= max. value of specified range in this case = 1 ( which is default for mapminmax command)
ymin= min. value of specified range in this case=-1 ( also default value)
x= value to be scaled.
xmax= max. value of numbers to be scaled
xmin= min. value of numbers to be scaled
N.B.:
if u wanted to scale your data so that they would fall in another range such as [0,0.9] instead of [-1,1], dont use mapminmax command instead use it's mathematical form to scale data manually & set value of ymax = 0.9 & ymin=0.1 & so on.

Hope this was helpful

wonderboy

unread,
Oct 4, 2011, 12:32:27 PM10/4/11
to
mapminmax does the calculation on each row of the matrix, as long as the inputs of NN are the same type along the rows. so the xmax and xmin should be calculated separated for each row:
use e.g.: xmax = max(x,[],2)
just remember, if a row of x is completely zero (xmax = xmin = 0), the divisoin by zero occurs and MATLAB calculates the result to inf. (you could use 'removeconstant' option of processFCN of the NN to remove constant rows)
0 new messages