资源简介
多输出支持向量回归 对于一般的回归问题,给定训练样本D={(x1,y1),(x2,y2),...,(xn,yn)},yi€R,我们希望学习到一个f(x)使得其与y尽可能的接近,w,b是待确定的参数。在这个模型中,只有当f(x)与y完全相同时,损失才为零,而支持向量回归假设我们能容忍的f(x)与y之间最多有ε的偏差,当且仅当f(x)与y的差别绝对值大于ε时,才计算损失,此时相当于以f(x)为中心,构建一个宽度为2ε的间隔带,若训练样本落入此间隔带,则认为是被预测正确的。(间隔带两侧的松弛程度可有所不同)
------
代码片段和文件信息
function RESULTS = assessment(LabelsPreLabelspar)
%
% function RESULTS = assessment(LabelsPreLabelspar)
%
% INPUTS:
%
% Labels : A vector containing the true (actual) labels for a given set of sample.
% PreLabels : A vector containing the estimated (predicted) labels for a given set of sample.
% par : ‘class‘ or ‘regress‘
%
% OUTPUTS: (all contained in struct RESULTS)
%
% ConfusionMatrix: Confusion matrix of the classification process (True labels in columns predictions in rows)
% Kappa : Estimated Cohen‘s Kappa coefficient
% OA : Overall Accuracy
% varKappa : Variance of the estimated Kappa coefficient
% Z : A basic Z-score for significance testing (considering that Kappa is normally distributed)
% CI : Confidence interval at 95% for the estimated Kappa coefficient
% Wilcoxon sign test and McNemar‘s test of significance differences
%
% Gustavo Camps-Valls 2007(c)
% gcamps@uv.es
%
% Formulae in:
% Assessing the Accuracy of Remotely Sensed Data
% by Russell G Congalton Kass Green. CRC Press
%
switch lower(par)
case {‘class‘}
Etiquetas = union(LabelsPreLabels); % Class labels (usually 123.... but can work with text labels)
NumClases = length(Etiquetas); % Number of classes
% Compute confusion matrix
ConfusionMatrix = zeros(NumClases);
for i=1:NumClases
for j=1:NumClases
ConfusionMatrix(ij) = length(find(PreLabels==Etiquetas(i) & Labels==Etiquetas(j)));
end;
end;
% Compute Overall Accuracy and Cohen‘s kappa statistic
n = sum(ConfusionMatrix(:)); % Total number of samples
PA = sum(diag(ConfusionMatrix));
OA = PA/n;
% Estimated Overall Cohen‘s Kappa (suboptimal implementation)
npj = sum(ConfusionMatrix1);
nip = sum(ConfusionMatrix2);
PE = npj*nip;
if (n*PA-PE) == 0 && (n^2-PE) == 0
% Solve indetermination
warning(‘0 divided by 0‘)
Kappa = 1;
else
Kappa = (n*PA-PE)/(n^2-PE);
end
% Cohen‘s Kappa Variance
theta1 = OA;
theta2 = PE/n^2;
theta3 = (nip‘+npj) * diag(ConfusionMatrix) / n^2;
suma4 = 0;
for i=1:NumClases
for j=1:NumClases
suma4 = suma4 + ConfusionMatrix(ij)*(nip(i) + npj(j))^2;
end;
end;
theta4 = suma4/n^3;
varKappa = ( theta1*(1-theta1)/(1-theta2)^2 + 2*(1-theta1)*(2*theta1*theta2-theta3)/(1-theta2)^3 + (1-theta1)^2*(theta4-4*theta2^2)/(1-theta2)^4 )/n;
Z = Kappa/sqrt(varKappa);
CI = [Kappa + 1.96*sqrt(varKappa) Kappa - 1.96*sqrt(varKappa)];
if NumClases==2
% Wilcoxon test at 95% confidence interval
[p1h1] = signrank(LabelsPreLabels);
if h1==0
RESULTS.WilcoxonComment = ‘The null hypothesis of both distributions come from the same median can be rejected at the 5% level.‘;
elseif h1==1
RESULTS.WilcoxonComment = ‘Th
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4689 2010-09-15 17:18 msvr-2-1\assessment.m
文件 2213 2018-12-31 22:17 msvr-2-1\demoMSVR.m
文件 1642 2010-09-15 17:18 msvr-2-1\kernelmatrix.m
文件 3312 2016-02-16 15:39 msvr-2-1\msvr.m
文件 198 2010-09-15 17:18 msvr-2-1\scale.m
目录 0 2018-12-31 22:23 msvr-2-1
----------- --------- ---------- ----- ----
12054 6
相关资源
- AR过程的线性建模过程与各种功率谱估
- PCNN TOOLBOX
- plstoolbox.zip
- 中国国家基础地理信息系统GIS数据
- 粒子群微电网优化调度
- 矩阵分析-经典教材-中文版-Roger.A.Ho
- 压缩感知TwIST
- 基于最小错误率的贝叶斯手写数字分
- 最全系统辨识源代码,包括多种最小
- 导弹制导实验
- 画跟踪精确度图的程序.zip
- 重力场大地水准面及重力异常阶次误
- prtools5.2.3工具包
- 脉冲耦合神经网络工具箱PCNN-toolbox
- SVM算法-回归拟合程序.zip
- Kriging代理模型EGO算法.zip
- Matalb实现停车场完整系统
- 总体经验模态分解
- 在一张图上画多个跟踪框.zip
- 大量的有限元法求解偏微分方程的程
- 电力系统稳态潮流计算程序PQ和NR法
- 夜间车牌识别
- emd分解成多个imf分量,通过判断以后
- 心电信号的处理与自动诊断-心电信号
- 交流这是关于微电网中下垂控制的仿
- DTW语音识别算法
- 2020年美赛ABCDEF赛题特等奖论文合辑,
- 多尺度hessian滤波器图像增强
- 脉振高频注入法.zip
- 关于BPSK、QPSK、MSK、QAM的调制与解调
评论
共有 条评论