用于Python的TotoML SDK

totoml的Python项目详细描述


TotoML Python SDK

这个库是Toto-ML的一个SDK

此库提供以下关键组件:

Model Controller:模型控制器是模型的包装器。它提供:

  • restapi来触发训练、评分和预测
  • 基于事件的访问(培训、评分、预测)

如何使用它

在你的主python文件中(例如。应用程序),导入ModelControllerControllerConfig类,创建一个Flask应用程序,实例化您的模型(在本例中是ERCBOD()),并将其传递给ModelController构造函数。在

from totoml.controller import ModelController
from totoml.config import ControllerConfig

app = Flask(__name__)

model_controller = ModelController(ERCBOD(), app, ControllerConfig(enable_batch_predictions_events=False, enable_single_prediction_events=False))

为了让模型控制器工作,您必须向它提供您的模型(在示例ERBOCD()):这里称为模型委托。

ModelDelegate是由SDK(delegate.ModelDelegate)提供的^{str1}$抽象类。你的模型必须实现它的方法。
这些方法是:

get_name()
This method has to return the name of the model. This is very important because the name of the model is used for everything in TotoML (internal folders, registry, file storage, etc..), so the name has to be unique.

get_model_type()
Not very used for now. Should return the type of model: sklearn, tf, etc..
Has to be an instance of ModelType

predict() and predict_batch()
These methods perform predictions.

score()
This method scores the current champion model: it has to recalculate the metrics for the model and return them

train()
This method performs the training of the model and returns the trained model and all the associated files.
It's important to note that also any file containing training data or built features should be returned, so that Toto ML can grant the persistence of those files and make sure there is lineage.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何生成格式化文件。xml文件?   java向Vaadin布局添加模糊侦听器   Java中的默认构造函数内容   java Eclipse错误:“无法找到jre7的可执行文件”   Java8,如何使用流实现switch语句?   java在CDH4示例上运行map reduce作业   java在servlet中获取文件名   如何禁止在所有浏览器中加载脚本“Selenium Java”   java Play框架和gradle   如果DifferencedName有引号,java无法从组中获取成员   java如何在使用链表实现的堆栈中实现pop操作?   java如何在网络视图中全屏制作YouTube视频?   如何在java中为分配的时间或固定的时间执行循环   java如何使用Android SDK在onCreate语句中动态更改活动的背景颜色?   java如何理解客户端没有来自IBM MQ的消息的原因?   java使用表查找用户最多出现的字母   java中的数组多维数据结构   java如何将一个值设置为一个类中的变量,并从另一个类中获取该变量的值?   java在创建新AVD后无法运行Android应用程序   java使用广度优先搜索算法存储迷宫求解路径