TypeError: float() argument must be a string or a number, not 'dict_values'

class Perceptron:

def __init__(self):

self.w = None

self.b = None

def model(self, x):

return 1 if (np.dot(self.w, x) >= self.b) else 0

def predict(self, X):

y = \[\]

for x in X:

  result = self.model(x)

  y.append(result)

return np.array(y)

def fit(self, X, y, epochs = 1):

self.w = np.ones(X.shape\[1\])

self.b = 0

accuracy = {}

max\_accuracy = 0




for i in range(epochs):

  for x,y\_ in zip(X, y):

    y\_pred = self.model(x)

    if y\_ == 1 and y\_pred == 0:

      self.w = self.w + x

      self.b = self.b + 1

    elif y\_ == 0 and y\_pred == 1:

      self.w = self.w - x

      self.b = self.b - 1




    accuracy\[i\] = accuracy\_score(self.predict(X), y)

    if max\_accuracy \< accuracy\[i\]:

      max\_accuracy = accuracy\[i\]




  print(max\_accuracy)

  plt.plot(accuracy.values())

  plt.show()

Not able to plot the graph - TypeError: float() argument must be a string or a number, not ‘dict_values’

Try it with the below command:

plt.plot( list(accuracy.values()) )

Yeah, I found it in the previous post. But, thank you for replying and helping - appreciate it.