From 77c885b7394aa11ba5e59eb60884205332efa31a Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Thu, 26 May 2011 08:38:21 +0200 Subject: 7th v --- lib/algorithm.rb | 2 ++ lib/model.rb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/algorithm.rb b/lib/algorithm.rb index e089184..91e075a 100644 --- a/lib/algorithm.rb +++ b/lib/algorithm.rb @@ -227,6 +227,7 @@ module OpenTox # @param [Array] props, propositionalization of neighbors and query structure e.g. [ Array_for_q, two-nested-Arrays_for_n ] # @return [Numeric] A prediction value. def self.local_svm(neighbors, acts, sims, type, params) + LOGGER.debug "Local SVM (Weighted Tanimoto Kernel)." neighbor_matches = neighbors.collect{ |n| n[:features] } # URIs of matches gram_matrix = [] # square matrix of similarities between neighbors; implements weighted tanimoto kernel if neighbor_matches.size == 0 @@ -299,6 +300,7 @@ module OpenTox # @return [Numeric] A prediction value. def self.local_svm_prop(props, acts, type, params) + LOGGER.debug "Local SVM (Propositionalization / Kernlab Kernel)." n_prop = props[0] # is a matrix, i.e. two nested Arrays. q_prop = props[1] # is an Array. diff --git a/lib/model.rb b/lib/model.rb index 1a5aa37..921335c 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -214,7 +214,7 @@ module OpenTox (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_balanced(s, l, position, lr_size) # get ratio fraction of larger part - props = get_props + (@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)") if prediction_best.nil? || prediction[:confidence].abs > prediction_best[:confidence].abs prediction_best=prediction @@ -232,7 +232,7 @@ module OpenTox else # no balancing as before neighbors - props = get_props + (@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)") end -- cgit v1.2.3