init
This commit is contained in:
commit
02009174b3
BIN
linear_regression_model.pkl
Normal file
BIN
linear_regression_model.pkl
Normal file
Binary file not shown.
7
requirements.txt
Normal file
7
requirements.txt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
fastapi
|
||||||
|
uvicorn
|
||||||
|
joblib
|
||||||
|
numpy
|
||||||
|
pandas
|
||||||
|
scikit-learn
|
||||||
BIN
scaler.pkl
Normal file
BIN
scaler.pkl
Normal file
Binary file not shown.
22
streamlit.py
Normal file
22
streamlit.py
Normal 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}")
|
||||||
Loading…
x
Reference in New Issue
Block a user