Use Neural Network app to predict and calculate the MAPE error
7 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
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:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!