【Transformer-BIGRU分类预测】Transformer-BIGRU多特征分类预测,基于Transformer-BIGRU多特征输入模型。matlab代码,2023b及其以上。1 多特

%% 损失函数曲线
figure
subplot(2, 1, 1)
plot(1 : length(Loss.TrainingAccuracy), Loss.TrainingAccuracy, 'r-', 'LineWidth', 1)
xlabel('迭代次数')
ylabel('准确率')
legend('训练集正确率')
title ('训练集正确率曲线')
grid
set(gcf,'color','w')
subplot(2, 1, 2)
plot(1 : length(Loss.TrainingLoss), Loss.TrainingLoss, 'b-', 'LineWidth', 1)
xlabel('迭代次数')
ylabel('损失函数')
legend('训练集损失值')
title ('训练集损失函数曲线')
grid
set(gcf,'color','w')
%% 六边形图
[Metrics]=polygonareametric(T_test, T_sim2);
%% ROC曲线
[TPR_rf,FPR_rf,TRF_rf,AUCRF_rf]=perfcurve(T_test, T_sim2,1);
figure
plot(FPR_rf,TPR_rf,'r--','linewidth',1.5)
xlabel('假正类率FPR');ylabel('真正类率TPR')
hold on
line([0 1],[0,1],'linewidth',1,'color','b');
hold on
axis([0 1 0 1]);
AUC_rf =trapz(FPR_rf,TPR_rf);
string={'ROC曲线结果'};
title(string)
hold on
text1=strcat('AUC=',num2str(AUC_rf));
legend(text1);
智能算法及其模型预测
更多推荐

所有评论(0)