diff --git a/models/__init__.py b/models/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/models/train_and_save_model.py b/models/train_and_save_model.py index e26d5f9..fec57f6 100644 --- a/models/train_and_save_model.py +++ b/models/train_and_save_model.py @@ -13,7 +13,7 @@ from sklearn.model_selection import train_test_split def load_and_preprocess_data(): """Load and preprocess the data exactly as done in the notebook""" # Load data - data_file_name_path = "../data/data.csv" + data_file_name_path = "../../../data/data.csv" master_raw_data = pd.read_csv(data_file_name_path) data = master_raw_data.copy() diff --git a/src/components/prediction_components.py b/src/components/prediction_components.py index 2c23057..ef73aa4 100644 --- a/src/components/prediction_components.py +++ b/src/components/prediction_components.py @@ -9,10 +9,12 @@ import time import json from typing import Dict, Any, Tuple, List +from src.utils.models_utils import preprocess_input, generate_recommendations, validate_input + def render_prediction_section(model, preprocessing_info, user_input: Dict[str, Any]) -> None: """Render the prediction section with enhanced animations""" - from ..utils.model_utils import preprocess_input, generate_recommendations + # Prediction button with enhanced styling predict_button = st.button("🔬 Analyze Student Data", type="primary", use_container_width=True) @@ -89,7 +91,7 @@ def render_prediction_section(model, preprocessing_info, user_input: Dict[str, A def render_recommendations(predicted_outcome: str, user_input: Dict[str, Any]) -> None: """Render personalized recommendations section""" - from ..utils.model_utils import generate_recommendations + st.markdown("### 💡 Personalized Recommendations") @@ -171,7 +173,6 @@ def render_probability_charts(prediction_proba: List[float]) -> None: def render_model_info_sidebar(user_input: Dict[str, Any]) -> None: """Render model information and validation in sidebar""" - from ..utils.model_utils import validate_input from ..config.theme import MODEL_METRICS st.markdown('