MCPcopy Create free account
hub / github.com/SeldonIO/seldon-server / test_dict_feature

Method test_dict_feature

python/seldon/tests/test_vw.py:95–105  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

93
94
95 def test_dict_feature(self):
96 t = vw.VWClassifier(target="target")
97 try:
98 df = pd.DataFrame.from_dict([{"target":"1","df":{"1":0.234,"2":0.1}},{"target":"2","df":{"1":0.5}}])
99 t.fit(df)
100 scores = t.predict_proba(df)
101 print scores
102 self.assertEquals(scores.shape[0],2)
103 self.assertEquals(scores.shape[1],2)
104 finally:
105 t.close()
106
107 def test_list_feature(self):
108 t = vw.VWClassifier(target="target",num_iterations=10)

Callers

nothing calls this directly

Calls 3

fitMethod · 0.95
predict_probaMethod · 0.95
closeMethod · 0.95

Tested by

no test coverage detected