LoginSignup
0

More than 5 years have passed since last update.

posted at

Normalization

Z = np.random.random((5,5))
Zmax, Zmin = Z.max(), Z.min()
Z = (Z - Zmin)/(Zmax - Zmin)
print(Z)
  • example
[[ 0.51739995  0.97920593  0.4546323   0.27452645  0.54283133]
 [ 0.99287368  0.12152634  0.          0.46321662  0.56030387]
 [ 1.          0.74512612  0.14699695  0.30665414  0.41598529]
 [ 0.64583333  0.44344735  0.59313755  0.30551318  0.44216533]
 [ 0.92824925  0.9516955   0.40267365  0.52060142  0.8877353 ]]
  • if Z = Zmax, the value will be 1.
  • if Z = Zmin, the value will be 0.

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
0