Skip to content

Commit a894ab6

Browse files
committed
update libsvm file to start with 1 index
1 parent 86871d4 commit a894ab6

File tree

3 files changed

+8125
-8127
lines changed

3 files changed

+8125
-8127
lines changed

demo/binary_classification/mapfeat.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def loadfmap( fname ):
1818
if it.strip() == '':
1919
continue
2020
k , v = it.split('=')
21-
fmap[ idx ][ v ] = len(nmap)
21+
fmap[ idx ][ v ] = len(nmap) + 1
2222
nmap[ len(nmap) ] = ftype+'='+k
2323
return fmap, nmap
2424

@@ -45,5 +45,3 @@ def write_nmap( fo, nmap ):
4545
fo.write('\n')
4646

4747
fo.close()
48-
49-

0 commit comments

Comments
 (0)