summaryrefslogtreecommitdiff
path: root/lazar.rb
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2011-05-17 15:17:51 +0200
committerAndreas Maunz <andreas@maunz.de>2011-05-17 15:17:51 +0200
commite5cc33df0c3b75b655879181cc3391edb13a0711 (patch)
tree167f6b43be8e3a54e9f679c76e53ef362374e094 /lazar.rb
parenta66a14176bbef216c502f3d35d8c7a6d3e71a6fa (diff)
Added override flag prediction_algorithm support in params
Diffstat (limited to 'lazar.rb')
-rw-r--r--lazar.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lazar.rb b/lazar.rb
index 45123f0..ec055ee 100644
--- a/lazar.rb
+++ b/lazar.rb
@@ -122,6 +122,9 @@ post '/lazar/?' do
@training_classes = training_activities.feature_classes(prediction_feature.uri, @subjectid) if prediction_feature.feature_type == "classification"
lazar.prediction_algorithm = "Neighbors.local_svm_regression" if prediction_feature.feature_type == "regression"
+ # AM: allow prediction_algorithm override by user for classification AND regression
+ lazar.prediction_algorithm = "Neighbors.#{params[:prediction_algorithm]}" unless params[:prediction_algorithm].nil?
+
training_activities.data_entries.each do |compound,entry|
lazar.activities[compound] = [] unless lazar.activities[compound]
unless entry[prediction_feature.uri].empty?