def compare_IRR(): print "Loading model..." try: model = load_from_pickle("pickle/model.pkl") except OSError, IOError: print "Model not found. Initializing training process, this might take some time..." model = initialize_model()
def compare_IRR(): print "Loading model..." try: model = load_from_pickle('pickle/model.pkl') except OSError, IOError: print "Model not found. Initializing training process, this might take some time..." model = initialize_model()
def run_process(): ''' Main process for app, invoked when administrator is at /refresh. Collects, processes and stores data, as well as calculates expected IRR and other metrics for data table and charts. Returns: Loan details to populate data table at /index. numpy array. ''' print "Requesting loan details..." loan_results, loan_details = request_loan_data() print "Inserting results of API request to database..." try: insert_into_mongodb(loan_results, loan_details) except Exception: print "MongoDB error, proceeding to next step..." print "Loading model..." try: model = load_from_pickle('pickle/model.pkl') except OSError, IOError: print "Model not found. Initializing training process, this might take some time..." model = initialize_model()