Error in Like-Unlike Contest using MP Neuron

in the 1st contest of deep learning like unlike classification, I binarised the x_train,x_test,y_train and y_test with the threshold as 4(given in the code).

But when executing the mp neuron class,i am getting an error -

TypeError: unsupported operand type(s) for +: ‘int’ and ‘str’

for this i applied the (pd.cut,bins=2,labels=[1,0]) to the x and y train and test, but still i am getting the same error.

my code-

from sklearn.model_selection import train_test_split
X=train_new.drop('Rating',axis=1)
Y=train_new['Rating']
X_train,X_test,Y_train,Y_test=train_test_split(X,Y,test_size=0.1,random_state=1)
print(Y.shape,Y_train.shape,Y_test.shape)
import matplotlib.pyplot as plt
plt.figure(figsize=(20,10))
X_binarised_train=X_train.apply(pd.cut,bins=2,labels=[1,0])
plt.plot(X_binarised_train.T,'*')
X_binarised_test=X_test.apply(pd.cut,bins=2,labels=[1,0])
plt.plot(X_binarised_test.T,'*')
plt.xticks(rotation='vertical')
Y_binarised_train=Y_train.map(lambda x: 0 if x< THRESHOLD else 1)
Y_binarised_train=Y_binarised_train.values
X_binarised_test=(X_binarised_test).astype(int)
X_binarised_train=(X_binarised_train).astype(int)
X_binarised_train=X_binarised_train.values
X_binarised_test=X_binarised_test.values
from random import randint
for b in range(X_binarised_train.shape[1]+1):
    Y_pred_train=[]
    accurate_rows=0
    for x,y in zip(X_binarised_train,Y_binarised_train):
        y_pred=(np.sum(x)>=b)
        Y_pred_train.append(y_pred)
        accurate_rows+=(y==y_pred)
    print(b,accurate_rows/X_binarised_train.shape[0])
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)
        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_binarised_train,Y_binarised_train)
Y_test_pred=mp_neuron.predict(X_binarised_test)
accuracy_test=accuracy_score(Y_test_pred,Y_test)
print(accuracy_test)

Can you paste the complete error snippet (instead of just the last line)?
The snippet includes helpful pointers to lines of code which threw the error.
Or,
you can check operand type of every ‘+’ operation in your code and see if one is ‘int’ and other is ‘str’.

TypeError                                 Traceback (most recent call last)
<ipython-input-134-d3056dfab9d8> in <module>
      1 mp_neuron=MPNeuron()
----> 2 mp_neuron.fit(X_binarised_train,Y_binarised_train)
      3 Y_test_pred=mp_neuron.predict(X_binarised_test)
      4 accuracy_test=accuracy_score(Y_test_pred,Y_test)
      5 print(accuracy_test)

<ipython-input-133-adf6e8c5e44b> in fit(self, X, Y)
     41         for b in range(X.shape[1]+1):
     42             self.b=b
---> 43             Y_pred=self.predict(X)
     44             accuracy[b]=accuracy_score(Y_pred,Y)
     45         best_b=max(accuracy,key=accuracy.get)

<ipython-input-133-adf6e8c5e44b> in predict(self, x)
     34         Y=[]
     35         for x in X:
---> 36             result=self.model(x)
     37             Y.append(result)
     38         return np.array(Y)

<ipython-input-133-adf6e8c5e44b> in model(self, x)
     30         self.b=None
     31     def model(self,x):
---> 32         return (sum(x)>=self.b)
     33     def predict(self,x):
     34         Y=[]

TypeError: unsupported operand type(s) for +: 'int' and 'str'

What are the contents (features) of x here? Are they all ‘int’?
May be you can try printing ‘x’ inside model before you apply sum to it.