Skip to content

Instantly share code, notes, and snippets.

@danielhfrank
Last active December 14, 2015 01:49
Show Gist options
  • Save danielhfrank/5008920 to your computer and use it in GitHub Desktop.
Save danielhfrank/5008920 to your computer and use it in GitHub Desktop.
Scale to unit interval. Screw the mean and variance
class UnitIntervalScaler(object):
def fit(self, xs):
self._floor = np.min(xs)
self._range = np.max(xs) - self._floor
return self
def transform(self, x):
return (x - self._floor) / self._range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment