unionml


Nameunionml JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/unionai-oss/unionml/
SummaryThe easiest way to build and deploy machine learning microservices.
upload_time2022-12-20 18:57:42
maintainer
docs_urlNone
authorunionai-oss
requires_python>=3.7
licenseApache
keywords machine-learning artificial-intelligence microservices
VCS
bugtrack_url
requirements click cookiecutter dataclasses_json docker fastapi flytekit gitpython joblib mangum numpy pandas pydantic rich scikit-learn typer typing-extensions uvicorn importlib-metadata
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <a href="https://www.union.ai/unionml">
  <img src="https://raw.githubusercontent.com/unionai-oss/unionml/main/docs/source/_static/images/union-logo.svg" alt="Union.ai Logo" width="100">
  </a>
</p>

<h1 align="center">UnionML</h1>

<p align="center">
    <strong>The easiest way to build and deploy machine learning microservices</strong>
</p>

---

<br>

[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/unionml?style=for-the-badge)](https://pypi.org/project/unionml/)
[![PyPI version shields.io](https://img.shields.io/pypi/v/unionml?style=for-the-badge)](https://pypi.org/project/unionml/)
[![Documentation Status](https://img.shields.io/readthedocs/unionml/latest?style=for-the-badge)](https://unionml.readthedocs.io/en/latest/?badge=latest)
[![Build](https://img.shields.io/github/actions/workflow/status/unionai-oss/unionml/build.yml?branch=main&style=for-the-badge)](https://github.com/unionai-oss/unionml/actions/workflows/build.yml)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/unionml?style=for-the-badge)](https://pypistats.org/packages/unionml)
[![Roadmap](https://img.shields.io/badge/Project-Roadmap-blueviolet?style=for-the-badge)](https://github.com/orgs/unionai-oss/projects/1/views/4)
[![OSS Planning](https://img.shields.io/badge/Event-OSS_Planning-yellow?style=for-the-badge)](https://app.addevent.com/event/tj14110550/)

<br>


**UnionML** is an open source MLOps framework that aims to reduce the boilerplate and friction
that comes with building models and deploying them to production.

You can create **UnionML Apps** by defining a few core methods that are automatically bundled
into ML microservices, starting with model training and offline and online prediction.

Built on top of [Flyte](https://docs.flyte.org/en/latest/), UnionML provides a high-level
interface for productionizing your ML models so that you can focus on curating a better dataset
and improving your models.

To learn more, check out the 📖 [Documentation](https://unionml.readthedocs.io).

## Installing

Install using conda:

```bash
conda install -c conda-forge unionml
```

Install using pip:

```bash
pip install unionml
```

## A Simple Example

Create a `Dataset` and `Model`, which together form a **UnionML App**:

```python
from unionml import Dataset, Model

from sklearn.linear_model import LogisticRegression

dataset = Dataset(name="digits_dataset", test_size=0.2, shuffle=True, targets=["target"])
model = Model(name="digits_classifier", init=LogisticRegression, dataset=dataset)
```

Define `Dataset` and `Model` methods for training a hand-written digits classifier:

```python
from typing import List

import pandas as pd
from sklearn.datasets import load_digits
from sklearn.metrics import accuracy_score

@dataset.reader
def reader() -> pd.DataFrame:
    return load_digits(as_frame=True).frame

@model.trainer
def trainer(
    estimator: LogisticRegression,
    features: pd.DataFrame,
    target: pd.DataFrame,
) -> LogisticRegression:
    return estimator.fit(features, target.squeeze())

@model.predictor
def predictor(
    estimator: LogisticRegression,
    features: pd.DataFrame
) -> List[float]:
    return [float(x) for x in estimator.predict(features)]

@model.evaluator
def evaluator(
    estimator: LogisticRegression,
    features: pd.DataFrame,
    target: pd.DataFrame
) -> float:
    return float(accuracy_score(target.squeeze(), predictor(estimator, features)))
```

And that's all ⭐️!

By defining these four methods, you've created a minimal **UnionML App** that you can:

- [Execute locally](https://unionml.readthedocs.io/en/latest/index.html#train-and-predict-locally) to debug and iterate on your code.
- [Serve Seamlessly with FastAPI](https://unionml.readthedocs.io/en/latest/index.html#serve-seamlessly-with-fastapi) for online prediction.
- [Deploy on a Flyte Cluster](https://unionml.readthedocs.io/en/latest/deploying.html) to scale your model training and schedule offline prediction jobs.

## Contributing

All contributions are welcome 🤝 ! Check out the [contribution guide](https://unionml.readthedocs.io/en/latest/contributing.html) to learn more about how to contribute.

### Gitpod

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/unionai-oss/unionml)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/unionai-oss/unionml/",
    "name": "unionml",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "machine-learning,artificial-intelligence,microservices",
    "author": "unionai-oss",
    "author_email": "info@union.ai",
    "download_url": "https://files.pythonhosted.org/packages/c9/1d/358c7d478d1a30446961126f609b49b2401d118637c57dbb029245c79fac/unionml-0.2.1.tar.gz",
    "platform": "any",
    "description": "<p align=\"center\">\n  <a href=\"https://www.union.ai/unionml\">\n  <img src=\"https://raw.githubusercontent.com/unionai-oss/unionml/main/docs/source/_static/images/union-logo.svg\" alt=\"Union.ai Logo\" width=\"100\">\n  </a>\n</p>\n\n<h1 align=\"center\">UnionML</h1>\n\n<p align=\"center\">\n    <strong>The easiest way to build and deploy machine learning microservices</strong>\n</p>\n\n---\n\n<br>\n\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/unionml?style=for-the-badge)](https://pypi.org/project/unionml/)\n[![PyPI version shields.io](https://img.shields.io/pypi/v/unionml?style=for-the-badge)](https://pypi.org/project/unionml/)\n[![Documentation Status](https://img.shields.io/readthedocs/unionml/latest?style=for-the-badge)](https://unionml.readthedocs.io/en/latest/?badge=latest)\n[![Build](https://img.shields.io/github/actions/workflow/status/unionai-oss/unionml/build.yml?branch=main&style=for-the-badge)](https://github.com/unionai-oss/unionml/actions/workflows/build.yml)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/unionml?style=for-the-badge)](https://pypistats.org/packages/unionml)\n[![Roadmap](https://img.shields.io/badge/Project-Roadmap-blueviolet?style=for-the-badge)](https://github.com/orgs/unionai-oss/projects/1/views/4)\n[![OSS Planning](https://img.shields.io/badge/Event-OSS_Planning-yellow?style=for-the-badge)](https://app.addevent.com/event/tj14110550/)\n\n<br>\n\n\n**UnionML** is an open source MLOps framework that aims to reduce the boilerplate and friction\nthat comes with building models and deploying them to production.\n\nYou can create **UnionML Apps** by defining a few core methods that are automatically bundled\ninto ML microservices, starting with model training and offline and online prediction.\n\nBuilt on top of [Flyte](https://docs.flyte.org/en/latest/), UnionML provides a high-level\ninterface for productionizing your ML models so that you can focus on curating a better dataset\nand improving your models.\n\nTo learn more, check out the \ud83d\udcd6 [Documentation](https://unionml.readthedocs.io).\n\n## Installing\n\nInstall using conda:\n\n```bash\nconda install -c conda-forge unionml\n```\n\nInstall using pip:\n\n```bash\npip install unionml\n```\n\n## A Simple Example\n\nCreate a `Dataset` and `Model`, which together form a **UnionML App**:\n\n```python\nfrom unionml import Dataset, Model\n\nfrom sklearn.linear_model import LogisticRegression\n\ndataset = Dataset(name=\"digits_dataset\", test_size=0.2, shuffle=True, targets=[\"target\"])\nmodel = Model(name=\"digits_classifier\", init=LogisticRegression, dataset=dataset)\n```\n\nDefine `Dataset` and `Model` methods for training a hand-written digits classifier:\n\n```python\nfrom typing import List\n\nimport pandas as pd\nfrom sklearn.datasets import load_digits\nfrom sklearn.metrics import accuracy_score\n\n@dataset.reader\ndef reader() -> pd.DataFrame:\n    return load_digits(as_frame=True).frame\n\n@model.trainer\ndef trainer(\n    estimator: LogisticRegression,\n    features: pd.DataFrame,\n    target: pd.DataFrame,\n) -> LogisticRegression:\n    return estimator.fit(features, target.squeeze())\n\n@model.predictor\ndef predictor(\n    estimator: LogisticRegression,\n    features: pd.DataFrame\n) -> List[float]:\n    return [float(x) for x in estimator.predict(features)]\n\n@model.evaluator\ndef evaluator(\n    estimator: LogisticRegression,\n    features: pd.DataFrame,\n    target: pd.DataFrame\n) -> float:\n    return float(accuracy_score(target.squeeze(), predictor(estimator, features)))\n```\n\nAnd that's all \u2b50\ufe0f!\n\nBy defining these four methods, you've created a minimal **UnionML App** that you can:\n\n- [Execute locally](https://unionml.readthedocs.io/en/latest/index.html#train-and-predict-locally) to debug and iterate on your code.\n- [Serve Seamlessly with FastAPI](https://unionml.readthedocs.io/en/latest/index.html#serve-seamlessly-with-fastapi) for online prediction.\n- [Deploy on a Flyte Cluster](https://unionml.readthedocs.io/en/latest/deploying.html) to scale your model training and schedule offline prediction jobs.\n\n## Contributing\n\nAll contributions are welcome \ud83e\udd1d ! Check out the [contribution guide](https://unionml.readthedocs.io/en/latest/contributing.html) to learn more about how to contribute.\n\n### Gitpod\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/unionai-oss/unionml)\n",
    "bugtrack_url": null,
    "license": "Apache",
    "summary": "The easiest way to build and deploy machine learning microservices.",
    "version": "0.2.1",
    "split_keywords": [
        "machine-learning",
        "artificial-intelligence",
        "microservices"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "c3112d94c654605f97023dfc53cd133b",
                "sha256": "ae891baf744b2e4c2aa8445d92121158490a07b868b3e1c7f1033424e14e75bb"
            },
            "downloads": -1,
            "filename": "unionml-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c3112d94c654605f97023dfc53cd133b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 87745,
            "upload_time": "2022-12-20T18:57:40",
            "upload_time_iso_8601": "2022-12-20T18:57:40.297351Z",
            "url": "https://files.pythonhosted.org/packages/2f/fe/31ce6b74e41e6335233e8b5acafef2a3d200e13a92513006a7c973e54b74/unionml-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "6a5abe3c1c94ebec750ec416c2d5d65c",
                "sha256": "c237a74a0599a98171a49e17ccdb138f6678b8f227d16f0d7eff154abea45d12"
            },
            "downloads": -1,
            "filename": "unionml-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "6a5abe3c1c94ebec750ec416c2d5d65c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 61390,
            "upload_time": "2022-12-20T18:57:42",
            "upload_time_iso_8601": "2022-12-20T18:57:42.439234Z",
            "url": "https://files.pythonhosted.org/packages/c9/1d/358c7d478d1a30446961126f609b49b2401d118637c57dbb029245c79fac/unionml-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-20 18:57:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "unionai-oss",
    "github_project": "unionml",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "click",
            "specs": []
        },
        {
            "name": "cookiecutter",
            "specs": []
        },
        {
            "name": "dataclasses_json",
            "specs": []
        },
        {
            "name": "docker",
            "specs": []
        },
        {
            "name": "fastapi",
            "specs": []
        },
        {
            "name": "flytekit",
            "specs": [
                [
                    ">=",
                    "1.1.0"
                ]
            ]
        },
        {
            "name": "gitpython",
            "specs": []
        },
        {
            "name": "joblib",
            "specs": []
        },
        {
            "name": "mangum",
            "specs": []
        },
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "pandas",
            "specs": []
        },
        {
            "name": "pydantic",
            "specs": []
        },
        {
            "name": "rich",
            "specs": [
                [
                    ">=",
                    "11.2.0"
                ]
            ]
        },
        {
            "name": "scikit-learn",
            "specs": []
        },
        {
            "name": "typer",
            "specs": []
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    ">=",
                    "4.3.0"
                ]
            ]
        },
        {
            "name": "uvicorn",
            "specs": []
        },
        {
            "name": "importlib-metadata",
            "specs": []
        }
    ],
    "lcname": "unionml"
}
        
Elapsed time: 0.02698s