a b/README.md
1
# Lung Cancer Prediction Web Application
2
3
![Cancer Predictor web application](https://github.com/itsmethahseer/Cancer_Prediction/blob/45befaf9c8a518f72677a56141436639d066fe45/Screenshot%202023-08-07%20211212.png)
4
5
6
This is a web application built with FastApi that allows users to predict the likelihood of lung cancer based on various input features. The application utilizes a machine learning model trained on a dataset of survey responses related to lung cancer.
7
8
## Installation
9
10
1. Clone the repository:
11
12
13
2. Install the required Python packages:
14
15
16
3. Place the `cancer_model.pkl` file containing the trained machine learning model in the root directory of the project.
17
18
## Usage
19
20
1. Run the fastapi development server:
21
22
23
2. Access the web application in your web browser at `http://localhost:8000/`.
24
25
3. Fill in the input form with the required information (e.g., gender, age, smoking habits, etc.).
26
27
4. Click the "Predict" button to see the prediction result, which indicates the likelihood of lung cancer.
28
29
## Project Structure
30
31
- `Cancer_Prediction`: The main FastApi project directory.
32
33
  - `main.py`: Defines the fastapi main functions
34
  - `templates`: Directory containing the HTML templates for rendering the web pages.
35
- `cancer_model.pkl`: The trained machine learning model used for prediction.
36
37
## Data Preprocessing
38
39
The original dataset used for training the model was preprocessed to convert categorical variables into numerical representations using Label Encoding. Additionally, the imbalanced class distribution was addressed using the ADASYN (Adaptive Synthetic Sampling) technique to generate synthetic samples of the minority class.
40
41
## Model Training
42
43
The machine learning model used for lung cancer prediction is a logistic regression classifier. It was trained on the preprocessed dataset, and its performance was validated using various evaluation metrics.
44
45
## Acknowledgments
46
47
The Lung Cancer Prediction web application was developed as part of a data science project. The dataset used for training the model was obtained from an open-source data repository.
48