From 61b98e011d4b32e88629d5a07d7b84a6abdded64 Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 10 Feb 2017 07:07:12 +0000 Subject: added update script --- create_prediction_models.rb | 13 ++++--------- update_prediction_models.rb | 8 ++++++++ 2 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 update_prediction_models.rb diff --git a/create_prediction_models.rb b/create_prediction_models.rb index 9cecbb2..c653f01 100644 --- a/create_prediction_models.rb +++ b/create_prediction_models.rb @@ -5,7 +5,7 @@ include OpenTox $mongo.database.drop $gridfs = $mongo.database.fs # recreate GridFS indexes -=begin +#=begin # classification models Dir["classification/*csv"].each do |file| unless file.match(/hamster/) @@ -14,12 +14,12 @@ Dir["classification/*csv"].each do |file| end #=end -=begin +#=begin # regression models Dir["regression/*log10.csv"].each do |file| Model::Validation.from_csv_file file end -=end +#=end ## nano-lazar =begin @@ -63,10 +63,5 @@ end =end # save -# local -#`mongodump -h 127.0.0.1 -d production` +`mongodump -h 127.0.0.1 -d production` #`mongorestore --host 127.0.0.1` - -# to/from docker volume /dump -#`sudo mongodump -h 127.0.0.1 -o /dump -d production` -#`sudo mongorestore -h 127.0.0.1 /dump` diff --git a/update_prediction_models.rb b/update_prediction_models.rb new file mode 100644 index 0000000..496f7dc --- /dev/null +++ b/update_prediction_models.rb @@ -0,0 +1,8 @@ +ENV["LAZAR_ENV"] = "production" +require_relative '../lazar/lib/lazar' +#require 'lazar' +include OpenTox +$mongo.database.drop +$gridfs = $mongo.database.fs # recreate GridFS indexes + +`mongorestore --host 127.0.0.1` -- cgit v1.2.3