https://github.com/subhadipsinha722133/cancer-predction
A machine learning-based web application for predicting cancer risk based on various health and lifestyle factors.
https://github.com/subhadipsinha722133/cancer-predction
cancer machine-learning matplotlib pandas-python seborn
Last synced: 24 days ago
JSON representation
A machine learning-based web application for predicting cancer risk based on various health and lifestyle factors.
- Host: GitHub
- URL: https://github.com/subhadipsinha722133/cancer-predction
- Owner: subhadipsinha722133
- Created: 2025-08-19T11:44:14.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-09-29T09:57:20.000Z (about 1 month ago)
- Last Synced: 2025-09-29T11:40:19.852Z (about 1 month ago)
- Topics: cancer, machine-learning, matplotlib, pandas-python, seborn
- Language: Python
- Homepage: https://cancer-predction-uavkqxcjbgepf9mrxappzfc.streamlit.app/
- Size: 65.4 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cancer Prediction Web Application ๐๏ธ๐ฌ
A machine learning-based web application for predicting cancer risk based on various health and lifestyle factors.
  
## Live Demo ๐บ
๐[Demo Link](https://cancer-predction-uavkqxcjbgepf9mrxappzfc.streamlit.app/)
## Overview ๐ก
This project implements a Decision Tree classifier ๐ณ to predict cancer risk using patient data including age, BMI, lifestyle factors, and genetic history. The application features an interactive web interface built with Streamlit that allows users to input patient information and receive immediate predictions.
## Features โจ
- **๐๏ธ Interactive Web Interface**: User-friendly input forms with sliders and radio buttons
- **๐ค Machine Learning Model**: Decision Tree classifier with optimized parameters
- **โก Real-time Predictions**: Instant cancer risk assessment
- **๐ Data Visualization**: Charts displaying dataset characteristics and feature importance
- **๐ฑ Responsive Design**: Adapts to different screen sizes
- **๐ฏ User-Friendly**: Simple and intuitive interface with emoji enhancements
## Dataset ๐
The application uses a dataset with the following features:
- ๐จโ๐ฉโ๐งโ๐ฆ Age: Patient age
- โ๏ธ BMI: Body Mass Index
- ๐ฌ Smoking: Yes/No indicator
- ๐งฌ GeneticRisk: Yes/No indicator
- ๐โโ๏ธ PhysicalActivity: Activity level measurement
- ๐ท AlcoholIntake: Consumption level
- ๐ฅ CancerHistory: Family history of cancer (Yes/No)
## Installation ๐ ๏ธ
1. Clone the repository:
```bash
git clone https://github.com/subhadipsinha722133/Cancer-Predction.git
cd Cancer-Predction
```
2. Create a virtual environment (recommended):
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
3. Install required dependencies:
```bash
pip install -r requirements.txt
```
## Usage ๐
1. Ensure the dataset file `The_Cancer_data_1500_V2.csv` is in the project directory
2. Run the Streamlit application:
```bash
streamlit run app.py
```
3. Open your web browser and navigate to the local URL provided (typically http://localhost:8501)
4. Use the sidebar controls to input patient information:
- Adjust sliders for Age, BMI, Physical Activity, and Alcohol Intake
- Select Yes/No options for Smoking, Genetic Risk, and Cancer History
5. View the prediction results and data visualizations on the main panel
## Model Details ๐ค
- **Algorithm**: Decision Tree Classifier ๐ณ
- **Parameters**: max_depth=44, criterion="log_loss"
- **Preprocessing**: StandardScaler for feature normalization
- **Validation**: 80/20 train-test split with random_state=42
- **Performance**: Accuracy metrics displayed in console
## Project Structure ๐
```
Cancer-Predction/
โโโ app.py # Main application file
โโโ The_Cancer_data_1500_V2.csv # Dataset
โโโ requirements.txt # Python dependencies
โโโ README.md # Project documentation
```
## Dependencies ๐ฆ
- pandas==2.3.1
- scikit-learn==1.7.1
- streamlit==1.48.1
- matplotlib==3.10.5
- numpy==2.3.2
- altair==5.5.0
See requirements.txt for a complete list of dependencies.
## Contributing ๐ฅ
We welcome contributions to improve this application! ๐
1. Fork the repository ๐ด
2. Create your feature branch: `git checkout -b feature/AmazingFeature`
3. Commit your changes: `git commit -m 'Add some AmazingFeature'`
4. Push to the branch: `git push origin feature/AmazingFeature`
5. Open a pull request โญ
Please ensure:
- Code follows PEP 8 guidelines ๐
- Tests are added for new features ๐งช
- Documentation is updated accordingly ๐
## Limitations โ ๏ธ
- โ This is a demonstration application and should not be used for actual medical diagnosis
- ๐ Model performance depends on the quality and representativeness of the training data
- ๐ฅ Clinical validation would be required before real-world use
- ๐ Not intended for production use without proper medical oversight
## Future Enhancements ๐ฎ
- ๐๏ธ Integration with additional data sources
- ๐ Model explainability features
- ๐ User authentication and data persistence
- ๐ค Export functionality for results
- ๐ Multi-language support
- ๐ฒ Mobile app version
- โ๏ธ Cloud deployment options
## License ๐
This project is for educational purposes. Please ensure proper licensing before deployment in production environments.
## Support ๐ฌ
For questions or issues regarding this application, please open an issue in the project repository or contact the maintainers.
---
**โญ Don't forget to star the repository if you find this project useful!**
**๐ Check back often for updates and new features!**
---
*Made with โค๏ธ for the healthcare and tech community*