'How to create a N = 1000 , 2 dimensional 2 classes dataset given mean = [-8,8]T, covariance = [ [0.3 1.5] [1.5 9.0] ]
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 .
Solution 1:[1]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | rikyeah |
