quick look at machine learning this is common problemwhich is often addressed by scaling the features so that each feature has mean of and standard deviation of as done by the function scalefeatures in figure def scalefeatures(vals)"""assumes vals is sequence of numbers""result pylab array(valsmean sum(result)/float(len(result)result result mean sd stddev(resultresult result/sd return result figure scaling attributes to see the effect of scalefeatureslet' look at the code below [][for in range( ) append(random gauss( ) append(random gauss( ) scalefeatures( scalefeatures( print ' mean ='round(sum( )/len( ) ),' standard deviation'round(stddev( ) print ' mean ='round(sum( )/len( ) ),' standard deviation'round(stddev( ) the code generates two normal distributions with different means ( and and different standard deviations ( and it then scales each and prints the means and standard deviations of the results when runit prints mean - standard deviation mean standard deviation it' easy to see why the statement result result mean ensures that the mean of the returned array will always be close to that the standard deviation will always be is not obvious it can be shown by long and tedious chain of algebraic manipulationswhich we will not bore you with figure contains version of readmammaldata that allows scaling of features the new version of the function testteeth in the same figure shows the result of clustering with and without scaling normal distribution with mean of and standard deviation of is called standard normal distribution we say "close,because floating point numbers are only an approximation to the reals and the result will not always be exactly