(Click on the Image to be redirected to the video)
This repository contains two main components:
- A Stock Price visualization app using Streamlit
- A Customer Churn Prediction model using Flask
project/
├── churn_predict/
│ ├── datasets/
│ │ └── churn_data.csv
│ ├── model/
│ │ └── model_C=1.0.bin
│ ├── deploy_churn.ipynb
│ ├── myapp.py
│ ├── Dockerfile
│ └── requirements.txt
└── README.md
- Displays Google (GOOGL) stock closing prices
- Shows trading volume visualization
- Interactive date range selection
- Built with Streamlit for easy web interface
python streamlit==1.31.0 yfinance==0.2.36 pandas==2.1.0
streamlit run myapp.py
- Predicts customer churn probability
- Uses Logistic Regression model
- ROC AUC score of ~0.858 on test set
- REST API endpoint for predictions
- Training data includes customer demographics and service usage
- Features include tenure, monthly charges, total charges, and various categorical variables
- Model trained using scikit-learn's LogisticRegression with 5-fold cross-validation
python flask==3.0.0 pandas==2.1.0 scikit-learn==1.3.0 gunicorn==21.2.0 numpy==1.24.0
- Install dependencies pip install -r requirements.txt
- Run Flask application python predict.py
- Making Predictions Test the API using curl: bash
curl -X POST -H "Content-Type: application/json" -d '{
"gender": "female",
"seniorcitizen": 0,
"partner": "yes",
"dependents": "no",
"phoneservice": "no",
"multiplelines": "no_phone_service",
"internetservice": "dsl",
"onlinesecurity": "no",
"onlinebackup": "yes",
"deviceprotection": "no",
"techsupport": "no",
"streamingtv": "no",
"streamingmovies": "no",
"contract": "month-to-month",
"paperlessbilling": "yes",
"paymentmethod": "electronic_check",
"tenure": 1,
"monthlycharges": 29.85,
"totalcharges": 29.85
}' http://localhost:9696/predict
- Running the Streamlit App streamlit run predict_copy.py
The project uses:
- Python 3.8+
- Jupyter Notebook for model development
- Flask for API development
- Docker for containerization
- Streamlit for stock visualization
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Data source for stock prices: Yahoo Finance
- Churn prediction dataset: Churn_data.csv
Contact: