1

This plot is widely used to explain how SVM (support-vector machines) works.

thr

Is there a name of this random variable distribution for this a cluster inside a circle plot?

(thanks to @Glen_b♦) No matter what name it is, how to simulate this in R?

shi95
  • 237
  • 1
  • 2
  • 7
  • 2
    "if yes, how to simulate this " -- hang on, you're saying that if there isn't a *name for that*, you don't want to know how to simulate it? – Glen_b May 11 '19 at 01:57
  • There is another CV answer with this type of plot included and even a link to R code on Github that produces it: https://stats.stackexchange.com/a/133694. – AlexK May 11 '19 at 07:19
  • @AlexK does "CV" mean "computer vision" or something else? – shi95 May 11 '19 at 07:42
  • @shi95 Cross Validated = this site – AlexK May 11 '19 at 07:43

1 Answers1

1

per @AlexK

here is the code snippet

```{r non_spherical}
library(plyr)
library(dplyr)
library(ggplot2)

set.seed(2015)

n <- 250
c1 <- data_frame(x = rnorm(n), y = rnorm(n), cluster = 1)
c2 <- data_frame(r = rnorm(n, 5, .25), theta = runif(n, 0, 2 * pi),
                 x = r * cos(theta), y = r * sin(theta), cluster = 2) %>%
    dplyr::select(x, y, cluster)

points1 <- rbind(c1, c2) %>% mutate(cluster = factor(cluster))

ggplot(points1, aes(x, y)) + geom_point()
```

output

enter image description here

czlsws
  • 536
  • 3
  • 9