]> granicus.if.org Git - liblinear/commitdiff
Fix a bug in svm_read_problem of python/liblinearutil.py so float(val) rather than...
authorppetter1025 <peter58972@gmail.com>
Tue, 12 Jun 2018 14:10:12 +0000 (22:10 +0800)
committerppetter1025 <peter58972@gmail.com>
Tue, 12 Jun 2018 14:10:12 +0000 (22:10 +0800)
python/liblinearutil.py

index 3102a562919ce5c0f4d1172ac790873090fc4481..d5cc033359a14d693aa037fa5ae167b18384e282 100644 (file)
@@ -47,7 +47,7 @@ def svm_read_problem(data_file_name, return_scipy=False):
                        xi = {}
                        for e in features.split():
                                ind, val = e.split(":")
-                               if val != 0:
+                               if float(val) != 0:
                                        xi[int(ind)] = float(val)
                        prob_x += [xi]
        if scipy != None and return_scipy: