def minmax_normalize(X, low, high, minX=None, maxX=None, dtype=np.float):
 if (minX is None):
  minX = np.min(X)
 if (maxX is None):
  maxX = np.max(X)
 minX = float(minX)
 maxX = float(maxX)
 X = (X - minX)
 X = (X / (maxX - minX))
 X = (X * (high - low))
 X = (X + low)
 return np.asarray(X, dtype=dtype)

def minmax_normalize ( X , low , high , minX = None , maxX = None , dtype = np . float ) : if ( minX is None ) : minX = np . min ( X ) if ( maxX is None ) : maxX = np . max ( X ) minX = float ( minX ) maxX = float ( maxX ) X = ( X - minX ) X = ( X / ( maxX - minX ) ) X = ( X * ( high - low ) ) X = ( X + low ) return np . asarray ( X , dtype = dtype )
min-max normalize a given matrix to given range [low .