diff options
author | gebele <gebele@in-silico.ch> | 2016-01-22 23:18:56 +0100 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2016-01-22 23:18:56 +0100 |
commit | 88ac5fbe3d8d3141fbad81460b13d6cb8284da26 (patch) | |
tree | 783f9da714155a5848c84905159a51b002c6a80c /application.rb | |
parent | 09b750e1639d351d24cff3cca74681c761b17503 (diff) |
refined prediction
Diffstat (limited to 'application.rb')
-rw-r--r-- | application.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/application.rb b/application.rb index 50f027a..16985d5 100644 --- a/application.rb +++ b/application.rb @@ -10,8 +10,9 @@ get '/?' do end get '/predict/?' 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} #@json_example = JSON.pretty_generate(@example) haml :predict end |