資源簡介
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
- 上一篇:tle 根據衛星的位置和速度
- 下一篇:ddd 六階狀態空間模型
評論
共有 條評論