diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-06-17 12:11:02 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-06-17 12:11:02 +0200 |
commit | a5b5c0790de08b4deee7d72851070201cca1c744 (patch) | |
tree | c1b944c378c0601da8611fa9278bba99963a4087 | |
parent | 5d66676376bd491344f06294a0921575aa9c39f6 (diff) |
prefer prediction_feature, use Model.dependentVariables if no prediction feature is specified
-rwxr-xr-x | validation/validation_service.rb | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/validation/validation_service.rb b/validation/validation_service.rb index 8d64cd1..77cc694 100755 --- a/validation/validation_service.rb +++ b/validation/validation_service.rb @@ -135,7 +135,6 @@ module Validation params[alg_param[0].to_sym] = alg_param[1] end end - LOGGER.debug "building model '"+algorithm_uri.to_s+"' "+params.inspect algorithm = OpenTox::Algorithm::Generic.new(algorithm_uri) params[:subjectid] = subjectid @@ -169,26 +168,12 @@ module Validation model = OpenTox::Model::Generic.find(self.model_uri, self.subjectid) unless self.algorithm_uri -# self.attributes = { :algorithm_uri => model.algorithm } -# self.save! - #self.update :algorithm_uri => model.algorithm self.algorithm_uri = model.metadata[OT.algorithm] end - - if self.prediction_feature and model.uri=~/ambit2\/model/ - LOGGER.warn "REMOVE AMBIT HACK TO __NOT__ RELY ON DEPENDENT VARIABLE" - else + if self.prediction_feature.to_s.size==0 dependentVariables = model.metadata[OT.dependentVariables] - if self.prediction_feature - raise OpenTox::NotFoundError.new "error validating model: model.dependent_variable != validation.prediction_feature ("+ - dependentVariables.to_s+" != "+self.prediction_feature+"), model-metadata is "+model.metadata.inspect if self.prediction_feature!=dependentVariables - else - raise OpenTox::NotFoundError.new "model has no dependentVariables specified, please give prediction feature for model validation" unless dependentVariables - #self.attributes = { :prediction_feature => model.dependentVariables } - #self.save! - #self.update :prediction_feature => model.dependentVariables - self.prediction_feature = model.metadata[OT.dependentVariables] - end + raise OpenTox::NotFoundError.new "model has no dependentVariables specified, please give prediction_feature for model validation" unless dependentVariables + self.prediction_feature = model.metadata[OT.dependentVariables] end prediction_dataset_uri = "" |