AA( train, test )
共同邻居节点的度的对数分之一,累和
function [ thisauc ] = AA( train, test )
%% 计算AA指标并返回AUC值
train1 = train ./ repmat(log(sum(train,2)),[1,size(train,1)]);【共同邻居节点的度的对数分之一】
% 计算每个节点的权重【但是对于(1,2)位置元素,代表何意??1列扩展了5列而已】,1/log(k_i),网络规模过大时需分块处理
train1(isnan(train1)) = 0;
train1(isinf(train1)) = 0;
% 将除数为零得到的异常值置0
sim = train * train1; clear train1; %????【】
% 实现相似度矩阵的计算
thisauc = CalcAUC(train,test,sim, 10000);
% 评测,计算该指标对应的AUC
end
RA
function [ thisauc ] = RA( train, test )
%% 计算RA指标并返回AUC值
train1 = train ./ repmat(sum(train,2),[1,size(train,1)]);
% 计算每个节点的权重,1/k_i,网络规模过大时需要分块处理
train1(isnan(train1)) = 0;
train1(isinf(train1)) = 0;
sim = train * train1; clear train1;%【累和是怎么算的??】
% 实现相似度矩阵的计算
thisauc = CalcAUC(train,test,sim, 10000);
% 评测,计算该指标对应的AUC
end
PA( train, test )偏好连接相似性
function [ thisauc ] = PA( train, test )
%% 计算PA指标并返回AUC值
deg_row = sum(train,2); 【计算行和,节点度】
% 所有节点的度构成列向量,将它乘以它的转置即可
sim = deg_row * deg_row';
clear deg_row deg_col;
% 相似度矩阵计算完成
thisauc = CalcAUC(train,test,sim, 10000);
% 评测,计算该指标对应的AUC
end
网友评论