资源简介
matlab实现的随机森林算法,利用分类器可做回归或预测
代码片段和文件信息
/* Copyright 2002-2003 Leo Breiman and Adele Cutler */
/* This is free open source software but its usein part or */
/* in wholein any commercial product that is sold for profit */
/* is prohibited without the written consent of Leo Breiman */
/* and Adele Cutler. */
/* We very much appreciate bug notices and suggested improvements. */
/* leo@stat.berkeley.edu adele@math.usu.edu */
/* SETTING PARAMETERS TO ZERO TURNS THE CORRESPONDING */
/* OPTION OFF. */
/* Translated to C language */
#include “mex.h“
#include “math.h“
#include “matrix.h“
#include “stdio.h“
#include “stdlib.h“
#include “string.h“
#include “windows.h“
/*
* 第30行~第44行:
* 定义一些常量,用于grnd()函数(即生成随机数序列函数);
*/
/* Period parameters */
#define N 624
#define M 397
#define MATRIX_A 0x9908b0df /* constant vector a */
#define UPPER_MASK 0x80000000 /* most significant w-r bits */
#define LOWER_MASK 0x7fffffff /* least significant r bits */
/* Tempering parameters */
#define TEMPERING_MASK_B 0x9d2c5680
#define TEMPERING_MASK_C 0xefc60000
#define TEMPERING_SHIFT_U(y) (y >> 11)
#define TEMPERING_SHIFT_S(y) (y << 7)
#define TEMPERING_SHIFT_T(y) (y << 15)
#define TEMPERING_SHIFT_L(y) (y >> 18)
static unsigned long mt[N]; /* the array for the state vector */
static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */
/*
* 第50行~第53行:
* 定义整型常量1、2、3、4;
*/
static int NO1 = 1;
static int NO2 = 2;
static int NO3 = 3;
static int NO4 = 4;
/*
* 第59行~第60行:
* 定义文件指针;
*/
static FILE *fp1 *fp2 *fp3 *fp4 *fp5 *fp6 *fp7 *fp8 *fp9 *fp10 *fp11
*fp12 *fp15;
/*
* 第66行~第68行:
* 测试、调试用变量,用于记录一些参数;
*/
static int n0 n1 n2 n3 n4 n5 n7;
static float n6 er;
char text[100];
/*
* 第74行:
* 存放路径字符串;
*/
char dir[MAX_PATH] *path *fullPath *safePath;
/*
* 第81行~第1567行:
* 核心函数RF;
* 所有输入输出变量以及中间变量皆通过其传递;
*/
int RF(int *mdim int *mdimt0 int *ntrain int *nclass int *ntest\
int *labelts int *labeltr int *maxcat int *jbt int *look int *lookcls int *mtry0\
int *ndsize int *jclasswt int *mdim2nd int *imp\
int *interact int *impn int *nprox int *nrnn int *noutlier int *nscale\
int *nprot float *code int *missfill int *iseed int *nsample\
int *nrnodes int *mimp int *nscale0 int *nprot0 int *ntest0 int *mdim0 int *near0\
//记录参数
int *isaverf int *isavepar int *isavefill\
int *irunrf int *ireadpar\
//输出控制
int *isumout int *idataout int *impfastout int *impout int *impnout\
int *interout int *iprotout int *iproxout int *iscaleout int *ioutlierout\
float *x int *cl float *xts int *clts\
float *classwt int *cat\
float *erroob float *errtses double *prox\
float *trees int *predictts float *myvarimp double *xsc\
double *y double *u double *dl d属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 81920 2012-11-07 10:37 RandomForest_matlab\RandomForests\RF.mexw32
文件 2536 2012-11-07 10:37 RandomForest_matlab\RandomForests\RF_demo.m
文件 2616 2012-11-07 10:37 RandomForest_matlab\RandomForests\runRF.m
文件 546 2012-11-07 10:37 RandomForest_matlab\RandomForests\runRF_demo.m
文件 525830 2012-11-07 10:37 RandomForest_matlab\RandomForests\satimage.tra
文件 236745 2012-11-07 10:37 RandomForest_matlab\RandomForests\satimage.txt
文件 1001856 2012-11-07 10:37 RandomForest_matlab\RandomForests\srbct.txt
文件 28024 2012-11-07 10:37 RandomForest_matlab\RandomForests\test_data.txt
文件 1188000 2012-11-07 10:36 RandomForest_matlab\RandomForests\trainData.txt
文件 56048 2012-11-07 10:37 RandomForest_matlab\RandomForests\train_data.txt
文件 134216 2012-11-07 10:37 RandomForest_matlab\randomForests.c
文件 460 2012-11-07 10:37 RandomForest_matlab\ReadReadReadme!.txt
文件 32529 2012-11-07 10:37 RandomForest_matlab\RF.c
目录 0 2012-11-07 10:37 RandomForest_matlab\RandomForests\datas\satimage
目录 0 2017-10-05 17:31 RandomForest_matlab\RandomForests\datas
目录 0 2017-10-05 17:31 RandomForest_matlab\RandomForests
目录 0 2017-10-05 17:31 RandomForest_matlab
----------- --------- ---------- ----- ----
3291326 17
- 上一篇:雷克子波程序
- 下一篇:自动门西门子S7-200PLC程序
相关资源
- 串行级联cpm系统MATLAB仿真
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
川公网安备 51152502000135号
评论
共有 条评论