Skip to main content

A flexible framework for machine learning pipelines

Project description

LabChain test_on_push

LabChain is an innovative platform designed to simplify and accelerate the development of machine learning models. It provides data scientists and machine learning engineers with a flexible and powerful tool to create, experiment with, and deploy models efficiently and in a structured manner. https://manucouto1.github.io/LabChain

Key Features

  • Modular and flexible architecture
  • Customizable pipelines for ML workflows
  • Extensible plugin system for filters, metrics, and storage
  • Support for distributed processing with MapReduce
  • Integrated model evaluation and optimization tools

Diagram

      classDiagram
      class BasePlugin {
            <<abstract>>
            +item_dump() : Dict
            +build_from_dump(dump_dict: Dict, factory: BaseFactory) : BasePlugin
      }

      class BaseFilter {
            <<abstract>>
            +fit(x: XYData, y: XYData|None) : float|None
            +predict(x: XYData) : XYData
            +evaluate(x_data: XYData, y_true: XYData|None, y_pred: XYData) : Dict[str, Any]
      }

      class BasePipeline {
            <<abstract>>
            -filters: List[BaseFilter]
            +evaluate(x_data: XYData, y_true: XYData|None, y_pred: XYData) : Dict[str, Any]
            +start(x: XYData, y: XYData|None, X_: XYData|None) : XYData|None
            +init()
            +get_types() : List[Type[BaseFilter]]
            +optimizer(optimizer: BaseOptimizer) : BaseOptimizer|None
            +splitter(splitter: BaseSplitter) : BaseSplitter|None
      }

      class BaseSplitter {
            <<abstract>>
            -pipeline: BasePipeline
            +split(pipeline: BasePipeline)
            +evaluate(x_data: XYData, y_true: XYData|None, y_pred: XYData) : Dict[str, Any]
            +start(x: XYData, y: XYData|None, X_: XYData|None) : XYData|None
            +unwrap() : BasePipeline
      }

      class BaseOptimizer {
            <<abstract>>
            -pipeline: BasePipeline
            +start(x: XYData, y: XYData|None, X_: XYData|None) : XYData|None
            +optimize(pipeline: BasePipeline)
      }

      class BaseMetric {
            <<abstract>>
            +evaluate(x_data: XYData, y_true: XYData|None, y_pred: XYData) : float
      }

      class BaseStorer {
            <<abstract>>
            +get_root_path() : str
            +upload_file(file_path: str, destination_path: str)
            +list_stored_files() : List[str]
            +get_file_by_hashcode(hashcode: str) : str
            +check_if_exists(file_path: str) : bool
            +download_file(file_path: str, destination_path: str)
            +delete_file(file_path: str)
      }

      class ParallelPipeline {
            <<abstract>>
      }

      class SequentialPipeline {
            <<abstract>>
      }

      class MonoPipeline {
      }

      class LocalThreadPipeline {
      }

      class HPCPipeline {
      }

      class F3Pipeline {
      }

      class KFoldSplitter {
      }

      class OptunaOptimizer {
      }

      class SklearnOptimizer {
      }

      class WandbOptimizer {
      }

      class LocalStorer {
      }

      class S3Storer {
      }

      class Container {
            +bind()
            +get()
      }

      BasePlugin <|-- BaseFilter
      BasePlugin <|-- BaseMetric
      BaseFilter <|-- BasePipeline
      BaseFilter <|-- BaseSplitter
      BaseFilter <|-- BaseOptimizer
      BasePlugin <|-- BaseStorer
      BasePipeline <|-- ParallelPipeline
      BasePipeline <|-- SequentialPipeline
      ParallelPipeline <|-- MonoPipeline
      ParallelPipeline <|-- LocalThreadPipeline
      ParallelPipeline <|-- HPCPipeline
      SequentialPipeline <|-- F3Pipeline
      BaseSplitter <|-- KFoldSplitter
      BaseOptimizer <|-- OptunaOptimizer
      BaseOptimizer <|-- SklearnOptimizer
      BaseOptimizer <|-- WandbOptimizer
      BaseStorer <|-- LocalStorer
      BaseStorer <|-- S3Storer

      BasePipeline "1" *-- "1..*" BaseFilter : contains
      BaseSplitter "1" *-- "1" BaseFilter : contains
      BaseOptimizer "1" *-- "1" BaseFilter : contains
      BasePipeline "1" *-- "0..*" BaseMetric : uses

      Container --> BasePlugin : contains

Prerequisites

Before installing LabChain, ensure you have the following prerequisites:

  1. Python 3.11 or higher
  2. pip (Python package installer)

Installation Options

You have two options to install LabChain:

Option 1: Install from PyPI

The easiest way to install LabChain is directly from PyPI using pip:

pip install framework3

This will install the latest stable version of LabChain and its dependencies.

Option 2: Install from Source

  1. Clone the repository:

    git clone https://github.com/manucouto1/LabChain.git
    
  2. Navigate to the project directory:

    cd LabChain
    
  3. Install the dependencies using pip:

    pip install -r requirements.txt
    

Basic Usage

Here's a basic example of how to use LabChain:

from framework3.plugins.pipelines import F3Pipeline
from framework3.plugins.filters import KnnFilter
from framework3.plugins.metrics import F1, Precision, Recall

# Create a pipeline
pipeline = F3Pipeline(
    plugins=[KnnFilter()],
    metrics=[F1(), Precision(), Recall()]
)

# Fit the model
pipeline.fit(X_train, y_train)

# Make predictions
predictions = pipeline.predict(X_test)

# Evaluate the model
evaluation = pipeline.evaluate(X_test, y_test, y_pred=predictions)
print(evaluation)

Documentation

For more detailed information on how to use Framework3, check out our complete documentation at:

https://manucouto1.github.io/LabChain

Contributing

Contributions are welcome. Please read our contribution guidelines before submitting pull requests.

License

This project is licensed under the AGPL-3.0 license. See the LICENSE file for more details.

Contact

If you have any questions or suggestions, don't hesitate to open an issue in this repository or contact the development team.


Thank you for your interest in LabChain! We hope this tool will be useful in your machine learning projects.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

framework3-1.0.30.tar.gz (79.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

framework3-1.0.30-py3-none-any.whl (119.1 kB view details)

Uploaded Python 3

File details

Details for the file framework3-1.0.30.tar.gz.

File metadata

  • Download URL: framework3-1.0.30.tar.gz
  • Upload date:
  • Size: 79.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.14 Linux/6.11.0-1018-azure

File hashes

Hashes for framework3-1.0.30.tar.gz
Algorithm Hash digest
SHA256 591bbdab3425632131b22f674775d1006fe6b9de51bbf82f7b45919b5f8499fb
MD5 63439d1fa14f2fee6b4e6c72bb027bea
BLAKE2b-256 f880069412acc4f9e7824804c94338d565f9cbfaeeac4a4e19f76ca62d991cd7

See more details on using hashes here.

File details

Details for the file framework3-1.0.30-py3-none-any.whl.

File metadata

  • Download URL: framework3-1.0.30-py3-none-any.whl
  • Upload date:
  • Size: 119.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.14 Linux/6.11.0-1018-azure

File hashes

Hashes for framework3-1.0.30-py3-none-any.whl
Algorithm Hash digest
SHA256 7b18ccc4bb3d554b716fa21c1efaf66fef3166dd9b7030a07a516442a145af9d
MD5 2bbb83ab5866e4383c1a217d58761526
BLAKE2b-256 3a7f42c59591510cbe5edd6dfe8232869b4c2b8017b6af335fa80a8acc54112f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page