This commit is contained in:
User Name 2025-06-07 23:27:56 +02:00
commit 02009174b3
4 changed files with 29 additions and 0 deletions

BIN
linear_regression_model.pkl Normal file

Binary file not shown.

7
requirements.txt Normal file
View File

@ -0,0 +1,7 @@
fastapi
uvicorn
joblib
numpy
pandas
scikit-learn

BIN
scaler.pkl Normal file

Binary file not shown.

22
streamlit.py Normal file
View File

@ -0,0 +1,22 @@
import streamlit as st
import joblib
# Load the model and scaler
model = joblib.load("linear_regression_model.pkl")
scaler = joblib.load("scaler.pkl")
# Streamlit app
st.title("MetaBrains Student Test Score Predictor")
st.write("Enter the number of hours studied to predict the test score.")
# User input
hours = st.number_input("Hours studied:", min_value=0.0, step=1.0)
if st.button("Predict"):
try:
data = [[hours]]
scaled_data = scaler.transform(data)
prediction = model.predict(scaled_data)
st.write(f"Predicted Test Score: {prediction[0]:.2f}")
except Exception as e:
st.error(f"Error: {e}")