atikul-islam-sajib / MLFlowPractise

MLflow is an open source platform for managing machine learning workflows. It is used by MLOps teams and data scientists. MLflow has four main components: The tracking component allows you to record machine model training sessions (called runs) and run queries using Java, Python, R, and REST APIs.
MIT License
0 stars 0 forks source link

Breast Cancer Classification Project

This project provides tools for training and testing a machine learning model for breast cancer classification using PyTorch and MLflow for experiment tracking. It includes data loading, model training, evaluation, and logging functionalities.

Requirements

Installation

Clone the repository and install the required packages:

git clone https://github.com/yourusername/MLFlowPractise.git
cd MLFlowPractise
pip install -r requirements.txt

Usage

The project can be run through the command-line interface (CLI). The CLI allows for both training and testing of the model.

Training

To train the model and log the experiments with MLflow, use the following command:

python cli.py --dataset /path/to/dataset.csv --batch_size 64 --split_size 0.30 --epochs 200 --lr 0.01 --adam True --display True --train

Testing

To test the model, use the following command:

python cli.py --test

CLI Arguments

MLflow Tracking

The training process utilizes MLflow for tracking experiments. Metrics such as loss, accuracy, precision, and recall are logged at each epoch. Additionally, confusion matrices and classification reports are saved as artifacts. Model checkpoints and the best model are also saved.

To view the MLflow tracking UI, run:

mlflow ui

This will start the MLflow server, and you can access the UI at http://localhost:5000 to visualize your experiment runs and metrics.

Project Structure

Docker Usage

To simplify the process of setting up the environment and running the project, a Docker image is available. You can pull and run the Docker image with the following commands.

Pulling the Docker Image

Pull the Docker image from Docker Hub:

docker pull sajibds/clf:latest

Running the Docker Container

Run the Docker container with the following command. Make sure to mount the dataset directory to the container:

docker run -v /path/to/dataset:/app/dataset sajibds/clf:latest --dataset /app/dataset/dataset.csv --batch_size 64 --split_size 0.30 --epochs 200 --lr 0.01 --adam True --display True --train

Testing with Docker

To test the model using the Docker container, run:

docker run sajibds/clf:latest --test

Contact

For any questions or issues, please contact Atikul Islam Sajib.