MATLAB Deep Learning Accuracy Formula

조회 수: 1 (최근 30일)
Burak Kaya
Burak Kaya 2022년 3월 12일
답변: aditi bagora 2023년 10월 20일
Hello everyone, I want to classify a model with LSTM in MATLAB, but since the target values are between 1 and 5, 1 different predictions made by the model are taken as 0 accuracy. I want to use a new accuracy calculation formula based on the differences so that when it misclassifies with 1 difference (the difference is important because it is a scoring classification), the accuracy value will not be 0. How can I change the formula used when calculating training accuracy?
Thanks everyone in advance.

답변 (1개)

aditi bagora
aditi bagora 2023년 10월 20일
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

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by