Created
June 29, 2020 11:14
-
-
Save bharatc9530/c3e0ae561a4e9c3fcb1ee51f57b24b81 to your computer and use it in GitHub Desktop.
model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template, request | |
import pickle | |
import numpy as np | |
app = Flask(__name__) | |
model = pickle.load(open('iri.pkl', 'rb')) | |
@app.route('/') | |
def man(): | |
return render_template('home.html') | |
@app.route('/predict', methods=['POST']) | |
def home(): | |
data1 = request.form['a'] | |
data2 = request.form['b'] | |
data3 = request.form['c'] | |
data4 = request.form['d'] | |
arr = np.array([[data1, data2, data3, data4]]) | |
pred = model.predict(arr) | |
return render_template('after.html', data=pred) | |
if __name__ == "__main__": | |
app.run(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment