MCPcopy Index your code
hub / github.com/wepe/MachineLearning / gen_lin_separable_overlap_data

Function gen_lin_separable_overlap_data

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

Source from the content-addressed store, hash-verified

27 return X1, y1, X2, y2
28
29def gen_lin_separable_overlap_data():
30 # generate training data in the 2-d case
31 mean1 = np.array([0, 2])
32 mean2 = np.array([2, 0])
33 cov = np.array([[1.5, 1.0], [1.0, 1.5]])
34 X1 = np.random.multivariate_normal(mean1, cov, 100)
35 y1 = np.ones(len(X1))
36 X2 = np.random.multivariate_normal(mean2, cov, 100)
37 y2 = np.ones(len(X2)) * -1
38 return X1, y1, X2, y2
39
40def split_train(X1, y1, X2, y2):
41 X1_train = X1[:90]

Callers 1

test_softFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected