資源簡介
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程序
評論
共有 條評論