I have a function that returns the predicted accuracy of a time-series model. I have two equally-sized numpy arrays, one for the actual direction and one for the predicted direction. I'm classifying whether there is a change in the data's direction from the previous t-1 step. '1' stands for an increase from t-1, '0' stands for no change in direction, and '-1' stands for a decrease from t-1. I'm trying to compare the elements of both arrays to determine if they both contain the same data to determine accuracy.
I can match indexes and count the number of '1s' and '-1s' that match, but I cannot count the number of matching zeros. (It's kinda hard summing zeros). :-) Anyway, I've tried the numpy sum function specifying '0' as the argument for both arrays but it only returns an array of zeros but no count. I'm not trying to create a confusion matrix...the goal here is to create an accuracy score. I plan to take all the matching ones, negative ones and zeros and divide that by the total length to get an accuracy score.
Thanks in advance.