update libsvm file to start with 1 index
This commit is contained in:
parent
86871d4be9
commit
a894ab6898
@ -18,7 +18,7 @@ def loadfmap( fname ):
|
||||
if it.strip() == '':
|
||||
continue
|
||||
k , v = it.split('=')
|
||||
fmap[ idx ][ v ] = len(nmap)
|
||||
fmap[ idx ][ v ] = len(nmap) + 1
|
||||
nmap[ len(nmap) ] = ftype+'='+k
|
||||
return fmap, nmap
|
||||
|
||||
@ -45,5 +45,3 @@ for l in open( 'agaricus-lepiota.data' ):
|
||||
fo.write('\n')
|
||||
|
||||
fo.close()
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user