This plot is widely used to explain how SVM (support-vector machines) works.
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?
This plot is widely used to explain how SVM (support-vector machines) works.
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?
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