Spaces:
Sleeping
Sleeping
Download pages/2_Model_Training.py from Srikanth0804/Sentiment_Analysis: direct link, hf CLI and curl.
- Browser
- Download file 830 Bytes
-
https://huggingface.co/spaces/Srikanth0804/Sentiment_Analysis/resolve/main/pages/2_Model_Training.py
- Command line
-
hf download hf://spaces/Srikanth0804/Sentiment_Analysis/pages/2_Model_Training.py
-
curl -L -o 2_Model_Training.py https://huggingface.co/spaces/Srikanth0804/Sentiment_Analysis/resolve/main/pages/2_Model_Training.py
830 Bytes
| import streamlit as st | |
| st.title("๐ง Model Training & Evaluation") | |
| st.markdown(""" | |
| ### ๐ ๏ธ **Text Vectorization** | |
| Used **TF-IDF Vectorizer** with: | |
| ๐ข **max_features** = 10000 to limit dimensionality | |
| --- | |
| ### ๐ค **Model Selection** | |
| Chose **Logistic Regression** as baseline model | |
| Applied **GridSearchCV** to optimize parameters | |
| Training pipeline saved using **pickle** for direct deployment | |
| --- | |
| ### ๐ **Model Evaluation** | |
| ๐ **Accuracy Achieved: 0.75** | |
| **Key Metrics:** | |
| **Accuracy** 0.75 | |
| **Precision** 0.81 | |
| **Recall** 0.77 | |
| **F1-Score** 0.75 | |
| This trained pipeline is now integrated into the final deployment page below. | |
| --- | |
| """) | |
| if st.button("Next"): | |
| st.switch_page("pages/3_Deployment.py") | |
| if st.button("Go to Data Overview"): | |
| st.switch_page("pages/1_Data_Overview.py") |