-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
executable file
·31 lines (23 loc) · 874 Bytes
/
Copy pathapp.py
File metadata and controls
executable file
·31 lines (23 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Importing essential libraries
from flask import Flask, render_template, request
import pickle
from sklearn.preprocessing import StandardScaler
sc = StandardScaler()
import numpy as np
# Load the CLassifier model
classifier = pickle.load(open("classifier.pkl", "rb"))
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
@app.route('/predict', methods=['POST'])
def predict():
if request.method == 'POST':
variance = float(request.form['variance'])
skewness = float(request.form['skewness'])
curtosis = float(request.form['curtosis'])
entropy = float(request.form['entropy'])
prediction=classifier.predict([[variance,skewness,curtosis,entropy]])
return render_template('result.html', prediction=prediction)
if __name__ == '__main__':
app.run(debug=True)