Spaces:
Runtime error
Runtime error
Upload 3 files
Browse files- app.py +42 -0
- performance.h5 +3 -0
- requirements.txt +4 -0
app.py
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
import joblib
|
3 |
+
import streamlit as st
|
4 |
+
|
5 |
+
#loading the model
|
6 |
+
model = joblib.load("performance.h5")
|
7 |
+
|
8 |
+
def predict_marks(Hours_Studied,Previous_Scores,Extracurricular_Activities,Sleep_Hours,Sample_Question_Papers_Practiced):
|
9 |
+
"predict the student marks based on the input data"
|
10 |
+
input_data = np.array([[Hours_Studied,Previous_Scores,Extracurricular_Activities,Sleep_Hours,Sample_Question_Papers_Practiced]])
|
11 |
+
prediction = model.predict(input_data)
|
12 |
+
prediction = round(float(prediction),2)
|
13 |
+
|
14 |
+
if prediction >100:
|
15 |
+
prediction = 100
|
16 |
+
return prediction
|
17 |
+
|
18 |
+
def main():
|
19 |
+
|
20 |
+
st.title("Student Performance marks")
|
21 |
+
|
22 |
+
# input data
|
23 |
+
Hours_Studied = st.number_input("Enter no. of Hours you studied",min_value=0.0,max_value=10.0,value=0.0)
|
24 |
+
Previous_Scores = st.number_input("Enter your previous exam score",min_value=0.0,max_value=100.0,value=0.0)
|
25 |
+
Extracurricular_Activities = st.number_input("Enter your Extra activities",min_value=0.0,max_value=10.0,value=0.0)
|
26 |
+
Sleep_Hours = st.number_input("Enter no. of hours you slept",min_value=0.0,max_value=12.0,value=0.0)
|
27 |
+
Sample_Question_Papers_Practiced = st.number_input("Enter no. of sample questions you practiced",min_value=0.0,max_value=50.0,value=0.0)
|
28 |
+
|
29 |
+
if st.button("Predict your marks"):
|
30 |
+
prediction = predict_marks(Hours_Studied,Previous_Scores,Extracurricular_Activities,Sleep_Hours,Sample_Question_Papers_Practiced)
|
31 |
+
|
32 |
+
#Displat the result
|
33 |
+
if prediction >=90:
|
34 |
+
st.balloons()
|
35 |
+
st.success(f"Congralution you have high chances to pass by {prediction} marks")
|
36 |
+
elif prediction>=35:
|
37 |
+
st.warning(f"you have to work hard you have chances to score with {prediction} marks")
|
38 |
+
else:
|
39 |
+
st.error(f"you have high chances of failing with {prediction} marks")
|
40 |
+
|
41 |
+
if __name__ == "__main__":
|
42 |
+
main()
|
performance.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0032adf07e82dac858c025329d46bd909d57cffee9b0c356e1ed0872a4e80adb
|
3 |
+
size 1040
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
joblib
|
2 |
+
streamlit
|
3 |
+
numpy
|
4 |
+
scikit-learn
|