summaryrefslogtreecommitdiff
path: root/data/mushroom/2svmlight.rb
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-06-14 19:03:21 +0200
committerPatrick Simianer <p@simianer.de>2014-06-14 19:03:21 +0200
commit5ddc763ab9953eebdaf78af4eb72288d7955b310 (patch)
treefffaf3d22173feae684b7c02ce86c67cf77c7fec /data/mushroom/2svmlight.rb
parent26c490f404731d053a6205719b6246502c07b449 (diff)
cleanup
Diffstat (limited to 'data/mushroom/2svmlight.rb')
-rwxr-xr-xdata/mushroom/2svmlight.rb39
1 files changed, 0 insertions, 39 deletions
diff --git a/data/mushroom/2svmlight.rb b/data/mushroom/2svmlight.rb
deleted file mode 100755
index e915f3b..0000000
--- a/data/mushroom/2svmlight.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env ruby
-
-
-lists = []
-0.upto(21) { lists << [] }
-cached = []
-while line = STDIN.gets
- line.strip!
- a = line.split ','
- cached << a
- 1.upto(22) { |i|
- lists[i-1] << a[i]
- }
-end
-lists.each { |list| list.uniq! }
-fmaps = []
-global_fid = 1
-0.upto(21) { fmaps << {} }
-lists.each_with_index { |list, i|
- list.each_with_index { |fval, j|
- fmaps[i][fval] = global_fid
- global_fid += 1
- }
-}
-cached.each { |i|
- label = i[0]
- if label == 'e'
- label = 1
- elsif label == 'p'
- label = -1
- else
- next
- end
- f = i[1..22]
- a = []
- f.each_with_index { |j,idx| a << "#{fmaps[idx][j]}:1.0" }
- puts "#{label} #{a.join ' '}"
-}
-