Group CLI demo into subdirectory. (#6258)
CLI is not most developed interface. Putting them into correct directory can help new users to avoid it as most of the use cases are from a language binding.
This commit is contained in:
9
demo/CLI/yearpredMSD/csv2libsvm.py
Executable file
9
demo/CLI/yearpredMSD/csv2libsvm.py
Executable file
@@ -0,0 +1,9 @@
|
||||
import sys
|
||||
fo = open(sys.argv[2], 'w')
|
||||
|
||||
for l in open(sys.argv[1]):
|
||||
arr = l.split(',')
|
||||
fo.write('%s' % arr[0])
|
||||
for i in range(len(arr) - 1):
|
||||
fo.write(' %d:%s' % (i, arr[i+1]))
|
||||
fo.close()
|
||||
Reference in New Issue
Block a user