Skip to content

emiliodallatorre/unive-breastcancer-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Breast Cancer Classification API

Cover Image

This project demonstrates how to deploy a pre-trained machine learning model as a web service using FastAPI. The machine learning model used in this project is a RandomForestClassifier, trained on a Breast Cancer classification dataset. The trained model is served via an API endpoint created with FastAPI, allowing users to make predictions by sending HTTP requests.

Table of Contents

Installation

  1. Clone the repository:

    git clone https://github.com/emiliodallatorre/unive-breastcancer-classification.git
    cd your-repo-name
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate   # On Windows use `env\Scripts\activate`
  3. Install the required dependencies:

    pip install -r requirements.txt

Usage

Running the FastAPI Application

  1. Start the FastAPI server:

    uvicorn server:app --host 0.0.0.0 # Or use ./start.sh
  2. Access the API: Open your browser and navigate to http://127.0.0.1:8000/docs to view the automatically generated API documentation and interact with the API.

Endpoints

/predict [POST]

  • Description: This endpoint accepts a JSON payload containing the features required by the model and returns the prediction.

  • Request Body:

    {
      "radius": 0,
      "perimeter": 0,
      "area": 0
    }
  • Response:

    {
      "diagnosis": "B",
      "probabilities": {
        "B": 1,
        "M": 0
      }
    }

Contributing

Contributions are welcome! Please fork the repository and submit a pull request for any bug fixes, improvements, or new features.

  1. Fork the Project
  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

License

Distributed under the MIT License. See LICENSE for more information.

About

A machine learning model trained on the Wisconsin dataset to accurately classify breast cancer cases.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published