mex/standalone 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
Added Binaries for Windows 32/64 bit
Commented out compile_windows.m, if you feel upto it, remove the comments and recompile
CLASSIFICATION BASED RANDOMFOREST
****A tutorial for matlab now in tutorial_ClassRF.m****
Ways to generate Mex's and Standalone files
rfsub.o is compiled using fortran from rfsub.f. In case cywin or a fortran
compiler is not present just copy the appropriate (depending on OS)
rfsub.o from precompiled_rfsub directory to the current directory
___STANDALONE____ (not exactly standalone but an interface via C)
An example for a C file using the twonorm dataset for classification
is shown in src/twonorm_C_wrapper.cpp
This is a standalone version that needs to set right parameters in CPP file.
Compiling in windows:
Method 1: use cygwin and make: go to current directory and run 'make twonorm -f Makefile.windows'
in cygwin command prompt. Need to have gcc/g++ and g77 (in cygwin)
installed. Also the custom makefile differs from the linux version which has -lgfortran
whereas the windows version doesn't. Will generate twonorm_test.exe
Method 2: use DevC++ (download from http://www.bloodshed.net/devcpp.html ).
Open the twonorm_C_devc.dev file which is a project file which has the sources
etc set. Just compile and run. Will generate twonorm_C_devcpp.exe
Compiling in linux:
Method 1: use linux and make: go to this directory and run 'make diabetes'
in command prompt. Need to have gcc/g++ and fortran installed. Will generate diabetes_test.
run as ./diabetes_test
___MATLAB___
generates Mex files that can be called in Matlab directly.
Compiling in windows:
Use the compile_windows.m and run in windows. It will compile and generate
appropriate mex files. Need Visual C++ or some other compiler
(VC++ express edition also works). Won't work with Matlab's inbuilt compiler (lcc)
Compiling in linux:
Use the compile_linux.m and run in windows. It will compile and generate
appropriate mex files.
Using the Mex interface:
There are 2 functions classRF_train and classRF_predict as given below.
See the sample file test_ClassRF_extensively.m
%function Y_hat = classRF_predict(X,model)
%requires 2 arguments
%X: data matrix
%model: generated via classRF_train function
%function model = classRF_train(X,Y,ntree,mtry, extra_options)
%requires 2 arguments and the rest 2 are optional
%X: data matrix
%Y: target values
%ntree (optional): number of trees (default is 500)
%mtry (default is max(floor(D/3),1) D=number of features in X)
%there are about 14 odd options for extra_options. Refer to tutorial_ClassRF.m to examine them
Version History:
v0.02 (May-15-09):Updated so that classification package now has about 95% of the total options
that the R-package gives. Woohoo. Tracing of what happening behind screen works better.
v0.01 (Mar-22-09): very basic interface for mex/standalone to Liaw et al's
randomForest Package supports only ntree and mtry changing for time being.
没有合适的资源?快使用搜索试试~ 我知道了~
随机森林分类 回归 matlab源代码
共61个文件
cpp:14个
m:12个
txt:9个
4星 · 超过85%的资源 需积分: 50 333 下载量 46 浏览量
2016-01-13
11:39:28
上传
评论 11
收藏 445KB ZIP 举报
温馨提示
机器学习中的随机森林算法,其中包括分类和回归的matlab源代码
资源推荐
资源详情
资源评论
收起资源包目录
Windows-Precompiled-RF_MexStandalone-v0.02-.zip (61个子文件)
RF_MexStandalone-v0.02-precompiled
randomforest-matlab
RF_Class_C
mexClassRF_train.mexw64 45KB
twonorm_C_devcpp.dev 2KB
test_ClassRF_extensively.m 604B
classRF_train.m 14KB
Compile_Check 856B
mexClassRF_train.mexw32 32KB
rfsub.o 10KB
src
classTree.cpp 9KB
rfsub.f 15KB
cokus.cpp 7KB
rf.h 5KB
mex_ClassificationRF_predict.cpp 5KB
twonorm_C_wrapper.cpp 10KB
rfutils.cpp 9KB
mex_ClassificationRF_train.cpp 8KB
qsort.c 5KB
cokus_test.cpp 1KB
classRF.cpp 33KB
compile_windows.m 2KB
precompiled_rfsub
win32
rfsub.o 7KB
linux64
win64
rfsub.o 10KB
tempbuild
README.txt 3KB
Makefile 3KB
tutorial_ClassRF.m 10KB
compile_linux.m 557B
Makefile.windows 2KB
mexClassRF_predict.mexw64 26KB
data
twonorm.mat 48KB
Y_twonorm.txt 600B
X_twonorm.txt 94KB
Version_History.txt 1KB
mexClassRF_predict.mexw32 21KB
classRF_predict.m 2KB
RF_Reg_C
regRF_predict.m 986B
diabetes_C_devc.dev 1KB
regRF_train.m 13KB
test_RegRF_extensively.m 1KB
mexRF_predict.mexw64 11KB
src
mex_regressionRF_train.cpp 12KB
cokus.cpp 7KB
reg_RF.cpp 39KB
mex_regressionRF_predict.cpp 4KB
qsort.c 5KB
cokus_test.cpp 1KB
diabetes_C_wrapper.cpp 11KB
reg_RF.h 560B
Compile_Check_kcachegrind 611B
compile_windows.m 915B
tempbuild
README.txt 3KB
Makefile 2KB
compile_linux.m 952B
tutorial_RegRF.m 9KB
data
X_diabetes.txt 108KB
diabetes.mat 259KB
Y_diabetes.txt 11KB
mexRF_train.mexw64 34KB
mexRF_predict.mexw32 11KB
Version_History.txt 384B
Compile_Check_memcheck 623B
mexRF_train.mexw32 25KB
README_Windows_binary.txt 1KB
共 61 条
- 1
liushen918
- 粉丝: 13
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 机械设计整经机上纱自动化sw20非常好的设计图纸100%好用.zip
- Screenshot_20240427_031602.jpg
- 网页PDF_2024年04月26日 23-46-14_QQ浏览器网页保存_QQ浏览器转格式(6).docx
- 直接插入排序,冒泡排序,直接选择排序.zip
- 在排序2的基础上,再次对快排进行优化,其次增加快排非递归,归并排序,归并排序非递归版.zip
- 实现了7种排序算法.三种复杂度排序.三种nlogn复杂度排序(堆排序,归并排序,快速排序)一种线性复杂度的排序.zip
- 冒泡排序 直接选择排序 直接插入排序 随机快速排序 归并排序 堆排序.zip
- 课设-内部排序算法比较 包括冒泡排序、直接插入排序、简单选择排序、快速排序、希尔排序、归并排序和堆排序.zip
- Python排序算法.zip
- C语言实现直接插入排序、希尔排序、选择排序、冒泡排序、堆排序、快速排序、归并排序、计数排序,并带图详解.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页