Fix #3638: Binary classification demo should produce LIBSVM with 0-based indexing (#3652)

This commit is contained in:
Philip Hyunsu Cho 2018-08-30 13:18:42 -07:00 committed by GitHub
parent 7b1427f926
commit 10c31ab2cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ def loadfmap( fname ):
if it.strip() == '': if it.strip() == '':
continue continue
k , v = it.split('=') k , v = it.split('=')
fmap[ idx ][ v ] = len(nmap) + 1 fmap[ idx ][ v ] = len(nmap)
nmap[ len(nmap) ] = ftype+'='+k nmap[ len(nmap) ] = ftype+'='+k
return fmap, nmap return fmap, nmap