def normalizeFeatures(features):
 X = numpy.array([])
 for (count, f) in enumerate(features):
  if (f.shape[0] > 0):
   if (count == 0):
    X = f
   else:
    X = numpy.vstack((X, f))
   count += 1
 MEAN = numpy.mean(X, axis=0)
 STD = numpy.std(X, axis=0)
 featuresNorm = []
 for f in features:
  ft = f.copy()
  for nSamples in range(f.shape[0]):
   ft[nSamples, :] = ((ft[nSamples, :] - MEAN) / STD)
  featuresNorm.append(ft)
 return (featuresNorm, MEAN, STD)

def normalizeFeatures ( features ) : X = numpy . array ( [ ] ) for ( count , f ) in enumerate ( features ) : if ( f . shape [ 0 ] > 0 ) : if ( count == 0 ) : X = f else : X = numpy . vstack ( ( X , f ) ) count += 1 MEAN = numpy . mean ( X , axis = 0 ) STD = numpy . std ( X , axis = 0 ) featuresNorm = [ ] for f in features : ft = f . copy ( ) for nSamples in range ( f . shape [ 0 ] ) : ft [ nSamples , : ] = ( ( ft [ nSamples , : ] - MEAN ) / STD ) featuresNorm . append ( ft ) return ( featuresNorm , MEAN , STD )
this function normalizes a feature set to 0-mean and 1-std .