资源简介

MATLAB语言的随机森林算法的例程,可以用于学习随机森林算法

资源截图

代码片段和文件信息

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%功能:演示随机森林算法在计算机视觉中的应用
%环境:Win7,Matlab2012b
%Modi: NUDT-VAP
%时间:2015-4-10
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
path = [‘E:\works\book\7(机器学习20讲)\Code\5、Random Forest\‘];
data1 = textread([path ‘satimage.tra‘]);
data2 = textread([path ‘satimage.txt‘]);
% path = ‘C:\Users\Administrator\Documents\MATLAB\‘;
% data = textread(path + ‘srbct.txt‘);
% In this data set each row represents a sample 
% and each column represents a kind of variable(feature attribute).
% !! So we should transpose “x“ and “xts“ below.
[m1 n1] = size(data1);
[m2 n2] = size(data2);  
ntest = m2;  % The number of test set;
ntrain = m1; % The number of training set;
% Above lines we randomly select 2/3 data as training data 
% and remaining 1/3 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2737  2015-04-25 16:06  5、Random Forest\main.m

     文件      81920  2012-11-07 10:37  5、Random Forest\RF.mexw32

     文件       2616  2012-11-07 10:37  5、Random Forest\runRF.m

     文件        547  2015-04-11 08:43  5、Random Forest\runRF_demo.m

     文件     525830  2012-11-07 10:37  5、Random Forest\satimage.tra

     文件     236745  2012-11-07 10:37  5、Random Forest\satimage.txt

     文件    1001856  2012-11-07 10:37  5、Random Forest\srbct.txt

     文件      28024  2012-11-07 10:37  5、Random Forest\test_data.txt

     文件    1188000  2012-11-07 10:36  5、Random Forest\trainData.txt

     文件      56048  2012-11-07 10:37  5、Random Forest\train_data.txt

     目录          0  2012-11-07 10:37  5、Random Forest\datas\satimage

     目录          0  2012-11-07 10:37  5、Random Forest\datas

     目录          0  2015-11-30 15:36  5、Random Forest

----------- ---------  ---------- -----  ----

              3124323                    13


评论

共有 条评论