Export a general-purpose model

更新时间:
复制 MD 格式

The Export General-Purpose Model component saves a trained MaxCompute model to Object Storage Service (OSS). Use it as the final step in a PAI Designer pipeline after training — the exported model is then available for deployment or sharing.

Prerequisites

Before you begin, ensure that you have:

Supported upstream components

The following training components can connect to the Export General-Purpose Model component. Port requirements and supported export formats differ by component type.

Upstream componentTypeSupported formatsPort connection
Gradient Boosting Decision Trees (GBDT) Binary ClassificationGeneral MLoriginal, pmmlPort 1 only
Linear Support Vector MachineGeneral MLoriginal, pmmlPort 1 only
Logistic Regression Binary ClassificationGeneral MLoriginal, pmmlPort 1 only
GBDT RegressionGeneral MLoriginal, pmmlPort 1 only
Linear RegressionGeneral MLoriginal, pmmlPort 1 only
k-means ClusteringGeneral MLoriginal, pmmlPort 1 only
Logistic Regression Multiclass ClassificationGeneral MLoriginal, pmmlPort 1 only
Naive BayesGeneral MLoriginal, pmmlPort 1 only
PS-SMART Binary Classification TrainingPS-seriesoriginal onlyPort 1 and port 2
PS-SMART Multiclass ClassificationPS-seriesoriginal onlyPort 1 and port 2
PS-SMART RegressionPS-seriesoriginal onlyPort 1 and port 2
PS Linear RegressionPS-seriesoriginal onlyPort 1 and port 2

Port connection rules:

  • General ML components — connect the output model to port 1 of the Export General-Purpose Model component.端口1

  • PS-series components — connect to both port 1 and port 2.端口1&端口2

Configure the component in Designer

On the Parameters tab of the Export General-Purpose Model component, configure the following parameters.

image.png
ParameterRequiredDescriptionDefault
RenameNoA new name for the exported model. If left blank, the model is saved using the name of the upstream output model.None (model keeps upstream name)
Overwrite Existing ModelNoWhen used together with Rename, overwrites the previously exported model on each run. Configure this to avoid accumulating multiple exports at the same OSS path.Not selected
OverwriteNoOverwrites any model file of the same name at the specified OSS path.Not selected
Export Model FormatYesThe format of the exported model file. Supported values: original (exports a .meta file and a .model file) or pmml (exports a .xml file). Check the table above to confirm which formats your upstream component supports.None
To overwrite the previously exported model on every run, set Rename and select Overwrite Existing Model.

Configure the component using PAI commands

Run the following PAI command in an SQL script or an ODPS SQL node in DataWorks.

PAI -name generalmodeltransfer2oss
-project algo_public
-Dformat="original"
-Drename="model_export"
-Doverwrite="false"
-DossPath="oss://examplebucket-cn-hangzhou-internal.aliyuncs.com/export/"
-Darn="acs:ram::xxxxxxxxxx:role/aliyunodpspaidefaultrole"
-DmodelName="model_flow_aius5tamq5rv4x****_node_anprs9ufo40opc****_model"
ParameterRequiredDescriptionDefault
formatYesExport format: original or pmml.None
renameNoNew name for the exported model.None (model keeps upstream name)
overwriteNoWhether to overwrite a model of the same name at the target path. Accepted values: true or false.false
ossPathYesThe OSS path to export the model to.None
arnYesThe authorization information (ARN of the RAM role). To get this value, go to the PAI console, navigate to All Product Dependencies, find the Designer section, and click View Authorization Information in the Actions column. For details, see Cloud product dependencies and authorization: Designer.None
inputTableNoRequired when exporting from a PS-series component. Specify the model table generated by the training component.None
modelNameYesThe name of the offline model to export.None