Skip to content

Instantly share code, notes, and snippets.

@ntakouris
Created July 8, 2020 09:09
Show Gist options
  • Save ntakouris/91f58c0b4bad6e7e45540fa04e318017 to your computer and use it in GitHub Desktop.
Save ntakouris/91f58c0b4bad6e7e45540fa04e318017 to your computer and use it in GitHub Desktop.
import numpy as np
# 'Raw Data'
ds = np.array([[3, 5, 7, 10],
[12, 14, 16, 21]])
# pass 1 - calculate mean
mean, std = np.mean(ds), np.std(ds)
# pass 2 - normalise
ds_for_train = (ds - mean) / std
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment