-
I am trying to compare both manual and predicted scoring using this: hypno_pred=sls.predict()
hypno_manual=np.loadtxt(easygui.fileopenbox(msg="Annotation file"),dtype=str)
accuracy=(hypno_manual==hypno_pred).sum()/hypno_pred.size
print("The overall agreement is %.3f"%accuracy) However, this is always what comes out of it: accuracy=(hypno_manual==hypno_pred).sum()/hypno_pred.size
AttributeError: 'bool' object has no attribute 'sum' Here (box nº6), it's showed as working but when reproducing the same thing, an error is prompted.Does anyone know why? Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
remrama
Dec 6, 2022
Replies: 1 comment 6 replies
-
It might be a typo where there are missing parentheses on hypno_pred = sls.predict() If that doesn't solve it, it might have something to do with the print(hypno_manual) |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
sjg2203
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It might be a typo where there are missing parentheses on
sls.predict()
. The first line in your example code should be:If that doesn't solve it, it might have something to do with the
easygui
part. If your problem isn't solved by adding parentheses tosls.predict()
, please show the output from: