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

Function gen_lin_separable_data

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

Source from the content-addressed store, hash-verified

2import pylab as pl
3
4def gen_lin_separable_data():
5 # generate training data in the 2-d case
6 mean1 = np.array([0, 2])
7 mean2 = np.array([2, 0])
8 cov = np.array([[0.8, 0.6], [0.6, 0.8]])
9 X1 = np.random.multivariate_normal(mean1, cov, 100)
10 y1 = np.ones(len(X1))
11 X2 = np.random.multivariate_normal(mean2, cov, 100)
12 y2 = np.ones(len(X2)) * -1
13 return X1, y1, X2, y2
14
15def gen_non_lin_separable_data():
16 mean1 = [-1, 2]

Callers 1

test_linearFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected