MCPcopy Create free account
hub / github.com/davisking/dlib / training_data

Function training_data

tools/python/test/test_svm_c_trainer.py:22–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20
21@pytest.fixture
22def training_data():
23 r = Random(0)
24 predictors = vectors()
25 sparse_predictors = sparse_vectors()
26 response = array()
27 for i in range(30):
28 for c in [-1, 1]:
29 response.append(c)
30 values = [r.random() + c * 0.5 for _ in range(3)]
31 predictors.append(vector(values))
32 sp = sparse_vector()
33 for i, v in enumerate(values):
34 sp.append(pair(i, v))
35 sparse_predictors.append(sp)
36 return predictors, sparse_predictors, response
37
38
39@pytest.mark.parametrize('trainer, class1_accuracy, class2_accuracy', [

Callers

nothing calls this directly

Calls 5

arrayClass · 0.90
vectorClass · 0.90
pairClass · 0.90
rangeFunction · 0.50
appendMethod · 0.45

Tested by

no test coverage detected