3.2 模型管理
在机器学习算法进行训练后,生成的模型需要进行存储,以便后续推理进行使用。训练过程的时序图如下:
在训练过程中,最后一步是通过调用store_model接口,在系统表gs_model_warehouse中插入一条记录,用于存储该训练算法及超参信息,以便开发者和调用者观测模型训练的结果,方便定位和调优。
系统表gs_model_warehouse结构下表所示:
Name |
Type |
Describe |
oid |
oid |
Hide Columns |
modelname |
text |
Unique key |
modelowner |
oid |
Function owner |
createTime |
timestamp |
Model storage time |
processedtuples |
int |
Number of tuples involved in training |
discardedtuples |
int |
Number of unqualified tuples that do not participate in training |
exectimemsecs |
real |
Execute times |
iterations |
int |
Number of training iterations |
outputtype |
oid |
store the return type of the model (text, bigint, real...) |
modeltype |
text |
AI Operator Type |
query |
text |
SQL statements for training models |
modeldata |
bytea |
store binary model |
weight |
Real[] |
Just in SGD algorithm |
hyperparametersnames |
text[] |
Hyper parameters names |
hyperparametersvalues |
text[] |
Hyper parameters values |
hyperparametersoids |
oid[] |
Hyper parameters oids |
coefnames |
text[] |