in reply to number normalization
You want to produce a linear function mapping the minimum value in a list to 1 and the maximum in the list to 3. List::Util provides min() and max() functions. The coefficient of the linear term will be $m = (3 - 1)/(max(@list)-min(@list)), and the constant term will be $c = 1 - $m * min(@list). The map builtin will be handy to then apply that to the file data in @list.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: number normalization
by Anonymous Monk on Aug 10, 2003 at 04:01 UTC | |
by fglock (Vicar) on Aug 10, 2003 at 12:27 UTC | |
by Anonymous Monk on Aug 10, 2003 at 13:30 UTC |