資源簡介
隨機森林顧名思義,是用隨機的方式建立一個森林,森林里面有很多的決策樹組成,隨機森林的每一棵決策樹之間是沒有關聯的。在得到森林之后,當有一個新的輸入樣本進入的時候,就讓森林中的每一棵決策樹分別進行一下判斷,看看這個樣本應該屬于哪一類(對于分類算法),然后看看哪一類被選擇最多,就預測這個樣本為那一類。
代碼片段和文件信息
function?retval?=?build_tree?(rowslabels)
??
??bestsplit?=?find_best_split(rowslabels);
??%disp(bestsplit{1});
??
??if(bestsplit{1}(1)==0?)%best?gain
????retval?=?struct(‘predictions‘rows);
????return;
??endif
??
??true_branch?=?build_tree(bestsplit{2}labels);
??false_branch?=?build_tree(bestsplit{3}labels);
??retval?=?struct(‘question‘bestsplit{1}(2:3)‘tb‘true_branch‘fb‘false_branch);
endfunction
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-10-17?05:50??RandomForest-master\
?????文件????????1067??2018-10-17?05:50??RandomForest-master\LICENSE
?????文件?????????100??2018-10-17?05:50??RandomForest-master\README.md
?????文件?????????572??2018-10-17?05:50??RandomForest-master\RandFor.m
?????目錄???????????0??2018-10-17?05:50??RandomForest-master\RandomForest\
?????文件?????????411??2018-10-17?05:50??RandomForest-master\build_tree.m
?????文件?????????227??2018-10-17?05:50??RandomForest-master\class_count.m
?????文件?????????337??2018-10-17?05:50??RandomForest-master\classify.m
?????文件????????1014??2018-10-17?05:50??RandomForest-master\find_best_split.m
?????文件?????????312??2018-10-17?05:50??RandomForest-master\gini.m
?????文件?????????221??2018-10-17?05:50??RandomForest-master\info_gain.m
?????文件?????????567??2018-10-17?05:50??RandomForest-master\print_tree.m
?????文件???????84105??2018-10-17?05:50??RandomForest-master\sonar.all-data.csv
?????文件????????2483??2018-10-17?05:50??RandomForest-master\sonar.test-data.csv
?????文件?????????748??2018-10-17?05:50??RandomForest-master\t.m
- 上一篇:自組織神經網絡matlab實現
- 下一篇:單端反激微型逆變器matlab建模仿真
評論
共有 條評論