MCPcopy Create free account
hub / github.com/wepe/MachineLearning / gen_non_lin_separable_data

Function gen_non_lin_separable_data

SVM/SVM_by_QP/testSVM.py:15–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13 return X1, y1, X2, y2
14
15def gen_non_lin_separable_data():
16 mean1 = [-1, 2]
17 mean2 = [1, -1]
18 mean3 = [4, -4]
19 mean4 = [-4, 4]
20 cov = [[1.0,0.8], [0.8, 1.0]]
21 X1 = np.random.multivariate_normal(mean1, cov, 50)
22 X1 = np.vstack((X1, np.random.multivariate_normal(mean3, cov, 50)))
23 y1 = np.ones(len(X1))
24 X2 = np.random.multivariate_normal(mean2, cov, 50)
25 X2 = np.vstack((X2, np.random.multivariate_normal(mean4, cov, 50)))
26 y2 = np.ones(len(X2)) * -1
27 return X1, y1, X2, y2
28
29def gen_lin_separable_overlap_data():
30 # generate training data in the 2-d case

Callers 1

test_non_linearFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected