I have a dataset with physiological measures of subjects along time. I would like to create (or select) a mean prototype example in order to be able to identify in new examples how far are they from the mean prototype. A second issue will be to select a threshold to determine what is considered near or far. Each example has 20 numeric features and I have around 300 examples per subject.

First ideas (disregarding outliers):

  • To iterate through all the examples of a subject and find the one who has the minimum mean distance to all the other examples. This will select a specific example from the dataset.
  • To use an evolutionary algorithm to find a prototypical example which has the lowest mean distance to all the other examples. This will create a new example that can be used as prototype.

Now I would like to determine when a new example is close, far or very far from the prototype (mean). A possible approach is to set two thresholds distance to determine to which class or case corresponds the new example (close, far or very far). How could I determine these thresholds? Possibly using number of standard deviations? What other approaches can be followed to perform all this?

Let's assume the distance metric is already selected.

  • $\begingroup$ When iterating, you can take advantage of symmetry: $d(V_1,V_2)=d(V_2,V_1)$. That results in half the calculations. You calculate $n*(n-1)$ distances, accumulate them in a vector $\endgroup$
    – Juan Leni
    Commented Feb 26, 2016 at 16:31

2 Answers 2


The object with the lowest mean distance (= the object with the lowest distance sum) is known as the medoid and the basis of k-medoids algorithms such as PAM. Because you must not use k-means with arbitrary distances.

  • $\begingroup$ Interesting approach, particularly because its fast, however since its dependent on initialization it requires to be ran multiple times. I have found in literature references on Affinity Propagation. Do you know this method? Would you recommend it for this task? vision.jhu.edu/assets/ElhamifarNIPS12.pdf $\endgroup$
    – Javierfdr
    Commented Feb 27, 2016 at 17:59
  • $\begingroup$ I tried it (in ELKI, I think I tried all of them multiple times) but it did not work well for me. But every data is different. $\endgroup$ Commented Feb 27, 2016 at 19:35

For your prototype: for each time segment t1-t300, for each feature f1-f20, compute the mean feature value across subjects s1-sn. This is your prototype subject about which you can compute a confindence interval set to your target threshold (e.g, 95%) or set a threshold to +/- Nsd depending upon your definition of an outlier.

  • $\begingroup$ This is not correct for every possible metric $\endgroup$
    – Juan Leni
    Commented Feb 26, 2016 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.