I have an array of type numpy.ndarray and pandas DataFrame and need a way to compare each value to each other.
Below is one of the ways I've tried to do it. I've also used pd.get(labels) to pull the values out and was returned None. y_test is a pandas DataFrame and preds is a numpy array of predictions.
Tried converting both of them to lists as well as numpy arrays for comparison:
sgd = SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True)
model.compile(loss='binary_crossentropy',
optimizer='adam',metrics=['accuracy'])
model.fit(x_train, y_train, epochs=5, batch_size=2000)
preds = model.predict(x_test)
preds[preds>=0.5] = 1
preds[preds<0.5] = 0
print(type(preds))
print(y_test.get('labels'))
total = 0
for i in range(len(preds)):
if int(preds[i]) == y_test[i]:
total = total + 1
This is what I am getting - TypeError: 'NoneType' object is not callable - KeyError: 0