GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Student-Performance-Prediction-System/application.py at main · SatishHirol/Student-Performance-Prediction-System

Expand file tree

/

application.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
43 lines (32 loc) · 1.32 KB
/

application.py

Copy path

File metadata and controls

43 lines (32 loc) · 1.32 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
32
33
34
35
36
37
38
39
40
41
42
43
from flask import Flask, render_template, request
from src.pipeline.prediction_pipeline import CustomData, PredictPipeline
application = Flask(__name__)
app = application
## Route for a home page
@app.route("/")
def index() -> str:
return render_template("index.html")
@app.route("/predictdata", methods=["GET", "POST"])
def predict_datapoint() -> str:
if request.method == "GET":
return render_template("home.html")
else:
data = CustomData(
gender=request.form.get("gender"),
race_ethnicity=request.form.get("ethnicity"),
parental_level_of_education=request.form.get("parental_level_of_education"),
lunch=request.form.get("lunch"),
test_preparation_course=request.form.get("test_preparation_course"),
reading_score=float(request.form.get("writing_score")),
writing_score=float(request.form.get("reading_score")),
)
pred_df = data.get_data_as_data_frame()
print(pred_df)
print("Before Prediction")
predict_pipeline = PredictPipeline()
print("Mid Prediction")
results = predict_pipeline.predict(pred_df)
print("After Prediction")
return render_template("home.html", results=f"{results[0]:.2f}")
if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.