diff options
author | Andreas Maunz <andreas@maunz.de> | 2011-05-26 12:22:07 +0200 |
---|---|---|
committer | Andreas Maunz <andreas@maunz.de> | 2011-05-26 12:22:07 +0200 |
commit | 065fdeb351f68d0445b66516ccf8e7cfcc7e2a1f (patch) | |
tree | 1816f8bef8da7fdd6f5ffade0eec9798b39d370e /lib/model.rb | |
parent | 43d0146eb5b3fed57731470d8d6c3db8f63221d0 (diff) |
Fixed prediction type switching
Diffstat (limited to 'lib/model.rb')
-rw-r--r-- | lib/model.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/model.rb b/lib/model.rb index 921335c..d63eef2 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -176,7 +176,10 @@ module OpenTox return @prediction_dataset if database_activity(subjectid) - if metadata[RDF.type].include?([OTA.ClassificationLazySingleTarget][0]) # AM: searching in metadata for classification + load_metadata(subjectid) + case OpenTox::Feature.find(metadata[OT.dependentVariables]).feature_type + when "classification" + # AM: Balancing, see http://www.maunz.de/wordpress/opentox/2011/balanced-lazar l = Array.new # larger s = Array.new # smaller fraction @@ -231,6 +234,7 @@ module OpenTox ### END AM balanced predictions else # no balancing as before + LOGGER.info "LAZAR: Unbalanced." neighbors (@prediction_algorithm.include? "svm" and params[:prop_kernel] == "true") ? props = get_props : props = nil prediction = eval("#{@prediction_algorithm}(@neighbors,{:similarity_algorithm => @similarity_algorithm, :p_values => @p_values}, props)") |