Hello Burak,
I understand that you want to change the training accuracy formula. I would recommend defining a custom function for accuracy. I understand that if the difference between the predicted and actual class is less than or equal to 1 it should be considered as correct prediction otherwise it should be considered as misclassified.
Following approach can be taken to define the function:
- Get the predicted values from the LSTM model and the target class values.
- Initialize “correctPredictions = 0”.
- Compare each predicted value to target class value.
- If the difference between these values is less than or equal to 1.
- Increment “correctPredictions”.
- Compute accuracy by using “correctPredictions”.
Hope this helps!
Regards,
Aditi