Use Neural Network app to predict and calculate the MAPE error

7 ビュー (過去 30 日間)
Huy Cao
Huy Cao 2022 年 1 月 26 日
回答済み: Omega 2024 年 11 月 20 日 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

回答 (1 件)

Omega
Omega 2024 年 11 月 20 日 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:

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by