EAV123 commited on
Commit
3ea8af4
·
verified ·
1 Parent(s): ac1a971

Upload 16 files

Browse files
.env ADDED
File without changes
app.py ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pickle
3
+ from sklearn.ensemble import RandomForestRegressor
4
+ import numpy as np
5
+
6
+ # Load the saved model
7
+ with open('rf_model.pkl', 'rb') as file:
8
+ model = pickle.load(file)
9
+
10
+ # Define the function to make predictions
11
+ def make_prediction(model, input_data):
12
+ prediction = model.predict(input_data)
13
+ return prediction
14
+
15
+ # Create the Streamlit app
16
+ def main():
17
+ # Set page title and configure layout
18
+ st.set_page_config(page_title="Exam Score Prediction", layout="wide")
19
+
20
+ # Add a title and description
21
+ st.title("Exam Score Prediction")
22
+ st.markdown(
23
+ "This app predicts exam scores based on input features such as level, course units, attendance, mid-semester score, and assignments."
24
+ )
25
+
26
+ # Create input fields
27
+ col1, col2 = st.columns(2)
28
+ with col1:
29
+ level = st.number_input("Level", min_value=200, max_value=400, step=1)
30
+ course_units = st.number_input("Course Units", min_value=1, max_value=4, step=1)
31
+ with col2:
32
+ attendance = st.slider("Attendance", min_value=1, max_value=10, step=1)
33
+ mid_semester = st.slider("Mid Semester Score", min_value=1, max_value=20, step=1)
34
+ assignments = st.slider("Assignments", min_value=1, max_value=10, step=1)
35
+
36
+ # Create input data
37
+ input_data = np.array([[level, course_units, attendance, mid_semester, assignments]])
38
+
39
+ # Make prediction
40
+ if st.button("Predict Exam Score"):
41
+ prediction = make_prediction(model, input_data)
42
+ st.write(f"Predicted Exam Score: {prediction[0]:.2f}")
43
+
44
+ if __name__ == '__main__':
45
+ main()
gb_model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0b75da4aa7fe41c4565edd1150dfd9cff8324e57cd557f461bc0a09454823dc
3
+ size 123720
gb_model.sav ADDED
Binary file (124 kB). View file
 
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ numpy == 1.23.3
2
+ pandas == 2.0.2
3
+ sklearn == 1.2.1
4
+ tensorflow == 2.13.0
research/gb1_model.sav ADDED
Binary file (124 kB). View file
 
research/generated_dataset.csv ADDED
The diff for this file is too large to render. See raw diff
 
research/praise-project.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
research/trials.ipynb ADDED
File without changes
rf_model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f0bd693be2a7815e0d5cac32980d7a07dd3424c27b73d8b78072339e42d7686a
3
+ size 132319129
setup.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from setuptools import find_packages, setup
2
+
3
+ setup(
4
+ name = 'Student_grade_prediction',
5
+ version= '0.0.0',
6
+ author= 'Anulunko Chukwuebuka',
7
+ author_email= 'chukwuebukaanulunko@gmail.com',
8
+ packages= find_packages(),
9
+ install_requires = []
10
+
11
+ )
src/__init__.py ADDED
File without changes
src/helper.py ADDED
File without changes
src/prompt.py ADDED
File without changes
static/.gitkeep ADDED
File without changes
template.py ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from pathlib import Path
3
+ import logging
4
+
5
+ logging.basicConfig(level=logging.INFO, format='[%(asctime)s]: %(message)s:')
6
+
7
+ list_of_files = [
8
+ "src/__init__.py",
9
+ "src/helper.py",
10
+ "src/prompt.py",
11
+ ".env",
12
+ "setup.py",
13
+ "research/trials.ipynb",
14
+ "app.py",
15
+ "static/.gitkeep",
16
+ ]
17
+
18
+
19
+ for filepath in list_of_files:
20
+ filepath = Path(filepath)
21
+ filedir, filename = os.path.split(filepath)
22
+
23
+ if filedir !="":
24
+ os.makedirs(filedir, exist_ok=True)
25
+ logging.info(f"Creating directory; {filedir} for the file {filename}")
26
+
27
+ if (not os.path.exists(filepath)) or (os.path.getsize(filepath) == 0):
28
+ with open(filepath, 'w') as f:
29
+ pass
30
+ logging.info(f"Creating empty file: {filepath}")
31
+
32
+ else:
33
+ logging.info(f"{filename} is already created")
34
+