Is there a metric in tensorflow.keras.metrics
that counts how many time the predicted output and the real output have the same signal?
For example, if the y_pred = [-0.1, 0.3, -0.22, -1]
and y_val = [-1.3, 1.2, 0.5, -2]
, then the output should be 0.75
.
I am working on a project that takes as input, along with other features, a column of real values around 0, and should predicted if the next elements of this column should be negative or positive (regardless of their absolute value). As it's only logical, I am using tanh
as the activation function, but if I use as metrics accuracy
or binary_accuracy
, the output is always zero.