Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rekcurd/rekcurd-python

Project for serving ML module. This is a gRPC micro-framework.
https://github.com/rekcurd/rekcurd-python

drucker grpc kubernetes ml rekcurd

Last synced: 3 months ago
JSON representation

Project for serving ML module. This is a gRPC micro-framework.

Awesome Lists containing this project

README

        

# Rekcurd

[![Build Status](https://travis-ci.com/rekcurd/rekcurd-python.svg?branch=master)](https://travis-ci.com/rekcurd/rekcurd-python)
[![PyPI version](https://badge.fury.io/py/rekcurd.svg)](https://badge.fury.io/py/rekcurd)
[![codecov](https://codecov.io/gh/rekcurd/rekcurd-python/branch/master/graph/badge.svg)](https://codecov.io/gh/rekcurd/rekcurd-python "Non-generated packages only")
[![pypi supported versions](https://img.shields.io/pypi/pyversions/rekcurd.svg)](https://pypi.python.org/pypi/rekcurd)

Rekcurd is the Project for serving ML module. This is a gRPC micro-framework and it can be used like [Django](https://docs.djangoproject.com/) and [Flask](http://flask.pocoo.org/).

## Parent Project
https://github.com/rekcurd/community

## Components
- [Rekcurd](https://github.com/rekcurd/rekcurd-python): Project for serving ML module.
- [Rekcurd-dashboard](https://github.com/rekcurd/dashboard): Project for managing ML model and deploying ML module.
- [Rekcurd-client](https://github.com/rekcurd/python-client): Project for integrating ML module.

## Installation
From source:

```bash
$ git clone --recursive https://github.com/rekcurd/rekcurd-python.git
$ cd rekcurd-python
$ pip install -e .
```

From [PyPi](https://pypi.org/project/rekcurd/) directly:

```bash
$ pip install rekcurd
```

## How to use
Example is available [here](https://github.com/rekcurd/rekcurd-example/tree/master/python/sklearn-digits). You can generate Rekcurd template and implement necessary methods.

```bash
$ rekcurd startapp {Your application name}
$ cd {Your application name}
$ vi app.py
$ python app.py
```

## Unittest
```
$ python -m unittest
```

## Kubernetes support
Rekcurd can be run on Kubernetes. See [community repository](https://github.com/rekcurd/community).

## Type definition
### `PredictLabel` type
*V* is the length of feature vector.

|Field |Type |Description |
|:---|:---|:---|
|input
(required) |One of below
- string
- bytes
- string[*V*]
- int[*V*]
- double[*V*] |Input data for inference.
- "Nice weather." for a sentiment analysis.
- PNG file for an image transformation.
- ["a", "b"] for a text summarization.
- [1, 2] for a sales forcast.
- [0.9, 0.1] for mnist data. |
|option |string| Option field. Must be json format. |

The "option" field needs to be a json format. Any style is Ok but we have some reserved fields below.

|Field |Type |Description |
|:---|:---|:---|
|suppress_log_input |bool |True: NOT print the input and output to the log message.
False (default): Print the input and outpu to the log message. |
|YOUR KEY |any |YOUR VALUE |

### `PredictResult` type
*M* is the number of classes. If your algorithm is a binary classifier, you set *M* to 1. If your algorithm is a multi-class classifier, you set *M* to the number of classes.

|Field |Type |Description |
|:---|:---|:---|
|label
(required) |One of below
-string
-bytes
-string[*M*]
-int[*M*]
-double[*M*] |Result of inference.
-"positive" for a sentiment analysis.
-PNG file for an image transformation.
-["a", "b"] for a multi-class classification.
-[1, 2] for a multi-class classification.
-[0.9, 0.1] for a multi-class classification. |
|score
(required) |One of below
-double
-double[*M*] |Score of result.
-0.98 for a binary classification.
-[0.9, 0.1] for a multi-class classification. |
|option |string |Option field. Must be json format. |

### `EvaluateResult` type
`EvaluateResult` is the evaluation score. *N* is the number of evaluation data. *M* is the number of classes. If your algorithm is a binary classifier, you set *M* to 1. If your algorithm is a multi-class classifier, you set *M* to the number of classes.

|Field |Type |Description |
|:---|:---|:---|
|num
(required)|int |Number of evaluation data. |
|accuracy
(required) |double |Accuracy. |
|precision
(required) |double[*M*] |Precision. |
|recall
(required) |double[*M*] |Recall. |
|fvalue
(required) |double[*M*] |F1 value. |

### `EvaluateDetail` type
`EvaluateDetail` is the details of evaluation result.

|Field |Type |Description |
|:---|:---|:---|
|result
(required) |PredictResult |Prediction result. |
|is_correct
(required) |bool |Correct or not. |