Permalink
Browse files

Workaround for small datasets.

  • Loading branch information...
1 parent 9245dbb commit d0ee7e993f851407263962e0d8d3b9c3a2a76de6 @davor davor committed Mar 9, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/utils.rb
View
@@ -55,12 +55,16 @@ def self.pc_descriptors(params)
master = jl_master if jl_master
master = ambit_master if ambit_master
end
-
+
parser = OpenTox::Parser::Spreadsheets.new
ds = OpenTox::Dataset.new
ds.save
parser.dataset = ds
- ds = parser.load_csv(master.collect{|r| r.join(",")}.join("\n"),false,false,true)
+ if compounds.size == 1
+ ds = parser.load_csv(master.collect{|r| r.join(",")}.join("\n"),false,true,false) # all_numeric = true, all features should be treated as numeric
+ else
+ ds = parser.load_csv(master.collect{|r| r.join(",")}.join("\n"),false,false,true) # del_nominal = true, which removes nominal features
+ end
ds.save
rescue Exception => e

0 comments on commit d0ee7e9

Please sign in to comment.