蚂蚁金服开源 SQLFlow,训练模型像 SQL 一样简单。

2019-05-06 13:09:19 +08:00
 llxxxll

SQLFlow > https://github.com/sql-machine-learning/sqlflow

训练模型

SELECT *
FROM iris.train  --从元数据表读数据
TRAIN DNNClassifier --选择 DNN 分类器
WITH n_classes = 3, hidden_units = [10, 20] --设置分类数(训练数据是三分类)和 hidden layer
COLUMN sepal_length, sepal_width, petal_length, petal_width  --选择加入训练的数据列
LABEL iris.train.class --选择标注的 label 列
INTO sqlflow_models.my_dnn_model;  --保存模型	

用训练好的模型预测一组数据的 label

SELECT *
FROM iris.test  --从待预测的数据表读数据( sepal_length, sepal_width, petal_length, petal_width 有数据,但 label 为空)
PREDICT iris.predict.class --待填充的 label 数据列
USING sqlflow_models.my_dnn_model; --选择已训练好的模型

1935 次点击
所在节点    分享发现
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/561435

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX