资源简介
随机森林回归matlab代码,可用于回归和分类,简单易用
代码片段和文件信息
%**************************************************************
%* mex interface to Andy Liaw et al.‘s C code (used in R package randomForest)
%* Added by Abhishek Jaiantilal ( abhishek.jaiantilal@colorado.edu )
%* License: GPLv2
%* Version: 0.02
%
% Calls Classification Random Forest
% A wrapper matlab file that calls the mex file
% This does prediction given the data and the model file
% Options depicted in predict function in http://cran.r-project.org/web/packages/randomForest/randomForest.pdf
%**************************************************************
%function [Y_hat votes] = classRF_predict(Xmodel extra_options)
% requires 2 arguments
% X: data matrix
% model: generated via classRF_train function
% extra_options.predict_all = predict_all if set will send all the prediction.
%
%
% Returns
% Y_hat - prediction for the data
% votes - unnormalized weights for the model
% prediction_per_tree - per tree prediction. the returned object .
% If predict.all=TRUE then the individual component of the returned object is a character
% matrix where each column contains the predicted class by a tree in the forest.
%
%
% Not yet implemented
% proximity
function [Y_new votes prediction_per_tree] = classRF_predict(Xmodel extra_options)
if nargin<2
error(‘need atleast 2 parametersX matrix and model‘);
end
if exist(‘extra_options‘‘var‘)
if isfield(extra_options‘predict_all‘)
predict_all = extra_options.predict_all;
end
end
if ~exist(‘predict_all‘‘var‘); predict_all=0;end
[Y_hatprediction_per_treevotes] = mexClassRF_predict(X‘model.nrnodesmodel.ntreemodel.xbestsplitmodel.classwtmodel.cutoffmodel.treemapmodel.nodestatusmodel.nodeclassmodel.bestvarmodel.ndbigtreemodel.nclass predict_all);
%keyboard
votes = votes‘;
clear mexClassRF_predict
Y_new = double(Y_hat);
new_labels = model.new_labels;
orig_labels = model.orig_labels;
for i=1:length(orig_labels)
Y_new(find(Y_hat==new_labels(i)))=Inf;
Y_new(isinf(Y_new))=orig_labels(i);
end
1;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
.CA.... 2166 2009-05-17 03:11 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\classRF_predict.m
.CA.... 14829 2009-05-17 03:11 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\classRF_train.m
.CA.... 856 2009-04-25 20:39 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\Compile_Check
.CA.... 557 2009-05-17 03:11 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\compile_linux.m
.CA.... 1718 2010-02-06 16:44 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\compile_windows.m
.CA.... 48856 2009-04-25 20:39 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\data\twonorm.mat
.CA.... 96300 2009-04-25 20:39 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\data\X_twonorm.txt
.CA.... 600 2009-04-25 20:39 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\data\Y_twonorm.txt
.C.D... 0 2011-01-13 10:20 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\data
.CA.... 2693 2009-05-17 03:11 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\Makefile
.CA.... 2523 2009-05-17 03:11 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\Makefile.windows
.CA.... 20992 2010-02-06 16:29 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\mexClassRF_predict.mexw32
.CA.... 26624 2010-02-06 16:44 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\mexClassRF_predict.mexw64
.CA.... 32256 2010-02-06 16:29 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\mexClassRF_train.mexw32
.CA.... 46080 2010-02-06 16:44 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\mexClassRF_train.mexw64
.C.D... 0 2011-01-13 10:20 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\precompiled_rfsub\linux64
.CA.... 6848 2009-04-25 21:39 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\precompiled_rfsub\win32\rfsub.o
.C.D... 0 2011-01-13 10:20 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\precompiled_rfsub\win32
.CA.... 9840 2009-04-25 20:39 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\precompiled_rfsub\win64\rfsub.o
.C.D... 0 2011-01-13 10:20 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\precompiled_rfsub\win64
.C.D... 0 2011-01-13 10:20 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\precompiled_rfsub
.CA.... 3255 2010-02-06 17:05 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\README.txt
.CA.... 9840 2009-04-25 20:39 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\rfsub.o
.CA.... 33889 2009-05-17 03:11 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\src\classRF.cpp
.CA.... 8947 2009-05-17 03:11 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\src\classTree.cpp
.CA.... 7678 2009-04-25 20:39 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\src\cokus.cpp
.CA.... 1189 2009-04-25 20:39 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\src\cokus_test.cpp
.CA.... 5225 2009-05-17 03:11 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_predict.cpp
.CA.... 8545 2009-05-17 03:11 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp
.CA.... 4676 2009-04-25 20:39 RF_MexStandalone-v0.02-precompiled\randomforest-matlab\RF_Class_C\src\qsort.c
............此处省略48个文件信息
相关资源
- matlab变分模态分解VMD
- QPSK与OQPSK数字调制方式MATLAB代码
- 计算光谱夹角的matlab代码,内有注释
- matlab实现人工鱼群算法测试函数
- 熵权法求权重 matlab程序
- 自动控制原理课程设计--用MATLAB进行控
- MD5算法_matlab版
- 多AUV目标搜素与围捕.zip
- 基于DS证据理论的信息融合代码
- 变分模态分解matlab
- 六种数字调制信号识别的matlab程序
- 滤波反投影fbp算法matlab
- 电弧炉MATLAB模型
- matlab中kdtree调用,搜索点云数据近邻
- 演化博弈matlab源代码
- matlab 一致性算法
- 机器学习及其matlab实现—从基础到实
- 聚束SAR,PFA算法matlab仿真
- 图像/水下图像质量评价指标介绍含
- 直流微网模型matlab
- 经典去雾算法matlab实现
- 三维重建八点算法MATLAB代码
- 中继放大转发的matlab代码
- matlab 光学衍射模拟
- MIT-BIH ECG 心电数据+matlab绘图详解
- 从三维数组中提取出任意二维的数据
- MATLAB源程序代码分享:MATLAB实现四阶
- poissonmatlab 一维和二维 有限元程序
- MTI的matlab仿真
- 暗通道去雾matlab
评论
共有 条评论