Write a function that takes parameters r1 , r2 , n and generates random points (x1,x2) as
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a function that takes parameters r1 , r2 , n and generates random points (x1,x2) as follows -
- n random points that lie within a circle with center at (0,0) and radius r1 → These points belong to class 'inner'
- n random points that lie outside circle with center at (0,0) and radius r1 but inside circle with center at (0,0) and radius r2 → These points belong to class 'outer'
The function gen_random should return X , Cls :
- X is a numpy array of shape (2n,2) which has the 2n random points generated as above.
- Cls is a numpy array of shape (2n,) which contains the value of the class corresponding to each point in X (values will be either 'inner' or 'outer')
Related Book For
Posted Date: