diff options
author | mguetlein <martin.guetlein@gmail.com> | 2010-09-07 12:05:49 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2010-09-07 12:05:49 +0200 |
commit | 5fd717dec9735895310f99c218f3dcac05a2e179 (patch) | |
tree | cd51bc8edf2a34ad56ffd87a631133cdceb8362d /reach_reports | |
parent | a3b0b9fbd81303e212bf063b9bf14f5f82941c36 (diff) |
check for unique cvs in qmrf report generation
Diffstat (limited to 'reach_reports')
-rw-r--r-- | reach_reports/reach_service.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/reach_reports/reach_service.rb b/reach_reports/reach_service.rb index 634f2b4..42bb185 100644 --- a/reach_reports/reach_service.rb +++ b/reach_reports/reach_service.rb @@ -121,13 +121,25 @@ module ReachReports if model.algorithm cvs = Lib::Crossvalidation.find(:all, :conditions => {:algorithm_uri => model.algorithm}) cvs = [] unless cvs + uniq_cvs = [] + cvs.each do |cv| + match = false + uniq_cvs.each do |cv2| + if cv2.dataset_uri == cv.dataset_uri and cv.num_folds == cv2.num_folds and cv.stratified == cv2.stratified and cv.random_seed == cv2.random_seed + match = true + break + end + end + uniq_cvs << cv unless match + end + lmo = [ "found "+cvs.size.to_s+" crossvalidation/s for algorithm '"+model.algorithm ] lmo << "" - cvs.each do |cv| + uniq_cvs.each do |cv| lmo << "crossvalidation: "+cv.crossvalidation_uri lmo << "dataset (see 9.3 Validation data): "+cv.dataset_uri val_datasets << cv.dataset_uri - lmo << "num-folds: "+cv.num_folds.to_s + lmo << "settings: num-folds="+cv.num_folds.to_s+", random-seed="+cv.random_seed.to_s+", stratified:"+cv.stratified.to_s val = YAML.load( OpenTox::RestClientWrapper.get File.join(cv.crossvalidation_uri,"statistics") ) if classification lmo << "percent_correct: "+val[:classification_statistics][:percent_correct].to_s |