function [ID] = Kernel_JCRDF (BlkD,Proj,Y_task, X_task,group_index_task,weight,tau)

trls     = group_index_task{1};
uni_trls = unique(trls);
for bi = 1:size(X_task,1)
    os(:,bi) = BlkD(bi).P*Y_task{bi};
end 
for bi = 1:size(X_task,1)
    weight_task{bi} = weight(bi);
    s(:,bi) = os(:,bi)+tau*weight(bi)/sum(weight)*Proj(bi).P*(os*weight');
    W{bi}   = s(:,bi);
end

ID = Classify(Y_task, X_task, group_index_task, weight_task, W);