资源简介
分类学习工具箱,里面包含SVM、决策树、Knn等各类分类器,使用非常方便。
代码片段和文件信息
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;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 34256 2006-03-28 23:17 Classification MatLab Toolbox\spiral.mat
文件 3004 2006-03-28 22:57 Classification MatLab Toolbox\ADDC.m
文件 4318 2006-03-28 22:57 Classification MatLab Toolbox\AGHC.m
文件 2704 2006-03-28 23:16 Classification MatLab Toolbox\load_file.m
文件 952782 2006-03-28 22:57 Classification MatLab Toolbox\About.bmp
文件 294 2006-03-28 23:16 Classification MatLab Toolbox\make_a_draw.m
文件 2137 2006-03-28 22:58 Classification MatLab Toolbox\Ada_Boost.m
文件 3298 2006-03-28 22:58 Classification MatLab Toolbox\BIMSEC.m
文件 4110 2006-03-28 23:14 Classification MatLab Toolbox\feature_selection.m
文件 3266 2006-03-28 22:58 Classification MatLab Toolbox\Backpropagation_Batch.m
文件 1720 2006-03-28 23:15 Classification MatLab Toolbox\feature_selection.mat
文件 5183 2006-03-28 22:59 Classification MatLab Toolbox\Backpropagation_CGD.m
文件 5934 2006-03-28 23:14 Classification MatLab Toolbox\enter_distributions_commands.m
文件 6448 2006-03-28 22:59 Classification MatLab Toolbox\Backpropagation_Quickprop.m
文件 1835 2006-03-28 23:15 Classification MatLab Toolbox\feature_selection_commands.m
文件 4963 2006-03-28 22:59 Classification MatLab Toolbox\Backpropagation_Recurrent.m
文件 172 2006-03-28 23:15 Classification MatLab Toolbox\find_classes.m
文件 3216 2006-03-28 22:59 Classification MatLab Toolbox\Backpropagation_SM.m
文件 1830 2006-03-28 23:15 Classification MatLab Toolbox\fuzzy_k_means.m
文件 2986 2006-03-28 22:59 Classification MatLab Toolbox\Backpropagation_Stochastic.m
文件 2622 2006-03-28 23:15 Classification MatLab Toolbox\generate_data_set.m
文件 1377 2006-03-28 22:59 Classification MatLab Toolbox\Balanced_Winnow.m
文件 2280 2006-03-28 23:15 Classification MatLab Toolbox\high_histogram.m
文件 3248 2006-03-28 23:00 Classification MatLab Toolbox\Bayesian_Model_Comparison.m
文件 435 2006-03-28 23:16 Classification MatLab Toolbox\loglikelihood.m
文件 588 2006-03-28 23:00 Classification MatLab Toolbox\Bhattacharyya.m
文件 5984 2006-03-28 23:00 Classification MatLab Toolbox\C4_5.m
文件 4104 2006-03-28 23:00 Classification MatLab Toolbox\CART.m
文件 3842 2006-03-28 23:16 Classification MatLab Toolbox\min_spanning_tree.m
文件 846 2006-03-28 23:00 Classification MatLab Toolbox\CARTfunctions.m
............此处省略135个文件信息
- 上一篇:单相逆变器Matlab仿真
- 下一篇:Matlab 图形中填充斜线图
相关资源
- Matlab 图形中填充斜线图
- 单相逆变器Matlab仿真
- MATLAB中用FIR和IIR滤波器滤除高频噪声
- 基于matlab的一种语音加密程序
- 混沌优化算法求极值matlab仿真代码
- matlab图像显示上位机
- 基于MATLAB的工频干扰陷波器设计
- matlab 如何生成exe
- matlab实现读取视频并截取每帧然后保
- 基于三角曲面网格实现测地线算法的
- 基于MATLAB的LDPC码的仿真
- BP神经网络 拟合正弦曲线的
- 计算网络的平均路径长度
- 直方图均衡化及matlab实现
- Fusiello极线校正 - 论文和Matlab程序
- 应用 MATLAB实现连续信号的采样与重构
- 郭涛算法的MATLAB实现
- matlab 读取ply文档包括点、三角面和颜
- matlab编写prony算法
- 用matlab编写的二维最大熵和最小交叉
- matlab抛硬币仿真
- 计算欧式距离的matlab程序
- GMM的matlab实现集合
- 三相SVPWM整流Matlab仿真
- 使用MATLAB完成一个双轮差速驱动的移
- 基于matlab的车牌识别,采用的是BP神经
- 使用matlab的OFDM导频ls lmmse信道估计
- OFDM盲信道估计_基于子空间的盲信道估
-
使用MATLAB 2014a的Simuli
nk搭建的太阳能 - 灰色预测模型 MATLAB实现含具体数据
评论
共有 条评论