Gagan0141 commited on
Commit
0016257
·
verified ·
1 Parent(s): 48e469f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -27
app.py CHANGED
@@ -23,8 +23,8 @@ supabase = create_client(SUPABASE_URL, SUPABASE_KEY)
23
  model = sio.load("rf_house_price_model.skops")
24
  #titanic_model = joblib.load("titanic_rf_model.joblib")
25
  titanic_model = sio.load("titanic_rf_model.skops")
26
- # Load Heart Disease model
27
- heart_model = sio.load("heart_rf.skops")
28
 
29
 
30
  # -------- Routes --------
@@ -136,31 +136,31 @@ def titanic_predict():
136
 
137
  return render_template("titanic.html", prediction=prediction)
138
 
139
- @app.route("/heart", methods=["GET", "POST"])
140
- def heart_predict():
141
- if "username" not in session:
142
- return redirect(url_for("login"))
143
-
144
- prediction = None
145
- if request.method == "POST":
146
- features = [
147
- float(request.form["age"]),
148
- float(request.form["sex"]),
149
- float(request.form["cp"]),
150
- float(request.form["trestbps"]),
151
- float(request.form["chol"]),
152
- float(request.form["fbs"]),
153
- float(request.form["restecg"]),
154
- float(request.form["thalach"]),
155
- float(request.form["exang"]),
156
- float(request.form["oldpeak"]),
157
- float(request.form["slope"]),
158
- float(request.form["ca"]),
159
- float(request.form["thal"])
160
- ]
161
- prediction = heart_model.predict([features])[0]
162
-
163
- return render_template("heart.html", prediction=prediction)
164
 
165
 
166
 
 
23
  model = sio.load("rf_house_price_model.skops")
24
  #titanic_model = joblib.load("titanic_rf_model.joblib")
25
  titanic_model = sio.load("titanic_rf_model.skops")
26
+ # # Load Heart Disease model
27
+ # heart_model = sio.load("heart_rf.skops")
28
 
29
 
30
  # -------- Routes --------
 
136
 
137
  return render_template("titanic.html", prediction=prediction)
138
 
139
+ # @app.route("/heart", methods=["GET", "POST"])
140
+ # def heart_predict():
141
+ # if "username" not in session:
142
+ # return redirect(url_for("login"))
143
+
144
+ # prediction = None
145
+ # if request.method == "POST":
146
+ # features = [
147
+ # float(request.form["age"]),
148
+ # float(request.form["sex"]),
149
+ # float(request.form["cp"]),
150
+ # float(request.form["trestbps"]),
151
+ # float(request.form["chol"]),
152
+ # float(request.form["fbs"]),
153
+ # float(request.form["restecg"]),
154
+ # float(request.form["thalach"]),
155
+ # float(request.form["exang"]),
156
+ # float(request.form["oldpeak"]),
157
+ # float(request.form["slope"]),
158
+ # float(request.form["ca"]),
159
+ # float(request.form["thal"])
160
+ # ]
161
+ # prediction = heart_model.predict([features])[0]
162
+
163
+ # return render_template("heart.html", prediction=prediction)
164
 
165
 
166