daily pastebin goal
43%
SHARE
TWEET

Untitled

a guest Oct 23rd, 2018 73 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. def z_score():
  2.     matrix = [[[0] * len(attributes)] * numOfRecords] * numOfClasses
  3.     for i in range(len(attributes)):
  4.         attr = []
  5.         for j in range(numOfClasses):
  6.             for k in range(numOfRecords):
  7.                 attr.append(classes[j][k][i])
  8.         attr_normalized = zscore(attr)
  9.         id = 0
  10.         print(attr_normalized)
  11.         for j in range(numOfClasses):
  12.             for k in range(numOfRecords):
  13.                 if math.isnan(attr_normalized[id]):
  14.                     matrix[j][k][i] = 0
  15.                 else:
  16.                     matrix[j][k][i] = attr_normalized[id]
  17.                 id += 1
  18.  
  19.     histogram(matrix, "After z-score normalization")
  20.     return matrix
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top