Hello,

I did same as Pratyush Sir did in the videos. But unable to figure out why getting this error?

I am pretty sure there is some problem in `return`

from model part. How the types are different? How to resolve it?

```
class MPNeuron:
def __init__(self):
self.b = None
def model(self,x):
return(sum(x) >= self.b)
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):
accuracy={}
for b in range(X.shape[1]+1):
self.b=b
Y_pred = self.predict(X)
accuracy[b]=accuracy_score(Y_pred,Y)
best_b=max(accuracy,key=accuracy.get) # "key" argument gives max value among all keys of dictionary accuracy
self.b = best_b
print('Optimal value of b is',best_b)
print('Highest accuracy is',accuracy[best_b])
```

```
mp_neuron=MPNeuron()
mp_neuron.fit(X_train_binarised,Y_train)
```

```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-74-2b7a9f6f4b30> in <module>()
1 mp_neuron=MPNeuron()
----> 2 mp_neuron.fit(X_train_binarised,Y_train)
2 frames
<ipython-input-71-4271ceb4004c> in model(self, x)
4
5 def model(self,x):
----> 6 return(sum(x) >= self.b)
7
8 def predict(self,x):
TypeError: unsupported operand type(s) for +: 'int' and 'str'
```