极限学习机是由黄广斌等[13]提出的一种针对前馈神经网络设计的机器学习算法。该算法结构简单、计算速率快。ELM的关键在于找到输出和输出之间的映射空间。首先确定隐含层之间的连接权值w和隐含层神经元的偏置b。选择一个无限可微的函数作为隐含层神经元的激活函数g(x),则隐藏层输出矩阵为:
function score = accuracy(true_labels, cluster_labels)
%ACCURACY Compute clustering accuracy using the true and cluster labels and
% return the value in 'score'.
%
% Input : true_labels : N-by-1 vector containing true labels
% cluster_labels : N-by-1 vector containing cluster labels
%
% Output : score : clustering accuracy
% Compute the confusion matrix 'cmat', where
% col index is for true label (CAT),
% row index is for cluster label (CLS).
n = length(true_labels);
cat = spconvert([(1:n)' true_labels ones(n,1)]); %spconvert作用是将外部文件转换成系数矩阵存储
cls = spconvert([(1:n)' cluster_labels ones(n,1)]);
cls = cls';
cmat = full(cls * cat);
%
% Calculate accuracy
%
[match, cost] = hungarian(-cmat); % 调用hungarian
score = 100*(-cost/n);
[1]胡波. 基于极限学习机的脑电信号分类研究. Diss. 杭州电子科技大学.
部分理论引用网络文献,若有侵权联系博主删除。