|
|
|
|
|
import streamlit as st
|
|
import joblib
|
|
import numpy as np
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model = joblib.load("student_performance_model.h5")
|
|
|
|
|
|
def predict_marks(Hours_studied,Previous_score , Extracurriculum_activities, sleep_hours , sample_question):
|
|
|
|
|
|
input_data = np.array([[Hours_studied,Previous_score , Extracurriculum_activities, sleep_hours , sample_question]])
|
|
prediction = model.predict(input_data)
|
|
prediction = round(float(prediction),2)
|
|
|
|
|
|
|
|
|
|
if prediction > 100:
|
|
prediction = 100
|
|
|
|
return prediction
|
|
|
|
|
|
def main():
|
|
|
|
st.title("Student Performance Prediction")
|
|
|
|
|
|
|
|
name = st.text_input("enter your name")
|
|
|
|
Hours_studied = st.number_input("number of hours you studied",min_value = 0.0 ,max_value=18.0,value = 0.0)
|
|
|
|
Previous_score = st.number_input("enter your previous score",min_value = 0.0 ,max_value=100.0,value = 0.0)
|
|
|
|
Extracurriculum_Activites = st.number_input("no.of extracurricular activities done",min_value = 0.0,max_value = 10.0 ,value= 0.0 )
|
|
|
|
sleep_hours = st.number_input ("Hours you slept", min_value =0.0,max_value = 12.0, value = 0.0)
|
|
|
|
sample_questions = st.number_input ("number of sample paper you solved", min_value =0.0,max_value = 20.0, value = 0.0)
|
|
|
|
|
|
|
|
st.sidebar.title(f"# hey {name}")
|
|
st.sidebar.title(f"Welcome to your Marks predictor!...")
|
|
|
|
|
|
|
|
|
|
if st.button("Predict your Marks"):
|
|
prediction = predict_marks(Hours_studied,Previous_score , Extracurriculum_Activites,sleep_hours ,sample_questions)
|
|
|
|
|
|
|
|
|
|
if prediction >=90:
|
|
st.balloons()
|
|
st.success(f"congrats {name} you are on a track to score {prediction} marks!.kepp it up ")
|
|
elif prediction>=35:
|
|
st.warning(f"hey {name} you are on a track to score {prediction} marks. but there's a room to aim higher!")
|
|
else:
|
|
st.error(f"{name} , oh no you might fail the exam as you will be getting {prediction}, work hard and conncentrate on your studies")
|
|
|
|
|
|
if __name__ =="__main__":
|
|
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|