python grpc框架,用于提供用python编写的机器学习模块。
rekcurd的Python项目详细描述
残渣
rekcurd是为ml模块提供服务的项目。这是一个grpc微框架,可以像Django和Flask那样使用。
母项目
https://github.com/rekcurd/community
部件
- Rekcurd:为ML模块提供服务的项目
- Rekcurd-dashboard:管理ml模型和部署ml模块的项目。
- Rekcurd-client:集成ml模块的项目。
安装
来源:
$ git clone --recursive https://github.com/rekcurd/rekcurd-python.git
$ cd rekcurd-python
$ pip install -e .
直接从PyPi发送:
$ pip install rekcurd
如何使用
示例可用here。可以生成Rekcurd模板并实现必要的方法
$ rekcurd startapp {Your application name} $ cd{Your application name} $ vi app.py $ python app.py
单元测试
$ python -m unittest
Kubernetes支持
可以在库伯内特斯身上运行Rekcurd。见community repository
类型定义
PredictLabel
类型
v是特征向量的长度。
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. |
“option”字段必须是json格式。任何样式都可以,但下面有一些保留字段。
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
类型
m是类的数目。如果算法是二进制分类器,则将m设置为1。如果算法是多类分类器,则将m设置为类数。
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
类型
EvaluateResult
是评估分数n是计算数据的数目。m是类的数目。如果算法是二进制分类器,则将m设置为1。如果算法是多类分类器,则将m设置为类数。
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
类型
EvaluateDetail
是评估结果的详细信息。
Field | Type | Description |
---|---|---|
result (required) | PredictResult | Prediction result. |
is_correct (required) | bool | Correct or not. |