1
$\begingroup$

I playing around trying to emulate a visualization of the book Introduction to Statistical Learning, chapter 2, page 38.

My problem is that I cannot achieve to draw a decision boundary of a similar shape. I generated the data from two bivariate normal distributions and I obtained only a decision boundaries with parabolic shapes (using a naive bayes classifier).

Then I pick the blue class from a mix of two bivariates normal distribution trying to generate some bimodal effect and obtain a more polynomial decision boundary but the plan didn't work.

enter image description here

Here is the visual way that I trying to tune the parameters to generate points. The blue are the two bivariate normal-distributions that I said before to generate 50 points from each other.

Someone who knows a way to generate data from a distribution to have control of the parameters and obtain a similar decision boundary as the first plot?

enter image description here

$\endgroup$
2
  • 1
    $\begingroup$ Thanks for showing the reference: You might use the following method to get a bivariate distribution with specified correlation: Suppose $X$ and $Z$ are independently distributed as $\mathsf{Norm}(0,1)$ and $-1 <\rho <1.$ Let $Y = X\rho + Z\sqrt{1-\rho^2}.$ Then $\mathrm{Cor}(X,Y) = \rho.$ // Then make each of the bi-modal distributions by sampling 50:50 from two suitably-centered bivariate normal distributions. $\endgroup$
    – BruceET
    Commented Apr 23, 2020 at 4:02
  • 1
    $\begingroup$ Please see stats.stackexchange.com/questions/81197/…. For details, search our site. $\endgroup$
    – whuber
    Commented Apr 23, 2020 at 13:29

0

Your Answer

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