- Introduction
- Features
- Technologies Used
- How It Works
- API Endpoint
- Flutter App
- Installation
- Usage
- Video Demo
- Author
The Lung Cancer Predictor is a machine learning-based application designed to predict the likelihood of lung cancer based on various health-related features. This project consists of:
- A FastAPI backend that serves a machine learning model for predictions.
- A Flutter frontend that allows users to input their health data and view predictions.
📌 Source: The dataset is derived from Kaggle. Dataset link: [Lung Cancer Predict Dataset].
This project aims to provide an easy-to-use tool for individuals to assess their risk of lung cancer based on key health indicators.
- FastAPI Backend:
- RESTful API endpoint for making predictions.
- Input validation using Pydantic.
- Hosted on Render for public access.
- Flutter Frontend:
- User-friendly interface for inputting health data.
- Displays prediction results or error messages.
- Supports multiple pages for input and results.
- Machine Learning Model:
- Trained on a dataset with multiple health-related features.
- Predicts the likelihood of lung cancer (binary classification).
- Data Collection:
- The model is trained on a dataset containing features such as age, gender, smoking status, oxygen saturation, and more.
- Model Training:
- A linear regression model is trained to predict the likelihood of lung cancer.
- API Deployment:
- The trained model is serialized and integrated into a FastAPI backend.
- User Interaction:
- Users input their health data into the Flutter app.
- The app sends the data to the FastAPI endpoint.
- The API returns the prediction, which is displayed in the app.
The FastAPI backend provides a single endpoint for making predictions:
- URL:
(https://linear-regression-model-ntlf.onrender.com) - Method:
POST - Input: JSON object with the following fields:
{ "AGE": 45, "GENDER": 1, "SMOKING": 0, "FINGER_DISCOLORATION": 0, "MENTAL_STRESS": 1, "EXPOSURE_TO_POLLUTION": 0, "LONG_TERM_ILLNESS": 0, "ENERGY_LEVEL": 7.5, "IMMUNE_WEAKNESS": 0, "BREATHING_ISSUE": 0, "ALCOHOL_CONSUMPTION": 1, "THROAT_DISCOMFORT": 0, "OXYGEN_SATURATION": 98.0, "CHEST_TIGHTNESS": 0, "FAMILY_HISTORY": 0, "SMOKING_FAMILY_HISTORY": 0, "STRESS_IMMUNE": 0 } - Output: JSON object with the prediction:
{ "prediction": No Lung Cancer(0) }
The Flutter app provides a user-friendly interface for interacting with the API. It includes:
- Input Page:
- TextFields for each input variable.
- A "Predict" button to submit the data.
- Result Page:
- Displays the prediction result or an error message.
-
Clone the repository:
git clone https://github.com/Irenee123/linear_regression_model.git cd Summative/lung-cancer -
Install dependencies:
flutter pub get
-
Run the app:
flutter run
- Open the Flutter app.
- Enter your health data in the input fields.
- Click the "Predict" button.
- View the prediction result on the next page.
Watch the video demo of the Lung Cancer Predictor in action:
*(Video DEMO and Model explaination.)*
- Irenee Gisubizo Dusingizimana
- GitHub: Irenee123
- Email: [i.dusingizi@alustudent.com]