diff options
author | Christoph Helma <helma@in-silico.ch> | 2016-01-22 11:13:41 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2016-01-22 11:13:41 +0100 |
commit | 8ebb209d00fd11ccdc86bc1e695f4bb9b9300f33 (patch) | |
tree | 86c7f7c01925f7c5b72b6dff34df6360564df4a9 | |
parent | d8f1e75ba45cb770f421fa950861c6ff502d64dd (diff) |
example with relevant features only
-rw-r--r-- | application.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/application.rb b/application.rb index 703932f..7ff09be 100644 --- a/application.rb +++ b/application.rb @@ -4,11 +4,10 @@ require_relative 'nanoparticles.rb' also_reload './nanoparticles.rb' get '/?' do - @data = JSON.parse(File.read("./data.json")) - @example = @data[@data.keys.sample]["physchem"] + data = JSON.parse(File.read("./data.json")) + relevant_features = JSON.parse(File.read("./relevant-features.json")) + @example = data[data.keys.sample]["physchem"].select{|f,v| relevant_features.keys.include? f} # create a data entry form with @example as default values - #content_type :json - #JSON.pretty_generate(@example) end post '/?' do @@ -16,6 +15,4 @@ post '/?' do # display prediction with # query + prediction (or match if available) # neighbors: id, composition, physchem, tox, similarity - #content_type :json - #JSON.pretty_generate(@example) end |