资源简介
SPXY样本划分法及蒙特卡罗交叉验证结合优化建模方程,达到最高精度。
代码片段和文件信息
%把所有的样本都看作训练集候选样本,依次从中挑选样本进训练集,首先选择欧氏距离最远的两个向量对进入训练集,在接下来的迭代过程中拥有最大最小距离的待选样本
%被选入训练库.以此类推,达到所要求的样本数目。
%该方法优点是能保证训练库中样本按照空间距离分布均匀。缺点是需要进行数据转换和计算样本两两空间距离,计算量大。
function [mdminmax] = KS(XN)
% Kennard-Stone Algorithm for selection of samples
% [mdminmax] = ks(XN);
%
% X --> Matrix of instrumental responses
% N --> Number of samples to be selected (minimum of 2)
%
% m --> Indexes of the selected samples
%
% dminmax(1) = 0;
% dminmax(2) = Euclidean distance between the two first samples selected by the algorithm
% dminmax(i) = Smallest distance between the i-th selected sample and the previously selected ones (i > 2)
dminmax = zeros(1N); % Initializes the vector of minimum distances
M = size(X1); % Number of rows in X (samples)
samples = 1:M;
D = zeros(MM); % Initializes the matrix of distances
for i=1:M-1
xa = X(i:);
for j = i+1:M
xb = X(j:);
D(ij) = norm(xa - xb);
end
end
% D: Upper Triangular Matrix
% D(ij) = Euclidean distance between objects i and j (j > i)
[maxDindex_row] = max(D); % maxD = Row vector containing the largest element of each column in D
% index_row(n) = Index of the row with the largest element in the n-th column
[dummyindex_column] = max(maxD); % index_column = column corresponding to the largest element in matrix D
m(1) = index_row(index_column);
m(2) = index_column;
dminmax(2) = D(m(1)m(2));
for i = 3:N
% This routine determines the distances between each sample still available for selection and each of the samples already selected
pool = setdiff(samplesm); % pool = Samples still available for selection
dmin = zeros(1M-i+1); % Initializes the vector of minimum distances between each sample in pool and the samples already selected
for j = 1:(M-i+1) % For each sample xa still available for selection
indexa = pool(j); % indexa = index of the j-th sample in pool (still available for selection)
d = zeros(1i-1); % Initializes the vector of distances between the j-th sample in pool and the samples already selected
for k = 1:(i-1) % The distance with respect to each sample already selected is analyzed
indexb = m(k); % indexb = index of the k-th sample already selected
if indexa < indexb
d(k) = D(indexaindexb);
else
d(k) = D(indexbindexa);
end
end
dmin(j) = min(d);
end
% The selected sample corresponds to the largest dmin
[dminmax(i)index] = max(dmin);
m(i) = pool(index);
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2780 2015-03-18 14:56 样本划分选择\KS.m
文件 543 2010-03-17 20:04 样本划分选择\RS.m
文件 3175 2010-03-17 20:58 样本划分选择\spxy.m
文件 296470 2010-03-17 20:00 样本划分选择\SPXY样本划分法及蒙特卡罗交叉验证结合近红外光谱用于橘叶中橙皮苷的含量测定.PDF
目录 0 2015-03-18 16:13 样本划分选择
----------- --------- ---------- ----- ----
302968 5
- 上一篇:河北工业大学计算机组成真题2018
- 下一篇:即时聊天小程序源码
相关资源
- 北京地铁换乘--数据结构课程设计
- 基于SSH框架的BookShop网上书店实现
- CodeBlocks全部主题
- Hook工具 监控任意窗体拦截消息
- skserver1.09
- SocksCap V2.35 汉化破解版
- 最短路径算法Dijkstra源代码
- 12864液晶屏控制器为ks0108的proteus仿真
- VMware workstation 16 最新版本安装包,
- zw_q514004204-10166342-BookStore.zip
- zw_jksfkdjksdfjkjk-4705079-16PSK以及8PSK,Q
- DarkShell.rar
- vmwareworkstationpro15.0.2.txt
- vxworks_for_mips_architecture_supplement_6.1
-
twoli
nks.slx - SOLIDWORKS材质库大全
- 三菱编程软件GX Works2
- VMware-Workstation-Full-15.0.3-12422535.x86_64
- 几种堆(BinFibPair)在Dijkstra算法上的
- VMware Workstation v6.5.Keygen FOR ACE
- 最短路径Dijkstra
- Computer Networks 5th solution答案解析
- VXWORKS-82567V3驱动
- SOLIDWORKS 2019 最新及注册文件-童叟无欺
- SolidWorks 2018 SP0.0 安装包-包含和谐文件
- shadowsocks-libev_2.5.5-1_amd64_Ubuntu14.04.de
- ksvdbox+ompbox
- DHCP+PXE+NFS+Kickstart全自动系统安装
- svn hooks 全集,包含常用
- [答案] computer networks(5th edition write
评论
共有 条评论