Skip to content

Commit 46a4540

Browse files
authored
Version2
1 parent 1585752 commit 46a4540

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+28482
-0
lines changed
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import numpy as np
2+
import pandas as pd
3+
from flask import Flask, request, jsonify, render_template
4+
import pickle
5+
6+
app = Flask(__name__,template_folder='templates')
7+
model = pickle.load(open('model.pkl', 'rb'))
8+
9+
@app.route('/')
10+
def home():
11+
return render_template('index.html')
12+
13+
@app.route('/predict',methods=['POST'])
14+
def predict():
15+
'''
16+
For rendering results on HTML GUI
17+
'''
18+
features = [x for x in request.form.values()]
19+
final_features = [np.array(features)]
20+
column_names=['R&DSpend','Administration','MarketingSpend','State']
21+
final_features=pd.DataFrame(final_features,columns=column_names)
22+
prediction= model.predict(final_features)
23+
temp=0.0
24+
for i in prediction:
25+
for j in i:
26+
temp=j
27+
return render_template('index.html', prediction_text='${}'.format(temp))
28+
1.85 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Flask==1.1.1
2+
seaborn==0.9.0
3+
numpy==1.16.2
4+
pandas==0.25.1
5+
matplotlib==3.0.3
6+
scikit_learn==0.23.1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The scss source files are available in the pro version.

0 commit comments

Comments
 (0)