machine learning - Python program running in memory -


i have python program loads logistic regression model. trying make prediction new incoming data every 5 seconds. incoming data passed code command line argument. program runs ok dont want keep loading model every 5 seconds. there way have model loaded in memory? code below

loaded_model = joblib.load(r'c:\lr_model.sav') dataset = ast.literal_eval(sys.argv[1]) result = loaded_model.predict(dataset) 

thank you

memory bound process, once process exits it's memory freed. if want keep data loaded, you'll need rewrite program server process , setup communication protocol client ask new prediction (http seems fit here).


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -