summaryrefslogtreecommitdiff
path: root/webapp/fs.rb
blob: 670885f2803f9b84cd796718ba8ec10704c159c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
=begin
* Name: fs.rb
* Description: feature selection
* Author: Andreas Maunz <andreas@maunz.de>
* Date: 10/2012
=end

module OpenTox
  class Application < Service

  # Get list of feature selection algorithms
  # @return [text/uri-list] URIs
  get '/fs/?' do
    list = [ url_for('/fs/rfe', :full) ].join("\n") + "\n"
    format_output(list)
  end
  
  # Get representation of Recursive Feature Elimination algorithm
  # @return [String] Representation
  get "/fs/rfe/?" do
    algorithm = OpenTox::Algorithm.new(url_for('/fs/rfe',:full))
    algorithm.metadata = {
      DC.title => 'Recursive Feature Elimination',
      DC.creator => "andreas@maunz.de",
      RDF.type => [OT.Algorithm,OTA.PatternMiningSupervised]
    }
    algorithm.parameters = [
        { DC.description => "Dataset URI", OT.paramScope => "mandatory", DC.title => "dataset_uri" },
        { DC.description => "Prediction Feature URI", OT.paramScope => "mandatory", DC.title => "prediction_feature" },
        { DC.description => "Feature Dataset URI", OT.paramScope => "mandatory", DC.title => "feature_dataset_uri" },
        { DC.description => "Delete Instances with missing values", OT.paramScope => "optional", DC.title => "del_missing" }
    ]
    format_output(algorithm)
  end
  
  end
end