dte2 / app.py
LovnishVerma's picture
Update app.py
7e6f1ae verified
raw
history blame contribute delete
577 Bytes
from flask import Flask, render_template, request
import joblib
app = Flask(__name__)
model = joblib.load('irismodel1.joblib')
@app.route('/')
def index():
return render_template('prediction.html')
@app.route('/prediction', methods=['POST', 'GET'])
def prediction():
sl = float(request.form['sl'])
sw = float(request.form['sw'])
pl = float(request.form['pl'])
pw = float(request.form['pw'])
pred = model.predict([[sl, sw, pl, pw]])[0]
return render_template('prediction.html', pred=pred)
if __name__ == '__main__':
app.run(debug=True)