Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/vowpal_wabbit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorHal Daume III <me@hal3.name>2014-11-04 06:11:21 +0300
committerHal Daume III <me@hal3.name>2014-11-04 06:11:21 +0300
commit4258f9fd7498f62b26c48cbafe7450d10992713c (patch)
treefe45744c209e514331ed230e597d4f3bd1db6060 /python
parent06876df1ca08f99694863620af2428b5fd1ee2ab (diff)
remove bug i introduced
Diffstat (limited to 'python')
-rw-r--r--python/pyvw.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/python/pyvw.py b/python/pyvw.py
index ae157560..e9a688ce 100644
--- a/python/pyvw.py
+++ b/python/pyvw.py
@@ -514,20 +514,20 @@ class example(pylibvw.example):
Fails if setup has run."""
ns = self.get_ns(ns)
self.ensure_namespace_exists(ns)
- self.push_feature_list(self.vw, ns.ord_ns, featureList)
- # ns_hash = self.vw.hash_space(ns.ns)
-
- # for feature in featureList:
- # if isinstance(feature, int) or isinstance(feature, str):
- # f = feature
- # v = 1.
- # elif isinstance(feature, tuple) and len(feature) == 2:
- # f = feature[0]
- # v = feature[1]
- # else:
- # raise Exception('malformed feature to push of type: ' + str(type(feature)))
-
- # self.push_feature(ns, f, v, ns_hash)
+ #self.push_feature_list(self.vw, ns.ord_ns, featureList)
+ ns_hash = self.vw.hash_space(ns.ns)
+
+ for feature in featureList:
+ if isinstance(feature, int) or isinstance(feature, str):
+ f = feature
+ v = 1.
+ elif isinstance(feature, tuple) and len(feature) == 2:
+ f = feature[0]
+ v = feature[1]
+ else:
+ raise Exception('malformed feature to push of type: ' + str(type(feature)))
+
+ self.push_feature(ns, f, v, ns_hash)
def finish(self):
"""Tell VW that you're done with this example and it can