Generate a 1000 two-dimensional dataset, X that is of two classes and plot. The 1 500 data vectors are modeled by the Gaussian distribution with mean, m1 = [ 8, 8] T and the rest 500 data vectors are modeled by the Gaussian distribution with mean m2 = [ 8, 8] . The covariance matrix for both distributions are T S = [0.3 1.5 1.5 9.0 ] Use the same prescription to generate another data 200 and create a test dataset X .
Asked
Active
Viewed 1,193 times
-1

desertnaut
- 57,590
- 26
- 140
- 166

Akashdeep Singh
- 1
- 2
-
Can you show us the research you did before asking the question? – rikyeah Feb 09 '22 at 22:29
-
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Feb 20 '22 at 05:54
1 Answers
0
Using numpy.random.multivariate_normal you can do that. Using the info you provided, you can do something like:
mean = [8,8]
cov = [[0.3, 1.5], [1.5, 9.0]]
x, y = np.random.multivariate_normal(mean, cov, 200).T

rikyeah
- 1,896
- 4
- 11
- 21