| import streamlit as st |
|
|
| |
| st.markdown(""" |
| ## βοΈ Model Building & Evaluation |
| |
| ### ποΈ Model Building: |
| |
| The classification model was built using the **KNN Classifier**, a robust ensemble learning method suitable for handling both numerical and categorical data. |
| |
| **Model Pipeline:** |
| |
| - **Preprocessing**: |
| - Applied **ColumnTransformer** to handle both categorical and numerical features. |
| - Used **StandardScaler** for scaling continuous variables. |
| - Encoded categorical columns using **OrdinalEncoder** (where appropriate). |
| |
| - **Model**: |
| - Trained using **KNearestNeighbors Classifier** from `scikit-learn` with tuned hyperparameters. |
| |
| --- |
| |
| ### β
Model Training: |
| |
| - The dataset was split into **training and testing sets** using an 80-20 split. |
| - The model was trained on the training set using the engineered features. |
| - Proper cross-validation techniques were used to avoid overfitting. |
| |
| --- |
| |
| ### π Model Evaluation: |
| |
| **Evaluation Metrics Used:** |
| |
| - **Accuracy** β Measures the overall correctness of the model. |
| - **Precision** β Measures how many predicted "High Risk" projects were actually high risk. |
| - **Recall** β Indicates how many actual high-risk projects were correctly identified. |
| - **F1 Score** β Harmonic mean of precision and recall for balanced performance. |
| - **Confusion Matrix** β Visual breakdown of correct and incorrect classifications. |
| |
| --- |
| |
| The model demonstrated **strong classification performance** on the test dataset, achieving good scores across all metrics. |
| It was then saved as a **.pkl** file for deployment and integrated into the Streamlit app for real-time predictions. |
| """) |
|
|
|
|
| if st.button('Go to Deployment'): |
| st.switch_page("pages/6 Deployment.py") |
|
|
| if st.button('Back'): |
| st.switch_page("pages/4 Feature Engineering.py") |