店铺网站建设策划书,河北省建设厅网站工程师查询,网站设计的原则,西宁网站建设制作公司分类预测 | Matlab实现GA-RF遗传算法优化随机森林多输入分类预测 目录 分类预测 | Matlab实现GA-RF遗传算法优化随机森林多输入分类预测效果一览基本介绍程序设计参考资料 效果一览 基本介绍 Matlab实现GA-RF遗传算法优化随机森林多输入分类预测#xff08;完整源码和数据完整源码和数据 Matlab实现GA-RF遗传算法优化随机森林分类预测多输入单输出模型。GA-RF分类预测模型 多特征输入单输出的二分类及多分类模型。程序内注释详细直接替换数据就可以用。程序语言为matlab程序可出分类效果图混淆矩阵图。优化随机森林树木棵树何深度。 程序设计
完整源码和数据下载Matlab实现GA-RF遗传算法优化随机森林多输入分类预测
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
%% 清空环境变量
clc;
clear;
warning off
close all
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
%% 添加路径
addpath(Toolbox\)
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
%% 读取数据
res xlsread(数据集.xlsx);
%% 性能评价
error1 sum((T_sim1 T_train)) / M * 100 ;
error2 sum((T_sim2 T_test )) / N * 100 ;
%-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
%% 绘图
figure
plot(1: M, T_train, r-*, 1: M, T_sim1, b-o, LineWidth, 1)
legend(真实值, 预测值)
xlabel(预测样本)
ylabel(预测结果)
string {训练集预测结果对比; [准确率 num2str(error1) %]};
title(string)
gridfigure
plot(1: N, T_test, r-*, 1: N, T_sim2, b-o, LineWidth, 1)
legend(真实值, 预测值)
xlabel(预测样本)
ylabel(预测结果)
string {测试集预测结果对比; [准确率 num2str(error2) %]};
title(string)
grid
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
%% 混淆矩阵
if flag_conusion 1figurecm confusionchart(T_train, T_sim1);cm.Title Confusion Matrix for Train Data;cm.ColumnSummary column-normalized;cm.RowSummary row-normalized;figurecm confusionchart(T_test, T_sim2);cm.Title Confusion Matrix for Test Data;cm.ColumnSummary column-normalized;cm.RowSummary row-normalized;
end参考资料 [1] https://download.csdn.net/download/kjm13182345320/87899283?spm1001.2014.3001.5503 [2] https://download.csdn.net/download/kjm13182345320/87899230?spm1001.2014.3001.5503