Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 

Repository files navigation

🎗️ Lung Cancer Predictor

📋 Table of Contents

  1. Introduction
  2. Features
  3. Technologies Used
  4. How It Works
  5. API Endpoint
  6. Flutter App
  7. Installation
  8. Usage
  9. Video Demo
  10. Author

🌟 Introduction

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.


🚀 Features

  • 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).

🛠️ Technologies Used

  • Backend:
    • Python
    • FastAPI
    • Pydantic
    • Scikit-learn
    • Joblib
  • Frontend:
    • Flutter
    • Dart
    • HTTP
  • Hosting:
    • Render
    • GitHub

🧠 How It Works

  1. Data Collection:
    • The model is trained on a dataset containing features such as age, gender, smoking status, oxygen saturation, and more.
  2. Model Training:
    • A linear regression model is trained to predict the likelihood of lung cancer.
  3. API Deployment:
    • The trained model is serialized and integrated into a FastAPI backend.
  4. 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.

🔗 API Endpoint

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)
    }

📱 Flutter App

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.

🛠️ Installation

  1. Clone the repository:

    git clone https://github.com/Irenee123/linear_regression_model.git
    cd Summative/lung-cancer
  2. Install dependencies:

    flutter pub get
  3. Run the app:

    flutter run

🎮 Usage

  1. Open the Flutter app.
  2. Enter your health data in the input fields.
  3. Click the "Predict" button.
  4. View the prediction result on the next page.

📹 Video Demo

Watch the video demo of the Lung Cancer Predictor in action:
*(Video DEMO and Model explaination.)*


👤 Author


About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages