From 88ac5fbe3d8d3141fbad81460b13d6cb8284da26 Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 22 Jan 2016 23:18:56 +0100 Subject: refined prediction --- application.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'application.rb') 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 -- cgit v1.2.3