资源简介
Matlab数据挖掘算法工具包,基础的机器学习算法,可以在Matlab平台下运行
代码片段和文件信息
function D = ada_boost(train_features train_targets params region);
% Classify using the AdaBoost algorithm
% Inputs:
% features - Train features
% targets - Train targets
% Params - [NumberOfIterations Weak Learner Type Learner‘s parameters]
% region - Decision region vector: [-x x -y y number_of_points]
%
% Outputs
% D - Decision sufrace
%
% NOTE: This algorithm is very tuned to the 2D nature of the toolbox!
[k_max weak_learner alg_param] = process_params(params);
[NiM] = size(train_features);
D = zeros(region(5));
W = ones(1M)/M;
IterDisp = 10;
%Find where the training features fall on the decision grid
N = region(5);
mx = ones(N1) * linspace (region(1)region(2)N);
my = linspace (region(3)region(4)N)‘ * ones(1N);
flatxy = [mx(:) my(:)]‘;
train_loc = zeros(1M);
for i = 1:M
dist = sqrt(sum((flatxy - train_features(:i)*ones(1N^2)).^2));
[m train_loc(i)] = min(dist);
end
%Do the AdaBoosting
for k = 1:k_max
%Train weak learner Ck using the data sampled according to W:
%...so sample the data according to W
randnum = rand(1M);
cW = cumsum(W);
indices = zeros(1M);
for i = 1:M
%Find which bin the random number falls into
loc = max(find(randnum(i) > cW))+1;
if isempty(loc)
indices(i) = 1;
else
indices(i) = loc;
end
end
%...and now train the classifier
Ck = feval(weak_learner train_features(: indices) train_targets(indices) alg_param region);
Ckl = Ck(:);
%Ek <- Training error of Ck
Ek = sum(W.*(Ckl(train_loc)‘ ~= train_targets));
if (Ek == 0)
break
end
%alpha_k <- 1/2*ln(1-Ek)/Ek)
alpha_k = 0.5*log((1-Ek)/Ek);
%W_k+1 = W_k/Z*exp(+/-alpha)
W = W.*exp(alpha_k*(xor(Ckl(train_loc)‘train_targets)*2-1));
W = W./sum(W);
%Update the decision region
D = D + alpha_k*(2*Ck-1);
if (k/IterDisp == floor(k/IterDisp))
disp([‘Completed ‘ num2str(k) ‘ boosting iterations‘])
end
end
D = D>0;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 952782 2002-05-20 12:36 mitmatlab\About.bmp
文件 2137 2002-06-25 13:28 mitmatlab\Ada_Boost.m
文件 3004 2002-02-18 18:25 mitmatlab\ADDC.m
文件 4318 2002-03-21 03:43 mitmatlab\AGHC.m
文件 3266 2002-03-21 14:29 mitmatlab\Backpropagation_Batch.m
文件 5183 2002-03-21 14:34 mitmatlab\Backpropagation_CGD.m
文件 6448 2002-03-21 14:31 mitmatlab\Backpropagation_Quickprop.m
文件 4963 2002-03-21 14:34 mitmatlab\Backpropagation_Recurrent.m
文件 3216 2002-03-21 14:33 mitmatlab\Backpropagation_SM.m
文件 2986 2002-03-21 14:33 mitmatlab\Backpropagation_Stochastic.m
文件 1377 2002-03-21 14:38 mitmatlab\Balanced_Winnow.m
文件 3248 2002-03-24 16:32 mitmatlab\Bayesian_Model_Comparison.m
文件 588 2001-12-27 14:56 mitmatlab\Bhattacharyya.m
文件 3298 2002-03-21 14:37 mitmatlab\BIMSEC.m
文件 5977 2005-01-19 12:40 mitmatlab\C4_5.m
文件 758 2001-12-24 21:34 mitmatlab\calculate_error.m
文件 1060 2001-02-22 18:06 mitmatlab\calculate_region.m
文件 4104 2002-03-21 03:43 mitmatlab\CART.m
文件 846 2002-02-10 03:54 mitmatlab\CARTfunctions.m
文件 5443 2002-03-21 14:39 mitmatlab\Cascade_Correlation.m
文件 902 2001-12-27 15:15 mitmatlab\Chernoff.m
文件 1528 2002-02-15 03:59 mitmatlab\chess.mat
文件 2824 2002-07-22 17:37 mitmatlab\Classification.txt
文件 1941 2000-12-27 03:16 mitmatlab\classification_error.m
文件 18356 2005-01-18 18:53 mitmatlab\classifier.m
文件 4328 2002-03-10 04:59 mitmatlab\classifier.mat
文件 25737 2002-05-21 18:25 mitmatlab\classifier_commands.m
文件 2926 2002-02-15 03:59 mitmatlab\click_points.m
文件 86112 2002-02-15 03:59 mitmatlab\clouds.mat
文件 2842 2002-03-21 14:36 mitmatlab\Competitive_learning.m
............此处省略148个文件信息
- 上一篇:锂离子电池模型
- 下一篇:sfm matlab实现
相关资源
- sfm matlab实现
- LDPC码的matlab仿真
- 抗差最小二乘Matlab代码
- ARIMA模型-matlab代码
- matlab风速仿真模型渐变风文件
- 吴宇飞的turbo编码的MATLAB代码
- 基于matlab的循环谱算法
- 基于Matlab的boxcox变换算法实现
- rvm-matlab工具箱
- MATLABR2016bWindows.txt
- 基于matlab语音信号基音检测
- matlab 录音与音频处理程序
- 线性分组码的MATLAB实现
- 最优控制 优化控制的matlab代码实现
- farthest point sampling
- 跳频通信MATLAB程序
- 电力系统负荷预测MATLAB程序 .m
- matlab自带的聚类算法
- matlab传递函数幅值,角度的计算----一
- 最大相关最小冗余MATLAB程序
- 信道均衡matlab代码
- 最简单的贝叶斯分类器演示Matlab程序
- 基于matlab的海浪模拟程序
- 信赖域算法matlab实现
- 双边滤波器 简洁matlab代码
- MATLAB的PUMA560机械臂的正逆解及应用举
- matlabRC电路实验仿真.pdf
- 基于不同调制方式16QAM、64QAM、QPSKOF
-
33637《MATLAB-Simuli
nk电力系统建模与仿 - 极限学习机matlab程序
评论
共有 条评论