diff options
author | Christoph Helma <helma@in-silico.ch> | 2019-08-24 15:06:53 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2019-08-24 15:06:53 +0200 |
commit | 8e1e8b94539dbdd74bd4ac28295cbfd1b84036ab (patch) | |
tree | 28528e19dc6ed4cca7ed824e939dedd6c4acc94c /lib/classification.rb | |
parent | 1ee7de09c969e16fd11522d22179224e694b0161 (diff) | |
parent | 488ce9fe6d4b715680675861105b8c52a7535140 (diff) |
Merge remote-tracking branch 'origin/development'
Diffstat (limited to 'lib/classification.rb')
-rw-r--r-- | lib/classification.rb | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/lib/classification.rb b/lib/classification.rb index a875903..638492b 100644 --- a/lib/classification.rb +++ b/lib/classification.rb @@ -18,11 +18,6 @@ module OpenTox class_weights.each do |a,w| probabilities[a] = w.sum/weights.sum end - # DG: hack to ensure always two probability values - if probabilities.keys.uniq.size == 1 - missing_key = probabilities.keys.uniq[0].match(/^non/) ? probabilities.keys.uniq[0].sub(/non-/,"") : "non-"+probabilities.keys.uniq[0] - probabilities[missing_key] = 0.0 - end probabilities = probabilities.collect{|a,p| [a,weights.max*p]}.to_h p_max = probabilities.collect{|a,p| p}.max prediction = probabilities.key(p_max) |