blob: dee2ba97d9f3d9200494020bf6d4f24ea86fb74e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
require 'sinatra'
require "sinatra/reloader" if development?
require_relative 'nanoparticles.rb'
also_reload './nanoparticles.rb'
get '/?' do
data = JSON.parse(File.read("./data.json"))
query_features = JSON.parse(File.read("./query-features.json"))
@example = data[data.keys.sample]["physchem"].select{|f,v| query_features.include? f}
# create a data entry form with @example as default values
end
post '/?' do
@prediction = predict params
# display prediction with
# query + prediction (or match if available)
# neighbors: id, composition, physchem, tox, similarity
end
|