Giter Site home page Giter Site logo

bilal-aamer / unionml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from unionai-oss/unionml

0.0 0.0 0.0 712 KB

UnionML: the easiest way to build and deploy machine learning microservices

Home Page: https://unionml.readthedocs.io

License: Apache License 2.0

Python 97.30% Makefile 0.04% Dockerfile 2.67%

unionml's Introduction

Union.ai Logo

UnionML

The easiest way to build and deploy machine learning microservices



PyPI - Python Version PyPI version shields.io Documentation Status Build PyPI - Downloads Roadmap OSS Planning


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, 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.

Installing

Install using pip:

pip install unionml

A Simple Example

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

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:

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:

Contributing

All contributions are welcome ๐Ÿค ! Check out the contribution guide to learn more about how to contribute.

unionml's People

Contributors

cosmicbboy avatar eapolinario avatar bilal-aamer avatar smritisatyanv avatar sugatoray avatar jonwiggins avatar kumare3 avatar samhita-alla avatar zevisert avatar mmorzywolek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.