app.py - from flask import Flask render_template request from sklearn.externals import joblib import pandas as pd import numpy as np app = Flask_name

app.py - from flask import Flask render_template request...

This preview shows page 1 out of 1 page.

from flask import Flask, render_template, request from sklearn.externals import joblib import pandas as pd import numpy as np app = Flask(__name__) mul_reg = open("multiple_regression_model.pkl", "rb") ml_model = joblib.load(mul_reg) @app.route("/") def home(): return render_template('home.html') @app.route("/predict", methods=['GET', 'POST']) def predict(): print("I was here 1") if request.method == 'POST': print(request.form.get('NewYork')) try: NewYork = float(request.form['NewYork']) California = float(request.form['California']) Florida = float(request.form['Florida']) RnD_Spend = float(request.form['RnD_Spend'])
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Fall '16
  • U.S. state, Major League Baseball, National Hockey League, National Basketball Association

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture