V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
llxxxll

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

  •  
  •   llxxxll · May 6, 2019 · 2184 views
    This topic created in 2554 days ago, the information mentioned may be changed or developed.

    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; --选择已训练好的模型
    
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   802 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 19:41 · PVG 03:41 · LAX 12:41 · JFK 15:41
    ♥ Do have faith in what you're doing.