SVM classification on distance matrix How can I do an SVM classification when I only have a distance matrix (pairwise matrix)?
Edited: I want to classify my data in two groups: healthy and sick. My original data are histograms (which are extracted from images), so I measure the distance (euclidean and others) between all the histograms and I obtain a distance matrix, I know how to use a clustering method with distance matrix (K-medoids clustering for example) but how can I classify my subjects using a supevised classification method when my original data are histograms?
other additions: I do know which subject is sick or healthy. I measure a variable for each subject, so a subject -> a histogram. and I want to know how well can the variable separates healthy subjects from sick patients. For the clustering part that I already did, I used k-medoids (PAM algorithm) and as the input I used the distance matrix that I obtained by measuring the distances between all histograms and I want to do the same thing with a supervised classification method.
Is there a supervised classification method that can classify objects like histograms (distributions) 
 A: Kernel SVMs often operate on the distance matrix indirectly. For example, the RBF kernel with Euclidean distance is is 
$$
\begin{align}
k(x,y)&=\exp(−\gamma ||x−y||_2^2) \\
&=\exp(−\gamma d(x,y)^2),
\end{align}
$$
but there's no mathematical impediment to using an alternative to Euclidean distance, such as a distance between two histograms. Suppose that you've recorded all of your pairwise distances in some matrix $M$. The RBF kernel matrix $K$ corresponding to the distance matrix $M$ is given by
$$
K_{ij} = \exp(-\gamma M_{ij}^2)
$$
where $A_{ab}$ denotes the value stored in the $a$th row of the $b$th column of matrix $A$.
Most SVM software allows you to supply your own kernel matrix to the estimation routine, so you can just hand $K$ off to some software and proceed as usual.
Importantly, this doesn't necessarily require you to work with a machine learning method which is specialized for histograms, since you've already pre-processed the histogram data into a format which is amenable to SVM.
FWIW, this functionality is implemented in Python sklearn and R kernlab. But I've found bugs in kernlab when using a custom kernel function and don't know if they've been fixed.
