Use Neural Network app to predict and calculate the MAPE error

7 vues (au cours des 30 derniers jours)
Huy Cao
Huy Cao le 26 Jan 2022
Réponse apportée : Omega le 20 Nov 2024 à 5:33
Hi guys, I'm new in Matlab I now I want to use Neural Network app to predict the data. I want to train all the value with 80% data and test with 20% data and use power as a target( don't minh about the cluster). I have read many document and answer but I think I did the wrong way. Thank you guyssss

Réponses (1)

Omega
Omega le 20 Nov 2024 à 5:33
Hi Huy,
You can use the "Neural Network Fitting" application, which is well-suited for your tasks. The application allows you to specify the split ratios for training, validation, and testing. You can adjust these values according to your requirements.
To calculate the Mean Absolute Percentage Error (MAPE), you can export the predictions and actual values to the MATLAB workspace and use the following formula:
% Assuming y_true is the actual values and y_pred is the predicted values
y_true = ...; % Replace with actual values
y_pred = ...; % Replace with predicted values
% Calculate MAPE
mape = mean(abs((y_true - y_pred) ./ y_true)) * 100;
fprintf('Mean Absolute Percentage Error (MAPE): %.2f%%\n', mape);
For more information about MAPE, please refer to the following documentation link:

Catégories

En savoir plus sur Sequence and Numeric Feature Data Workflows dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by