summaryrefslogtreecommitdiff
path: root/lib/model.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/model.rb')
-rw-r--r--lib/model.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/model.rb b/lib/model.rb
index d63eef2..7c2ef58 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -179,10 +179,12 @@ module OpenTox
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
+
+ raise "no fingerprints in model" if @fingerprints.size==0
+
@fingerprints.each do |training_compound,training_features|
@activities[training_compound].each do |act|
case act.to_s
@@ -233,7 +235,7 @@ module OpenTox
@neighbors=neighbors_best
### END AM balanced predictions
- else # no balancing as before
+ else # regression case: no balancing
LOGGER.info "LAZAR: Unbalanced."
neighbors
(@prediction_algorithm.include? "svm" and params[:prop_kernel] == "true") ? props = get_props : props = nil