From 32b7faa44ef70194e0ae1c5e43948eea785f9d04 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 19 May 2011 17:03:50 +0200 Subject: Fixed neighbor selection --- lib/model.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/model.rb') diff --git a/lib/model.rb b/lib/model.rb index 7acd8f2..998d2dc 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -216,7 +216,7 @@ module OpenTox for i in 1..modulo[0] do (i == modulo[0]) && (slack>0) ? lr_size = s.size + slack : lr_size = s.size + addon # determine fraction LOGGER.info "BLAZAR: Neighbors round #{i}: #{position} + #{lr_size}." - neighbors(s, l, position, lr_size) # get ratio fraction of larger part + neighbors_balanced(s, l, position, lr_size) # get ratio fraction of larger part prediction = eval("#{@prediction_algorithm}(@neighbors,{:similarity_algorithm => @similarity_algorithm, :p_values => @p_values})") if prediction_best.nil? || prediction[:confidence].abs > prediction_best[:confidence].abs prediction_best=prediction @@ -325,7 +325,7 @@ module OpenTox end # Find neighbors and store them as object variable - def neighbors(s=nil, l=nil, start=nil, offset=nil) + def neighbors_balanced(s, l, start, offset) @compound_features = eval("#{@feature_calculation_algorithm}(@compound,@features)") if @feature_calculation_algorithm @neighbors = [] -- cgit v1.2.3