diff options
author | mguetlein <martin.guetlein@gmail.com> | 2012-04-02 16:11:28 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2012-04-02 16:11:28 +0200 |
commit | 324e7f2dc7c8417fd5af0a084f06ecc92de41d48 (patch) | |
tree | 2a1e60ac26b1764450441eb0431ca694171e012b /lib/ot_predictions.rb | |
parent | 8a199a09a6d9ac8b0349af0d7c5b5320bdcec9b5 (diff) |
new stratified type super added to crossvalidation and traning-test-split validation, add some more metadata to crossvaldiation, add validation_uri to predictions in crossvaldiation-report
Diffstat (limited to 'lib/ot_predictions.rb')
-rwxr-xr-x | lib/ot_predictions.rb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/ot_predictions.rb b/lib/ot_predictions.rb index 3be845b..2752fcc 100755 --- a/lib/ot_predictions.rb +++ b/lib/ot_predictions.rb @@ -35,7 +35,7 @@ module Lib OTPredictions.to_array( [self] ) end - def self.to_array( predictions, add_pic=false, format=false ) + def self.to_array( predictions, add_pic=false, format=false, validation_uris=nil ) confidence_available = false predictions.each do |p| @@ -43,7 +43,10 @@ module Lib end res = [] conf_column = nil + count = 0 predictions.each do |p| + v_uris = validation_uris[count] if validation_uris + count += 1 (0..p.num_instances-1).each do |i| a = [] @@ -75,6 +78,9 @@ module Lib conf_column = a.size if conf_column==nil a << p.confidence_value(i) end + if validation_uris + a << v_uris[i] + end a << p.identifier(i) res << a end @@ -90,12 +96,13 @@ module Lib end end header = [] - header << "compound" if add_pic - header << "actual value" - header << "predicted value" - header << "classification" if predictions[0].feature_type=="classification" - header << "confidence value" if predictions[0].confidence_values_available? - header << "compound-uri" + header << "Compound" if add_pic + header << "Actual value" + header << "Predicted value" + header << "Classification" if predictions[0].feature_type=="classification" + header << "Confidence value" if predictions[0].confidence_values_available? + header << "Validation URI" if validation_uris + header << "Compound URI" res.insert(0, header) return res |