kernel centering around mean when samples belong to positive or negative class

16 Views Asked by At

suppose I have a kernel matrix of 6x6 .Also i have label information indicating that 1 to 3 samples belong to label(i.e positive label) and 4 to 6 samples do not belong to label(negative label). I want to center the 1-3 samples around the mean of positive label and 4-6 samples around the mean of the negative label. How to do that? Also how to calculate the mean for negative and positive labels? I know that mean of a kernel matrix is calculated by summation of all the kernel matrix elements and dividing by the total number of elements. In the same way can I add all the entries of positive label and divide by number of positive elements , i.e here in this example for positive mean, add all elements of first three rows and divide by 3x6=18. Can it be done in this way ? why or why not please explain.