From: ppetter1025 Date: Tue, 12 Jun 2018 14:10:12 +0000 (+0800) Subject: Fix a bug in svm_read_problem of python/liblinearutil.py so float(val) rather than... X-Git-Tag: v221~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=92466fbf814414c817f30aafd843383268d0b4e0;p=liblinear Fix a bug in svm_read_problem of python/liblinearutil.py so float(val) rather than val is used to detect zero fearue values. --- diff --git a/python/liblinearutil.py b/python/liblinearutil.py index 3102a56..d5cc033 100644 --- a/python/liblinearutil.py +++ b/python/liblinearutil.py @@ -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: