Guest User

Untitled

a guest
Dec 6th, 2019
93
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. def create_system(number_labels=3, measures=100):
  3.     """Create a syntetic experiment"""
  4.     labels = np.arange(number_labels)
  5.  
  6.     # Create a vector with the real and computed labels
  7.     real = np.random.choice(labels, size=measures)
  8.     computed = np.random.choice(labels, size=measures)
  9.  
  10.     accumulator = {(i, j): 0 for i in number_labels for j in number_labels}
  11.     for x, y in np.nditer((real, computed)):
  12.         if (x == y):
  13.             accumulator[(x, y)] += 1
  14.  
  15.     return accumulator
RAW Paste Data