Session Ready
Exercise

Generating a 2d radially separable dataset

In this exercise you will create a 2d radially separable dataset containing 400 uniformly distributed data points.

Instructions
100 XP
  • Generate a data frame df with:
    • 400 points with variables x1 and x2.
    • x1 and x2 uniformly distributed in (-1, 1).
  • Introduce a circular boundary of radius 0.8, centred at the origin.
  • Create df$y, which takes value -1 or 1 depending on whether a point lies within or outside the circle.