4
$\begingroup$

I have to separate two populations by a line in a scatterplot:

Dot plot

I would like find a threshold that separates the two populations. In @Waynes words, I would like to cluster the points into two categories, then calculate the line which best separates them. What is the easiest way to accomplish this in R? I've tried the Otsu algorithm on the raw data, but I don't know if this one is robust enough for other datasets.

Edit: I don't know which dot belongs to which population. The data is not multivariate, I only have an X and a Y value, as seen in the dotplot.

$\endgroup$
  • 7
    $\begingroup$ Do you know which dots belong to which population? (Ie, is this cluster analysis?) Are you wondering how to get the line, or how to plot a line that you already have? $\endgroup$ – gung - Reinstate Monica Mar 4 '14 at 21:10
  • 2
    $\begingroup$ No, I don't know which dot belongs to which population. The data is not multivariate, I only have an X and a Y value, as seen in the dotplot. I want to get the line. $\endgroup$ – Eekhoorn Mar 4 '14 at 21:17
  • $\begingroup$ So you're asking how to cluster the points into two categories, then calculate the line which best separates them? $\endgroup$ – Wayne Mar 4 '14 at 21:19
  • 1
    $\begingroup$ @gung For the sake of easiness it should be straight. But if you have other approaches leading to a curved line, I'm also interested for future applications. $\endgroup$ – Eekhoorn Mar 4 '14 at 21:21
  • 1
    $\begingroup$ @gung I have the actual values. $\endgroup$ – Eekhoorn Mar 4 '14 at 21:23
1
$\begingroup$

I am sure there is a much simpler solution to this problem but something that will work is to first use K-means with two clusters. Once you know the class membership of each point, fit an SVM.

$\endgroup$
1
$\begingroup$

I would agree with the previous answer, K-means is easy and effective. However, the K-means algorithm just lets you find structure in the data. I would not use the results as labels to train a supervised learning algorithm, like an SVM. Labels like the ones used for training imply a stronger claim to categorical knowledge than simple structural patterns.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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