diff options
author | mguetlein <martin.guetlein@gmail.com> | 2010-09-14 16:45:14 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2010-09-14 16:45:14 +0200 |
commit | 6beb0004d97f9620d1f5c4f5465c191171c31fb1 (patch) | |
tree | ae5e4e19b966ccdda10f35bdcdcdce3afbaa478d /reach_reports | |
parent | 11105ce48ce21750dd88a8cf48a37cefdacb87cf (diff) |
add hack to distinguish between lazar cvs (regr vs class)
Diffstat (limited to 'reach_reports')
-rw-r--r-- | reach_reports/reach_service.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/reach_reports/reach_service.rb b/reach_reports/reach_service.rb index 8c8618b..8c485d9 100644 --- a/reach_reports/reach_service.rb +++ b/reach_reports/reach_service.rb @@ -61,7 +61,7 @@ module ReachReports model = OpenTox::Model::PredictionModel.find(r.model_uri) classification = model.classification? - + # chapter 1 r.qsar_identifier = QsarIdentifier.new r.qsar_identifier.qsar_title = model.title @@ -121,14 +121,18 @@ module ReachReports cvs = [] unless cvs uniq_cvs = [] cvs.each do |cv| - match = false - uniq_cvs.each do |cv2| - if cv.dataset_uri == cv2.dataset_uri and cv.num_folds == cv2.num_folds and cv.stratified == cv2.stratified and cv.random_seed == cv2.random_seed - match = true - break + # PENDING: cv classification hack + val = Validation::Validation.first( :all, :conditions => { :crossvalidation_id => cv.id } ) + if (val.classification_statistics!=nil) == classification + match = false + uniq_cvs.each do |cv2| + if cv.dataset_uri == cv2.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 - uniq_cvs << cv unless match end lmo = [ "found "+cvs.size.to_s+" crossvalidation/s for algorithm '"+model.algorithm ] |