An open API service indexing awesome lists of open source software.

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.

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.

![Cancer Prediction App](https://img.shields.io/badge/Health-Tech-brightgreen) ![Machine Learning](https://img.shields.io/badge/ML-Powered-blue) ![Streamlit](https://img.shields.io/badge/Streamlit-App-red)

## 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*