a/README.md b/README.md
1
# Lung Cancer Prediction Web Application
1
# Lung Cancer Prediction Web Application
2
2
3
![Cancer Predictor web application](https://github.com/itsmethahseer/Cancer_Prediction/blob/45befaf9c8a518f72677a56141436639d066fe45/Screenshot%202023-08-07%20211212.png)
3
4
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.
5
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
6
8
## Installation
7
## Installation
9
8
10
1. Clone the repository:
9
1. Clone the repository:
11
10
12
11
13
2. Install the required Python packages:
12
2. Install the required Python packages:
14
13
15
14
16
3. Place the `cancer_model.pkl` file containing the trained machine learning model in the root directory of the project.
15
3. Place the `cancer_model.pkl` file containing the trained machine learning model in the root directory of the project.
17
16
18
## Usage
17
## Usage
19
18
20
1. Run the fastapi development server:
19
1. Run the fastapi development server:
21
20
22
21
23
2. Access the web application in your web browser at `http://localhost:8000/`.
22
2. Access the web application in your web browser at `http://localhost:8000/`.
24
23
25
3. Fill in the input form with the required information (e.g., gender, age, smoking habits, etc.).
24
3. Fill in the input form with the required information (e.g., gender, age, smoking habits, etc.).
26
25
27
4. Click the "Predict" button to see the prediction result, which indicates the likelihood of lung cancer.
26
4. Click the "Predict" button to see the prediction result, which indicates the likelihood of lung cancer.
28
27
29
## Project Structure
28
## Project Structure
30
29
31
- `Cancer_Prediction`: The main FastApi project directory.
30
- `Cancer_Prediction`: The main FastApi project directory.
32
31
33
  - `main.py`: Defines the fastapi main functions
32
  - `main.py`: Defines the fastapi main functions
34
  - `templates`: Directory containing the HTML templates for rendering the web pages.
33
  - `templates`: Directory containing the HTML templates for rendering the web pages.
35
- `cancer_model.pkl`: The trained machine learning model used for prediction.
34
- `cancer_model.pkl`: The trained machine learning model used for prediction.
36
35
37
## Data Preprocessing
36
## Data Preprocessing
38
37
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.
38
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
39
41
## Model Training
40
## Model Training
42
41
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.
42
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
43
45
## Acknowledgments
44
## Acknowledgments
46
45
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.
46
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
47