# pai-ai_workloads

Part of **PAI**

# Platform for AI (PAI) AI Workloads Console Guide

## Operations Overview

| Operation | Console Navigation Path | Prerequisites | Description |
|----------|------------------------|---------------|-------------|
| Generate Images from GAN Model | PAI > Machine Learning Designer > Pipeline > Add Component > Image generation predict | Pre-trained GAN model in OSS, GPU instance type, OSS output path in same bucket | Generates new images using a trained GAN model and saves them to OSS |
| Train GAN Model | Platform for AI > Machine Learning Designer > Image Generation Component | Training images in OSS, GPU instance type, output path in same OSS bucket | Trains a GAN model (DCGAN, WGAN-GP, etc.) on image data |
| Train Image Classification Model | Console > PAI > Machine Learning Designer > Video Algorithm > Offline Training > Image Classification (Torch) | Activated OSS bucket in same region, ML Designer authorized to access OSS | Trains an image classifier using PyTorch with backbones like ResNet or ViT |
| Train Object Detection Model | PAI > Designer > Components > Object detection (easycv) | Activated OSS, ML Studio authorized to access OSS | Trains YOLOX, FCOS, YOLOv5, or YOLOv7 models on labeled image data |
| Train Video Model | Console > PAI > Machine Learning Designer > Components > Video Algorithm > Offline Training > Video classification | Active OSS instance, ML Studio authorized to access OSS | Trains 3D CNN or transformer models (X3D, Swin) for video classification |
| Compute Shortest Paths | DataWorks > Machine Learning Designer > Pipeline Editor | Input edge table with vertex/weight data, access to ML Designer | Computes shortest paths from a source node using Dijkstra’s algorithm |
| Calculate Tree Depth | Machine Learning Designer > Pipelines > Add Component > Tree Depth | Input edge table with start/end vertex columns, graph knowledge | Calculates maximum depth of each node in a directed tree structure |
| Count Triangles in Graph | PAI Console > Machine Learning Designer > Pipelines > Add Component > Counting Triangle | Valid PAI project with algo_public access, edge table input | Counts triangles (3-node cliques) in an undirected graph |
| Configure ALS Matrix Factorization Component | Console > PAI > Pipeline Studio > Add Component > ALS Matrix Factorization | Existing pipeline, input table with user_id/item_id/rating (BIGINT/numeric) | Sets up Alternating Least Squares for collaborative filtering |
| Predict User-Item Score | Machine Learning Platform for AI > Components > ALS Prediction | Trained ALS model outputs (user/item factor tables), input with user/item IDs | Generates predicted scores for user-item pairs |
| Compute Item Similarity | Machine Learning Designer > Pipeline > Collaborative Filtering (etrec) | Input table with user/item columns, PAI project access | Computes top-N similar items using item-based collaborative filtering |
| Perform Offline Prediction | Console > Machine Learning Designer > Pipeline > Configure Component | Trained Swing model, test dataset in table | Runs batch recommendations using the Swing algorithm |
| Configure Swing Train Component | Console > PAI > Machine Learning Designer > Create Pipeline | Training/test datasets in MaxCompute tables | Configures Swing training for item recall based on user-item-user patterns |
| Run Two-Sample T-Test | Console > PAI > Machine Learning Designer > Pipeline > Two-sample t-test Component | Input tables with numeric columns (DOUBLE/INT) | Compares means between two independent or paired groups |
| Run One-Sample T-Test | Console > PAI > Machine Learning Designer > Add Component > One Sample T Test | Input table with numeric column, PAI workspace access | Tests if sample mean differs from a hypothesized population mean |
| Run Batch Prediction | PAI > Machine Learning Designer > Batch Prediction | Trained model (OfflineModel or paired component), workspace | Executes large-scale non-real-time inference on datasets |
| Group Selected Nodes | Console > Machine Learning > Alink Components > Group Nodes | Alink components on canvas, multiple nodes selected | Groups nodes for batch execution and shared resource configuration |
| Grant Permissions to Use ML Designer | Console > Activate and Authorize > All Cloud Product Dependencies | Alibaba Cloud account, PAI workspace | Grants OSS, MaxCompute, Flink, and compute permissions to PAI |

## Operation Steps

### Generate Images from GAN Model

**Navigation**: PAI > Machine Learning Designer > Pipeline > Add Component > Image generation predict

**Prerequisites**:
- A PAI Machine Learning Designer pipeline
- A pre-trained GAN model file accessible from an OSS path
- An OSS output path in the same bucket as the model
- GPU instance type selected for compute resources

1. Drag the **image generation predict** component onto the canvas
   - Element: **image generation predict** (button) — component library panel

2. Connect an upstream Read File Data or image generation component to the input port, or set **oss path for model** under Fields Setting tab
   - Element: **oss path for model** (text_input) — Fields Setting tab

3. Set the output path and model parameters under Fields Setting and param setting tabs
   - Element: **oss path for output dir** (text_input) — Fields Setting tab

4. Select a GPU instance type under the Tuning tab
   - Element: **Select Resource Group > Public Resource Group** (dropdown) — Tuning tab
   - Notes: The algorithm requires GPU compute.

5. Run the pipeline
   - Element: **Run** (button) — top-right corner of pipeline editor
   - Notes: Generated images are saved to the specified OSS path.

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| oss path for model | text_input | No | — | OSS path where the model file resides. Required only when no upstream Read File Data or image generation component is connected. |
| oss path for output dir | text_input | Yes | — | OSS path where generated images are saved. Must be in the same OSS bucket as the pre-trained model. |
| model type | dropdown | Yes | DCGAN, WGAN-GP, LSGAN, GGAN, PGGAN, StyleGAN | GAN architecture to use for image generation. |
| num samples | number_input | Yes | — | Total number of samples to be generated. |
| number batches | number_input | Yes | — | Number of samples to be generated in each batch. Samples vary significantly across batches. |
| Select Resource Group > Public Resource Group | dropdown | No | — | Instance type and virtual private cloud (VPC) for the component. Select a GPU instance type — the algorithm requires GPU compute. |
| Dedicated resource group | text_input | No | — | Number of CPU cores, memory, shared memory, and GPUs for the component when using a dedicated resource group. |
| Maximum Running Duration (seconds) | number_input | No | — | Time limit for the component run. If exceeded, the job is terminated. |

### Train GAN Model

**Navigation**: Platform for AI > Machine Learning Designer > Image Generation Component

**Prerequisites**:
- A GPU instance type is required for training
- Training images must be stored in OSS
- Pre-trained model (if used) must be in the same OSS bucket as training images
- Output path must be in the same OSS bucket as training images

1. Add the **image generation** component to your pipeline
   - Element: **image generation** (panel) — main content area

2. Configure the input data source
   - Element: **Read File Data** (panel) — left navigation panel
   - Notes: Connect this component to specify the OSS path containing training images

3. Manually specify the OSS path to training data if no upstream data source is connected
   - Element: **oss path to train data** (text_input) — Fields Setting tab

4. Specify the OSS path for the pre-trained model (optional)
   - Element: **oss path to pretrained model** (text_input) — Fields Setting tab
   - Notes: Must be in the same OSS bucket as training images

5. Set the output path for the trained model
   - Element: **oss path to output distributed** (text_input) — Fields Setting tab
   - Notes: Must be in the same OSS bucket as training images

6. Select the GAN architecture to use
   - Element: **image generation network** (dropdown) — Parameters Setting tab
   - Notes: Available options: DCGAN, WGAN-GP, LSGAN, GGAN, PGGAN, StyleGAN

7. Set the learning rate
   - Element: **learning rate** (number_input) — Parameters Setting tab

8. Set the number of training iterations
   - Element: **number of train iterations** (number_input) — Parameters Setting tab

9. Set the visualization interval
   - Element: **visualization iterations** (number_input) — Parameters Setting tab
   - Notes: Generated samples are saved to the training_samples folder in the output path

10. Set the batch size
    - Element: **batch size** (number_input) — Parameters Setting tab

11. Set the model save interval
    - Element: **model save interval** (number_input) — Parameters Setting tab

12. Select a resource group for training
    - Element: **Select Resource Group** (radio) — Tuning tab
    - Notes: Public Resource Group or Dedicated resource group

13. Specify compute resources if using Dedicated resource group
    - Element: **Dedicated resource group** (text_input) — Tuning tab
    - Notes: Specify CPU cores, memory, shared memory, and number of GPUs

14. Set maximum running duration (optional)
    - Element: **Maximum Running Duration (seconds)** (number_input) — Tuning tab
    - Notes: Training terminates if this duration is exceeded

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| oss path to train data | text_input | No | — | If you do not connect an upstream data source, manually specify the OSS path where training images are stored. |
| oss path to pretrained model | text_input | No | — | The OSS path to a pre-trained model for transfer learning. If left empty, training starts from scratch. The pre-trained model must be stored in the same OSS bucket as your training images. |
| oss path to output distributed | text_input | Yes | — | The OSS path where the trained model will be saved. The output path must be in the same OSS bucket as your training images. |
| image generation network | dropdown | Yes | dcgan, wgan-gp, lsgan, ggn, pggan, stylegan | The GAN architecture to use for training. Available options: DCGAN, WGAN-GP, LSGAN, GGAN, PGGAN, and StyleGAN. |
| learning rate | number_input | Yes | — | The learning rate for model optimization. |
| number of train iterations | number_input | Yes | — | The total number of training iterations. Each iteration processes one batch of images (determined by the batch size parameter). |
| visualization iterations | number_input | Yes | — | The interval at which the model generates sample images from random noise for visual inspection. Generated samples are saved to the training_samples folder in the path specified by oss path to output distributed. |
| batch size | number_input | Yes | — | The number of images processed in each training iteration. |
| model save interval | number_input | No | — | The frequency at which model checkpoints are saved during training (measured in epochs). |
| Select Resource Group | radio | No | Public Resource Group, Dedicated resource group | Select the instance type and VPC for training. A GPU instance type is required for this algorithm. |
| Maximum Running Duration (seconds) | number_input | No | — | The maximum execution time for the component. Training terminates if this duration is exceeded. |

### Train Image Classification Model

**Navigation**: Console > PAI > Machine Learning Designer > Video Algorithm > Offline Training > Image Classification (Torch)

**Prerequisites**:
- An activated OSS bucket in the same region as your Designer workspace
- Machine Learning Designer authorized to access OSS

1. Find and add the **Image Classification (Torch)** component to the pipeline
   - Element: **Image Classification (Torch)** (panel) — Component library under Video Algorithm > Offline Training

2. Connect upstream Read OSS data components to the input ports
   - Element: **Data annotation path for training** (link) — Input ports section
   - Notes: If both input port and parameter are set, input port value takes precedence.

3. Configure the **Fields Setting** tab parameters
   - Element: **Fields Setting** (tab) — Component configuration panel

4. Set backbone, number of classes, image size, optimizer, and learning rate in **Parameters Setting** tab
   - Element: **Parameters Setting** (tab) — Component configuration panel
   - Notes: Choose backbone based on dataset size, accuracy needs, and compute resources.

5. Select compute mode in **Tuning** tab
   - Element: **single worker or distributed on DLC** (dropdown) — Tuning tab
   - Notes: Use single_on_dlc for single-node training; distribute_on_dlc for multi-node distributed training.

6. Connect output port to General Image Prediction component
   - Element: **Output model** (link) — Output port section
   - Notes: The output is the OSS directory path configured in 'oss dir to save model'.

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| model type | dropdown | Yes | classification | The classification task type. Only classification is supported. |
| oss dir to save model | text_input | Yes | — | The OSS directory where the trained model is saved. Example: oss://examplebucket/yunji.cjy/designer_test |
| oss annotation path for training data | text_input | No | — | OSS path of the labeled training annotation file. Required if no training input port is connected. |
| oss annotation path for evaluation data | text_input | No | — | OSS path of the labeled evaluation annotation file. Required if no evaluation input port is connected. |
| class list file | text_input | Yes | — | Specifies image category names. Accepts bracket-delimited list, OSS path to TXT file, or leave blank to use numeric labels. |
| Data Source Type | dropdown | Yes | ClsSourceImageList, ClsSourceItag | The annotation format of your input data. |
| oss path for pretrained model | text_input | No | — | OSS path of a custom pre-trained model. If left blank, the default pre-trained model provided by PAI is used. |
| backbone | dropdown | Yes | resnet, resnext, hrnet, vit, swint, mobilenetv2, inceptionv4 | The backbone architecture for feature extraction. |
| num classes | number_input | Yes | — | The number of image categories in your dataset. |
| image size after resizing | number_input | Yes | — | The pixel dimension to which images are resized (square). |
| optimizer | dropdown | Yes | SGD, Adam | The optimization algorithm. |
| initial learning rate | number_input | Yes | — | The starting learning rate. |
| learning rate policy | dropdown | Yes | step | The strategy for adjusting the learning rate during training. |
| lr step | text_input | Yes | — | The epoch numbers at which the learning rate decays by 90%. Separate multiple values with commas. |
| train batch size | number_input | Yes | — | Number of samples per training iteration. |
| eval batch size | number_input | Yes | — | Number of samples per evaluation iteration. |
| total train epochs | number_input | Yes | — | Total number of training passes over the full dataset. |
| save checkpoint epoch | number_input | No | — | Interval (in epochs) at which a checkpoint is saved. |
| Exported model type | dropdown | Yes | raw, ONNX | Format of the exported model. |
| number process of reading data per gpu | number_input | No | — | Number of data-loading threads per GPU. |
| use fp 16 | checkbox | No | — | Enables FP16 (half-precision) training to reduce GPU memory usage. |
| single worker or distributed on DLC | dropdown | Yes | single_on_dlc, distribute_on_dlc | Compute mode. Use single_on_dlc for single-node training or distribute_on_dlc for multi-node distributed training. |
| number of worker | number_input | No | — | Number of worker nodes. Required when using distribute_on_dlc. |
| cpu machine type | text_input | No | — | CPU instance type. Required when using distribute_on_dlc. |
| gpu machine type | text_input | Yes | — | GPU instance type. |

### Train Object Detection Model

**Navigation**: PAI > Designer > Components > Object detection (easycv)

**Prerequisites**:
- Activated OSS
- Authorized Machine Learning Studio to access OSS

1. Create a dataset and a labeling job in PAI Designer
   - Element: **Create a dataset: for data labeling** (link) — main content area

2. Select the **General Template** under Object Detection
   - Element: **General Template** (menu) — labeling job creation form

3. Select **Single-label** in Object Detection Label Configuration
   - Element: **Single-label** (radio) — Object Detection Label Configuration section

4. Enter all label names in the **Label Configuration** section
   - Element: **Label Configuration** (text_input) — Label Configuration section

5. Export labeled results in manifest format to OSS
   - Element: **Export** (button) — labeling job results panel
   - Notes: Ensure export format is set to manifest

6. Add a **Read OSS data** component to the pipeline
   - Element: **Read OSS data** (panel) — component library

7. Set **OSS Data Path** to the manifest file path
   - Element: **OSS Data Path** (text_input) — Read OSS data configuration panel
   - Notes: Example: oss://examplebucket.oss-cn-shanghai.aliyuncs.com/ev_demo/xxx.manifest

8. Connect the Read OSS data output to the **Object detection (easycv)** component inputs
   - Element: **Training data** (link) — Object detection (easycv) component

9. Configure model type, data format, and other parameters on the **Field settings** tab
   - Element: **Field settings** (tab) — Object detection (easycv) component configuration panel

10. Configure training parameters such as number of classes, image scale, batch size, epochs, etc.
    - Element: **Parameters** (tab) — Object detection (easycv) component configuration panel

11. Set GPU machine type and enable FP16 if needed
    - Element: **GPU machine type** (dropdown) — Tuning tab

12. Run the pipeline to start training
    - Element: **Run** (button) — top-right corner

13. Add an **image prediction** component downstream for inference
    - Element: **image prediction** (panel) — component library
    - Notes: Available only for FCOS and YOLOX models

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Model type | dropdown | Yes | FCOS, YOLOX, YOLOv5, YOLOv7 | Model architecture for training. |
| Data format | dropdown | Yes | DetSourcePAI, COCO | Annotation format for your dataset. |
| Annotation file path for training set | text_input | No | — | Path to the training annotation file. Use a .manifest file for DetSourcePAI or a .json file for COCO. |
| Annotation file path for validation set | text_input | No | — | Path to the validation annotation file. Use a .manifest file for DetSourcePAI or a .json file for COCO. |
| Training data OSS path | text_input | No | — | Path to training images in COCO format. Appears only when Data format is set to COCO. |
| Validation data OSS path | text_input | No | — | Path to evaluation images in COCO format. Appears only when Data format is set to COCO. |
| Class list file OSS path | text_input | No | — | Path to a label list file with a .txt extension. |
| Pre-trained model OSS path | text_input | No | — | OSS path to a custom pre-trained model. If not specified, PAI uses a default pre-trained model. |
| OSS directory for training | text_input | No | — | OSS directory where the trained model is saved. |
| YOLOX model structure | dropdown | Yes | yolox-s, yolox-m, yolox-l, yolox-x | Architecture variant for YOLOX. |
| Number of classes | number_input | Yes | — | Number of object classes in your dataset. |
| Image scale | text_input | Yes | — | Image dimensions after resizing (height width). Example: 320 320. |
| Optimizer | dropdown | Yes | momentum, adam | Optimizer for model training. |
| Initial learning rate | number_input | Yes | — | Learning rate at the start of training. |
| Training batch size | number_input | Yes | — | Number of samples per training iteration. |
| Validation batch size | number_input | Yes | — | Number of samples per evaluation iteration. |
| Number of epochs | number_input | Yes | — | Total training epochs. For YOLOX, this value must exceed the sum of Warmup epochs and Last no augmented lr epochs. |
| Log loss frequency | number_input | No | — | Frequency (in batches) for logging the training loss. |
| Validation frequency | number_input | No | — | Validation interval in epochs. A value of 2 runs validation every two epochs. |
| Warmup epochs | number_input | No | — | Applies to YOLOX only. Number of warm-up epochs at the start of training. |
| Last no augmented lr epochs | number_input | No | — | Applies to YOLOX only. Number of final epochs run without data augmentation. |
| Export model format | dropdown | Yes | raw, jit, onnx | Format of the exported model. JIT is not supported for YOLOv5 and YOLOv7. |
| Checkpoint saving frequency | number_input | No | — | Frequency (in epochs) for saving model checkpoints. A value of 1 saves a checkpoint after every epoch. |
| GPU machine type | dropdown | Yes | 4 | GPU instance type for training. A GPU instance is required. |
| Enable FP16 | checkbox | No | true, false | Enables FP16 half-precision training to reduce memory usage and speed up training on supported GPUs. |
| Execution mode | dropdown | Yes | Distributed DLC | Distributed training on DLC. Only distributed mode is supported. |

### Train Video Model

**Navigation**: Console > PAI > Machine Learning Designer > Components > Video Algorithm > Offline Training > Video classification

**Prerequisites**:
- An active Object Storage Service (OSS) instance
- Machine Learning Studio authorized to access OSS

1. Add two **Read File Data** components
   - Element: **Read File Data** (panel) — Component library

2. Set the **OSS Data Path** parameter of each Read File Data component
   - Element: **OSS Data Path** (text_input) — Component configuration panel
   - Notes: Set to the OSS path of your training data and evaluation data respectively

3. Connect the two Read File Data components to the **train data** and **eval data** input ports
   - Element: **train data** (link) — Video classification component

4. Configure the video classification component parameters
   - Element: **Fields Setting tab** (tab) — Component configuration panel
   - Notes: Set required parameters like oss path to save checkpoint, numclasses, learning rate, etc.

5. Select a model architecture from the **video classification network** dropdown
   - Element: **video classification network** (dropdown) — Parameters Setting tab
   - Notes: Available options: x3d_xs, x3d_m, x3d_l, swin_t, swin_s, swin_b, swin_t_bert

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| oss path to save checkpoint | text_input | Yes | — | The OSS path where checkpoints are stored. Example: oss://pai-online-shanghai.oss-cn-shanghai-internal.aliyuncs.com/test/test_video_cls |
| oss path to data | text_input | No | — | The OSS directory containing video files. The full video path is this directory joined with the filename in the annotation file. |
| oss path to train file | text_input | No | — | The OSS path of the training annotation file. Required if the train data input port is not connected. |
| oss path to evaluation file | text_input | No | — | The OSS path of the evaluation annotation file. Required if the eval data input port is not connected. |
| oss path to pretrained model | text_input | No | — | The OSS path of a pre-trained model. Using a pre-trained model improves model precision. |
| video classification network | dropdown | Yes | x3d_xs, x3d_m, x3d_l, swin_t, swin_s, swin_b, swin_t_bert | The model architecture. See Supported models for available values and their characteristics. |
| whether to use multilabel | checkbox | No | true, false | Enables multi-label classification. Available only for swin_t_bert. |
| numclasses | number_input | Yes | — | The number of categories. |
| learning rate | number_input | Yes | — | The initial learning rate. |
| number of train epochs | number_input | Yes | — | The number of training epochs. |
| warmup epoch | number_input | Yes | — | The number of warmup epochs. The learning rate starts at a small value and increases gradually to the configured learning rate over this period. |
| batch size | number_input | Yes | — | The number of samples per training iteration. |
| model save interval | number_input | No | — | The epoch interval at which a checkpoint is saved. 1 saves a checkpoint after every epoch. |
| use fp 16 | checkbox | Yes | — | Enables FP16 mixed-precision training to reduce GPU memory usage during training. |
| single worker or distributed on dlc | dropdown | No | single_dlc, distribute_dlc | The execution mode. single_dlc: single-worker on DLC. distribute_dlc: distributed on DLC. |
| gpu machine type | text_input | No | — | The GPU node specification. |

### Compute Shortest Paths

**Navigation**: DataWorks > Machine Learning Designer > Pipeline Editor

**Prerequisites**:
- An input edge table with vertex and edge weight data
- Access to Machine Learning Designer in DataWorks

1. Add the **Single-source Shortest Path** component to the pipeline
   - Element: **Single-source Shortest Path** (panel) — Pipeline canvas

2. Configure parameters on the **Fields Setting** tab
   - Element: **Fields Setting** (tab) — Component configuration panel

3. Set the **Source Vertex Column** parameter
   - Element: **Source Vertex Column** (text_input) — Fields Setting tab
   - Notes: Select the column that contains the start vertex of each edge.

4. Set the **Target Vertex Column** parameter
   - Element: **Target Vertex Column** (text_input) — Fields Setting tab
   - Notes: Select the column that contains the end vertex of each edge.

5. Set the **Edge Weight Column** parameter
   - Element: **Edge Weight Column** (text_input) — Fields Setting tab
   - Notes: Select the column that contains edge weights.

6. Set the **Initial Node ID** parameter
   - Element: **Initial Node ID** (text_input) — Parameters Setting tab
   - Notes: Enter the ID of the source vertex (e.g., 'a').

7. Adjust **Number of Workers** and **Worker Memory** settings if needed
   - Element: **Tuning** (tab) — Component configuration panel
   - Notes: Higher values increase parallelism but also increase communication overhead.

8. Use the **SQL Script** component to run PAI commands directly
   - Element: **SQL Script** (panel) — Pipeline canvas
   - Notes: This method allows direct execution of PAI commands without GUI configuration.

9. Run the pipeline by clicking the **Run** button
   - Element: **Run** (button) — Upper-left corner of the canvas
   - Notes: The icon appears as a play symbol.

10. View the output results after completion
    - Element: **View Data > SQL Script Output** (menu) — Component context menu
    - Notes: Results include start_node, dest_node, distance, and distance_cnt fields.

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Source Vertex Column | dropdown | Yes | — | The column in the edge table that represents the start vertex of each edge. |
| Target Vertex Column | dropdown | Yes | — | The column in the edge table that represents the end vertex of each edge. |
| Edge Weight Column | dropdown | No | — | The column in the edge table that contains the edge weight. |
| Initial Node ID | text_input | Yes | — | The source vertex from which shortest paths are calculated. |
| Number of Workers | number_input | No | — | The number of workers for parallel execution. Higher values increase parallelism but also increase framework communication overhead. |
| Worker Memory (MB) | number_input | No | — | The maximum memory each worker can use, in MB. If exceeded, an OutOfMemory error is reported. |

### Calculate Tree Depth

**Navigation**: Machine Learning Designer > Pipelines > Add Component > Tree Depth

**Prerequisites**:
- An input edge table with start and end vertex columns
- Access to Machine Learning Designer in DataWorks
- Basic understanding of graph structures

1. Add the **Tree Depth** component to the pipeline canvas
   - Element: **Tree Depth** (button) — Component library panel

2. Configure the **Fields setting** tab parameters
   - Element: **Edge Table: Start vertex column** (dropdown) — Fields setting tab
   - Notes: Select the column containing the start node of each edge.

3. Configure the **Fields setting** tab parameters
   - Element: **Edge Table: End vertex column** (dropdown) — Fields setting tab
   - Notes: Select the column containing the end node of each edge.

4. Adjust tuning parameters if needed
   - Element: **Workers** (text_input) — Tuning tab
   - Notes: Leave blank to use system default; higher values increase parallelism but also communication overhead.

5. Set memory size per worker
   - Element: **Memory size per worker** (text_input) — Tuning tab
   - Notes: Default is 4096 MB. Increase for dense subgraphs or large adjacency lists.

6. Set data split size
   - Element: **Data split size (MB)** (text_input) — Tuning tab
   - Notes: Default is 64 MB. Decrease for better load balancing on uneven graphs.

7. Run the pipeline
   - Element: **Run** (button) — Upper-left corner of the canvas
   - Notes: Click the Run button to execute the pipeline.

8. View output results
   - Element: **View Data > SQL Script Output** (menu) — Right-click context menu
   - Notes: Right-click the SQL Script component and select this option to view the output table.

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Edge Table: Start vertex column | dropdown | Yes | — | The column in the edge table that contains the start node of each edge. |
| Edge Table: End vertex column | dropdown | Yes | — | The column in the edge table that contains the end node of each edge. |
| Workers | text_input | No | — | The number of parallel workers. Higher values increase parallelism but also increase inter-worker communication overhead. |
| Memory size per worker | number_input | No | — | The maximum memory allocated to each worker, in MB. Default: 4096. If a worker exceeds this limit, an OutOfMemory error is reported. |
| Data split size (MB) | number_input | No | — | The size of each data partition, in MB. Default: 64. Decrease this value to create more, smaller partitions for better load balancing on uneven graphs. |

### Count Triangles in Graph

**Navigation**: PAI Console > Machine Learning Designer > Pipelines > Add Component > Counting Triangle

**Prerequisites**:
- A valid PAI project with access to the algo_public project
- An input edge table with start and end vertex columns
- Permissions to create and manage tables in the project

1. Add the **Counting Triangle** component to the pipeline
   - Element: **Counting Triangle** (button) — Component library panel

2. Configure parameters in the **Fields setting** tab
   - Element: **Fields setting** (tab) — Component configuration panel

3. Select the start vertex column from the edge table
   - Element: **Start Vertex** (dropdown) — Fields setting tab

4. Select the end vertex column from the edge table
   - Element: **End Vertex** (dropdown) — Fields setting tab

5. Set the **Largest Vertex Degree** threshold
   - Element: **Largest Vertex Degree** (text_input) — Parameters setting tab
   - Notes: Default value: 500

6. Adjust **Workers**, **Memory Size per Worker**, and **Data Split Size** for tuning
   - Element: **Tuning** (tab) — Component configuration panel

7. Run the pipeline by clicking the run button in the upper-left corner
   - Element: **Run** (button) — Canvas top-left corner
   - Notes: The icon is represented as an image with a play symbol

8. View the output data after pipeline completion
   - Element: **View data** (context_menu) — Component right-click menu
   - Notes: Select 'SQL Script Output' from the dropdown

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Start Vertex | dropdown | Yes | — | The start vertex column in the edge table. |
| End Vertex | dropdown | Yes | — | The end vertex column in the edge table. |
| Largest Vertex Degree | number_input | No | — | The vertex degree threshold above which sampling is applied. |
| Workers | number_input | No | — | The number of vertices for parallel job execution. Higher values increase both the degree of parallelism and framework communication overhead. |
| Memory Size per Worker (MB) | number_input | No | — | The maximum memory available to a single job. Unit: MB. If memory usage exceeds this value, an OutOfMemory error is reported. |
| Data Split Size (MB) | number_input | No | — | The data split size. Unit: MB. |

### Configure ALS Matrix Factorization Component

**Navigation**: Console > PAI > Pipeline Studio > Add Component > ALS Matrix Factorization

**Prerequisites**:
- An existing pipeline in PAI Pipeline Studio
- Input data table with user_id, item_id, and rating columns
- Data types: user_id and item_id must be BIGINT, rating must be numeric

1. Click on the **Add Component** button in the pipeline canvas
   - Element: **Add Component** (button) — top-left corner of the pipeline canvas

2. Search for and select the **Als Matrix Factorization** component from the list
   - Element: **Als Matrix Factorization** (link) — component library panel

3. Configure the **Fields Setting** parameters in the component properties panel
   - Element: **Fields Setting** (tab) — left navigation panel of the component configuration

4. Set the **user column name** to the correct column containing user IDs
   - Element: **user column name** (text_input) — Fields Setting section
   - Notes: Must be a BIGINT type column

5. Set the **item column name** to the correct column containing item IDs
   - Element: **item column name** (text_input) — Fields Setting section
   - Notes: Must be a BIGINT type column

6. Set the **rating column name** to the column containing user ratings
   - Element: **rating column name** (text_input) — Fields Setting section
   - Notes: Must be a numeric type column

7. Adjust **Parameters Setting** values such as number of factors, iterations, regularization coefficient, etc.
   - Element: **Parameters Setting** (tab) — left navigation panel of the component configuration

8. Enable or disable the implicit preference model using the check box
   - Element: **check box** (checkbox) — Parameters Setting section
   - Notes: If enabled, alpha parameter becomes active

9. Set the **alpha parameter** if using implicit preference model
   - Element: **alpha parameter** (text_input) — Parameters Setting section
   - Notes: Valid values: (0,+∞), default is 40

10. Set the **output table lifecycle** in days
    - Element: **Output table lifecycle** (text_input) — Parameters Setting section
    - Notes: Unit: days

11. Configure tuning parameters including number of workers and node memory
    - Element: **Tuning** (tab) — left navigation panel of the component configuration

12. Set the number of worker nodes between 1 and 9999
    - Element: **Number of Workers** (text_input) — Tuning section
    - Notes: Valid values: 1 to 9999

13. Set the memory size per worker node between 1024 and 65536 MB
    - Element: **Node Memory, MB** (text_input) — Tuning section
    - Notes: Valid values: 1024 to 65536, unit: MB

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| user column name | text_input | Yes | — | The name of the user ID column in the input table. Data in the column must be of the BIGINT type. |
| item column name | text_input | Yes | — | The name of the item column in the input table. Data in the column must be of the BIGINT type. |
| rating column name | text_input | Yes | — | The name of the column that contains the scores provided by users for items in the input table. Data in the column must be of the numeric type. |
| num factors | number_input | No | — | The number of factors. Valid values: (0,+∞). Default value: 10. |
| Number of iterations | number_input | No | — | The number of iterations. Valid values: (0,+∞). Default value: 10. |
| Regularization coefficient | number_input | No | — | The regularization coefficient. Valid values: (0,+∞). Default value: 0.1. |
| check box | checkbox | No | — | Specifies whether to use an implicit preference model. |
| alpha parameter | number_input | No | — | The implicit preference coefficient. Valid values: (0,+∞). Default value: 40. |
| Output table lifecycle | number_input | No | — | The lifecycle of the output model table. Unit: days. |
| Number of Workers | number_input | No | — | The number of worker nodes. Valid values: 1 to 9999. |
| Node Memory, MB | number_input | No | — | The memory size of each worker node. Valid values: 1024 to 65536. Unit: MB. |

### Predict User-Item Score

**Navigation**: Machine Learning Platform for AI > Components > ALS Prediction

**Prerequisites**:
- An ALS Matrix Factorization component has been run to generate user and item factor tables
- Input data must contain user_id and item_id columns of BIGINT type
- Access to MaxCompute or Flink computing engine

1. Select the **ALS Prediction** component from the list of available components
   - Element: **ALS Prediction** (link) — main content area

2. Connect the output of the ALS Matrix Factorization component to the **User factor table** input port
   - Element: **User factor table** (dropdown) — left input port
   - Notes: This port requires the output from the ALS Matrix Factorization component.

3. Connect the output of the ALS Matrix Factorization component to the **Item factor table** input port
   - Element: **Item factor table** (dropdown) — left input port
   - Notes: This port requires the output from the ALS Matrix Factorization component.

4. Connect the input data to be scored to the **Input data to be scored** port
   - Element: **Input data to be scored** (dropdown) — left input port
   - Notes: Must include user_id and item_id columns of BIGINT type. Can be from Read Table, Read CSV File, or Data Preprocessing components.

5. Set the **User column** parameter to the name of the user ID column in the input data
   - Element: **User column** (text_input) — Field Settings tab
   - Notes: Must be BIGINT type.

6. Set the **Item column** parameter to the name of the item ID column in the input data
   - Element: **Item column** (text_input) — Field Settings tab
   - Notes: Must be BIGINT type.

7. Set the **Prediction result column name** to define the output column for scoring results
   - Element: **Prediction result column name** (text_input) — Parameter Settings tab

8. Set the **Output table lifecycle** to determine how long the result table is retained
   - Element: **Output table lifecycle** (dropdown) — Parameter Settings tab

9. Adjust the **Number of workers** to control parallel execution capacity
   - Element: **Number of workers** (number_input) — Execution Tuning tab
   - Notes: Valid values: 1–9999.

10. Set **Memory size per worker** to allocate memory for each worker node
    - Element: **Memory size per worker** (number_input) — Execution Tuning tab
    - Notes: Valid values: 1024 MB–65536 MB.

11. Click **Run** to execute the ALS prediction workflow
    - Element: **Run** (button) — top-right corner
    - Notes: The output will be a scoring result table with user_id, item_id, and pred columns.

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| User column | text_input | Yes | — | Name of the user ID column in the input data. Must be BIGINT type. |
| Item column | text_input | Yes | — | Name of the item ID column in the input data. Must be BIGINT type. |
| Prediction result column name | text_input | No | — | Column name in the output table for storing scoring results. |
| Output table lifecycle | dropdown | No | Permanent, Temporary, Delete after job completion | Lifecycle of the output table. |
| Number of workers | number_input | No | — | Valid values: 1–9999. |
| Memory size per worker | number_input | No | — | Memory allocated per worker. Valid values: 1024 MB–65536 MB. |

### Compute Item Similarity

**Navigation**: Machine Learning Designer > Pipeline > Collaborative Filtering (etrec)

**Prerequisites**:
- Input table with user and item columns
- PAI project access (e.g., algo_public)
- SQL script execution environment

1. Select the **Collaborative Filtering (etrec)** component on the pipeline page
   - Element: **Collaborative Filtering (etrec)** (button) — Pipeline canvas

2. Set parameters in the **Fields Setting** tab
   - Element: **Fields Setting tab** (tab) — Component configuration panel

3. Set parameters in the **Parameters Setting** tab
   - Element: **Parameters Setting tab** (tab) — Component configuration panel

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| User Column | text_input | Yes | — | The name of the user column in the input table. |
| Item Column | text_input | Yes | — | The name of the item column in the input table. |
| Delimiter between items in the output table | text_input | No | — | The separator between items in the output table. |
| Delimiter between key-value in the output table | text_input | No | — | The separator between keys and values in the output table. Spaces are not supported. |
| Similarity Type | dropdown | No | WbCosine, asymcosine, Jaccard | The algorithm used to compute item similarity. |
| TopN | number_input | No | — | The maximum number of similar items to retain per item in the output table. |
| Minimum Item Value | number_input | No | — | Users with fewer interactions than this threshold are excluded from computation. |
| Maximum Item Value | number_input | No | — | Users with more interactions than this threshold are excluded from computation. |
| Smoothing Factor | number_input | No | — | Valid only when Similarity Type is asymcosine. Valid values: (0, 1). |
| Weighting Coefficient | number_input | No | — | Valid only when Similarity Type is asymcosine. The weight index applied to the asymmetric cosine formula. |

### Perform Offline Prediction

**Navigation**: Console > Machine Learning Designer > Pipeline > Configure Component

**Prerequisites**:
- A trained model from the Swing Train component
- Test dataset available in a table

1. Navigate to the pipeline page in Machine Learning Designer
   - Element: **Machine Learning Designer** (link) — top navigation panel

2. Locate and select the **Swing Recommendation** component
   - Element: **Swing Recommendation** (button) — component library

3. Configure parameters in the **Fields Setting** tab
   - Element: **Fields Setting** (tab) — left navigation panel

4. Set the item column name in the **itemCol** field
   - Element: **itemCol** (text_input) — Fields Setting tab

5. Set the initially recommended item column name in the **initRecommCol** field
   - Element: **initRecommCol** (text_input) — Fields Setting tab

6. Specify reserved columns in the **reservedCols** field
   - Element: **reservedCols** (text_input) — Fields Setting tab

7. Configure parameters in the **Parameters Setting** tab
   - Element: **Parameters Setting** (tab) — left navigation panel

8. Set the recommendation result column name in the **recommCol** field
   - Element: **recommCol** (text_input) — Parameters Setting tab

9. Set the number of top recommended items in the **k** field
   - Element: **k** (number_input) — Parameters Setting tab
   - Notes: Default value: 10

10. Set the number of threads in the **numThreads** field
    - Element: **numThreads** (number_input) — Parameters Setting tab
    - Notes: Default value: 1

11. Configure execution settings in the **Execute Tuning** tab
    - Element: **Execute Tuning** (tab) — left navigation panel

12. Set the number of worker nodes in the **Number of Workers** field
    - Element: **Number of Workers** (number_input) — Execute Tuning tab
    - Notes: Valid values: 1 to 9999

13. Set the memory per worker node in the **Memory per worker** field
    - Element: **Memory per worker** (number_input) — Execute Tuning tab
    - Notes: Unit: MB. Valid values: 1024 to 65536

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| itemCol | text_input | Yes | — | The name of the item column. |
| initRecommCol | text_input | No | — | The name of the initially recommended item column. |
| reservedCols | text_input | No | — | The names of the reserved columns of the algorithm. |
| recommCol | text_input | Yes | — | The name of the recommendation result column. |
| k | number_input | No | — | The number of top recommended items. |
| numThreads | number_input | No | — | The number of threads of the component. |
| Number of Workers | number_input | Yes | — | The number of worker nodes. Must be used with Memory per worker. |
| Memory per worker | number_input | Yes | — | The memory size of each worker node. Unit: MB. |

### Configure Swing Train Component

**Navigation**: Console > PAI > Machine Learning Designer > Create Pipeline

**Prerequisites**:
- A training dataset and test dataset prepared
- MaxCompute client installed and configured
- Two MaxCompute tables created: one for training data (userid, itemid), one for test data (itemid)

1. Upload the training dataset to Table 1 using the tunnel command
   - Element: **tunnel command** (text_input) — MaxCompute client terminal
   - Notes: Run this command from the MaxCompute client after installation.

2. Upload the test dataset to Table 2 using the tunnel command
   - Element: **tunnel command** (text_input) — MaxCompute client terminal
   - Notes: Ensure the table schema matches the dataset format.

3. Set the **Table Name** parameter of the Read Table-1 component to Table 1
   - Element: **Table Name** (text_input) — Read Table-1 component configuration panel

4. Set the **Table Name** parameter of the Read Table-2 component to Table 2
   - Element: **Table Name** (text_input) — Read Table-2 component configuration panel

5. Import the training dataset into the **Swing Train** component
   - Element: **Swing Train** (panel) — Pipeline canvas
   - Notes: This step requires dragging the component onto the canvas and connecting it to the input data source.

6. Configure the Swing Train component parameters in the **Field Setting** and **Parameter Setting** tabs
   - Element: **Field Setting** (tab) — Component configuration panel
   - Notes: Use the UI to set itemCol, userCol, and other parameters as defined in the documentation.

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| itemCol | text_input | Yes | — | The name of the item column. |
| userCol | text_input | Yes | — | The name of the user column. |
| alpha | number_input | No | — | The alpha parameter. Default value: 1.0. |
| maxItemNumber | number_input | No | — | The maximum number of users who use an item for the calculation. If exceeded, random selection is applied. |
| maxUserItems | number_input | No | — | The maximum number of items used by a user for the calculation. If exceeded, the user is excluded. |
| minUserItems | number_input | No | — | The minimum number of items used by a user for the calculation. If below, the user is excluded. |
| resultNormalize | checkbox | No | true, false | Specifies whether to normalize the results. |
| userAlpha | number_input | No | — | The alpha parameter for users. Used in user weight calculation: User weight = 1.0/(userAlpha + userClickCount)^userBeta. |
| userBeta | number_input | No | — | The beta parameter for users. Used in user weight calculation: User weight = 1.0/(userAlpha + userClickCount)^userBeta. |
| Number of Workers | number_input | Yes | — | The number of nodes. Must be a positive integer. Used with Memory per worker, unit MB. |
| Memory per worker, unit MB | number_input | Yes | — | The memory size of each node. Unit: MB. Valid values: 1024 to 65536. |

### Run Two-Sample T-Test

**Navigation**: Console > PAI > Machine Learning Designer > Pipeline > Two-sample t-test Component

**Prerequisites**:
- Input data tables must be available in the PAI environment
- Data columns must be of DOUBLE or INT type
- For partitioned tables, correct partition specifications must be provided

1. Select the **Two-Sample T-Test** component from the Machine Learning Designer palette
   - Element: **Two-Sample T-Test** (button) — left navigation panel

2. Click on the **Fields setting** tab to configure input columns
   - Element: **Fields setting** (tab) — top navigation bar

3. Select **Sample 1 Column** from the dropdown menu
   - Element: **Sample 1 Column** (dropdown) — main content area
   - Notes: Must be a column containing numeric data (DOUBLE or INT)

4. Select **Sample 2 Column** from the dropdown menu
   - Element: **Sample 2 Column** (dropdown) — main content area
   - Notes: Must be a column containing numeric data (DOUBLE or INT)

5. Choose the test type from the **T Test Type** dropdown
   - Element: **T Test Type** (dropdown) — Parameters setting tab
   - Notes: Options: Independent T Test, Paired T Test

6. Set the alternative hypothesis type
   - Element: **Alternative Hypothesis Type** (dropdown) — Parameters setting tab
   - Notes: Options: two.sided, less, greater

7. Set the confidence level
   - Element: **Confidence Level** (dropdown) — Parameters setting tab
   - Notes: Valid values: 0.8, 0.9, 0.95, 0.99, 0.995, 0.999

8. Specify whether to assume equal variances
   - Element: **Variances of Two Populations Are Equal** (checkbox) — Parameters setting tab
   - Notes: Default: false (uses Welch t-test)

9. Configure CPU cores and memory per core for computation
   - Element: **Cores** (text_input) — Parameters setting tab
   - Notes: Valid range: 1–9999 cores; memory per core: 1024–65536 MB

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Sample 1 Column | dropdown | Yes | — | The column that contains Sample 1. |
| Sample 2 Column | dropdown | Yes | — | The column that contains Sample 2. |
| T Test Type | dropdown | Yes | Independent T Test, Paired T Test | The type of t-test to run. |
| Alternative Hypothesis Type | dropdown | No | two.sided, less, greater | The direction of the alternative hypothesis. |
| Confidence Level | dropdown | No | 0.8, 0.9, 0.95, 0.99, 0.995, 0.999 | The confidence level for the result interval. |
| Hypothesized Mean | text_input | No | — | The hypothesized mean. |
| Variances of Two Populations Are Equal | checkbox | No | true, false | Whether to assume equal variances. |
| Cores | number_input | No | — | Number of CPU cores. Must be a positive integer from 1 to 9999. |
| Memory Size Per Core | number_input | No | — | Memory per core in MB. Must be a positive integer from 1024 to 65536. |

### Run One-Sample T-Test

**Navigation**: Console > PAI > Machine Learning Designer > Add Component > One Sample T Test

**Prerequisites**:
- Input data table with numeric column to test
- Access to Machine Learning Designer workspace
- PAI project with proper permissions

1. Add a **One Sample T Test** component to the pipeline
   - Element: **One Sample T Test** (button) — left navigation panel

2. Configure the **Fields setting** section
   - Element: **Fields setting** (tab) — main content area

3. Select the sample data column in the **Sample 1 Column** field
   - Element: **Sample 1 Column** (dropdown) — Fields setting section

4. Set the alternative hypothesis type in **Parameters setting**
   - Element: **Alternative Hypothesis Type** (dropdown) — Parameters setting section
   - Notes: Options: two.sided, less, greater

5. Enter the hypothesized mean value
   - Element: **Hypothesized Mean** (text_input) — Parameters setting section
   - Notes: Default is 0

6. Set the confidence level
   - Element: **Confidence Level** (dropdown) — Parameters setting section
   - Notes: Valid values: 0.8, 0.9, 0.95, 0.99, 0.995, 0.999

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Sample 1 Column | dropdown | Yes | — | The column that contains the sample data. |
| Alternative Hypothesis Type | dropdown | No | two.sided, less, greater | The direction of the alternative hypothesis. |
| Confidence Level | dropdown | No | 0.8, 0.9, 0.95, 0.99, 0.995, 0.999 | The confidence level of the test. |
| Hypothesized Mean | text_input | No | — | The population mean to test against. |
| Core number | text_input | No | — | The number of cores. Must be a positive integer. |
| Memory Size per Core | text_input | No | — | The memory size per core. Valid values: 1–65536. Unit: MB. |

### Run Batch Prediction

**Navigation**: PAI > Machine Learning Designer > Batch Prediction

**Prerequisites**:
- A Machine Learning Designer workspace
- A trained model (OfflineModel or a model trained using paired components)
- (For periodic scheduling) A DataWorks workspace with the appropriate permissions

1. Drag and drop a **prediction component** onto the canvas
   - Element: **prediction component** (button) — left-side component pane

2. Select the appropriate prediction approach based on the algorithm
   - Element: **Paired training + prediction components** (radio) — component pane
   - Notes: Available only for algorithms with dedicated components like FM

3. Use the general-purpose prediction component if no dedicated component exists
   - Element: **General-purpose prediction component** (radio) — component pane
   - Notes: Supports OfflineModel models only; does not support PMML models

4. Import an existing model using the **model-import component**
   - Element: **model-import component** (button) — component pane

5. Synchronize the model to the production environment if in standard mode
   - Element: **Model Export component** (button) — development environment
   - Notes: Required only in DataWorks standard mode. Export to OSS first.

6. Use the **Import MaxCompute Offline Model** component in the scheduled pipeline
   - Element: **Import MaxCompute Offline Model component** (button) — scheduled pipeline

7. Schedule the pipeline using DataWorks
   - Element: **Use DataWorks tasks to schedule pipelines in Machine Learning Designer** (link) — section footer
   - Notes: Follow the linked guide for detailed steps

### Group Selected Nodes

**Navigation**: Console > Machine Learning > Alink Components > Group Nodes

**Prerequisites**:
- Alink components available in Machine Learning Designer
- Nodes on canvas must be groupable

1. Click the group icon at the top of the canvas or use Shift+left-click to select multiple nodes
   - Element: **Group Selected Nodes** (button) — top of the canvas
   - Notes: The group icon appears when multiple nodes are selected. Use Shift+left-click to multi-select nodes.

2. Right-click in an empty area of the canvas and choose **Group Selected Nodes**
   - Element: **Group Selected Nodes** (menu) — context menu in empty area
   - Notes: This action creates a group node from selected components.

3. Click the resource configuration icon to set group-level resources
   - Element: **Configure Resources** (button) — within the group node
   - Notes: Settings applied here override individual node settings.

### Grant Permissions to Use ML Designer

**Navigation**: Console > Activate and Authorize > All Cloud Product Dependencies

**Prerequisites**:
- An Alibaba Cloud account (root account)
- Access to the PAI console and RAM console
- A PAI workspace

1. Log on to the **PAI console**
   - Element: **PAI console** (link) — top navigation bar

2. Click **Activate and Authorize > All Cloud Product Dependencies** in the left navigation pane
   - Element: **Activate and Authorize** (menu) — left navigation panel

3. Locate the **OSS** section under the Designer section and check the authorization status
   - Element: **OSS** (menu) — main content area

4. If OSS is not authorized, click **Authorize** and follow the on-screen instructions
   - Element: **Authorize** (button) — Actions column

5. If OSS is already authorized, click **View Authorization Information** to review details
   - Element: **View Authorization Information** (button) — Actions column

## FAQ

Q: Where do I find the GAN model architectures like StyleGAN or PGGAN in the console?
A: In the "Image generation" or "Image generation predict" component, go to the Parameters Setting tab and look for the "model type" or "image generation network" dropdown — these list DCGAN, WGAN-GP, LSGAN, GGAN, PGGAN, and StyleGAN.

Q: What happens if I leave the "oss path for model" field empty in the GAN prediction component?
A: If no upstream Read File Data or image generation component is connected to the input port, the component will fail. You must either connect an upstream component or manually specify the OSS path to the pre-trained model.

Q: Can I modify the backbone architecture (e.g., from ResNet to ViT) after creating an image classification pipeline?
A: Yes, you can edit the component configuration at any time before running the pipeline. Open the Image Classification (Torch) component, go to the Parameters Setting tab, and change the "backbone" dropdown value.

Q: Why do I need to grant OSS permissions separately for Machine Learning Designer?
A: ML Designer accesses OSS to read training data and write models. Without explicit authorization, the service account lacks permissions, causing pipeline failures. Use the "Activate and Authorize" section in the PAI console to grant these permissions.

Q: What instance types are required for GAN or video model training?
A: GPU instances are mandatory for GAN training and image/video model training. In the Tuning tab, select a GPU instance type (e.g., ecs.gn5-c8g1.2xlarge) under "Select Resource Group" or "gpu machine type".

## Pricing & Billing

### Billing Model
per_instance_hour

### Price Reference
| Tier | Input Price | Output Price |
|------|-------------|--------------|
| GPU instance | 0.8 / | — |
| DLC | — |
| Standard | 0.01 / | 0.01 / |
| standard | 0.05 / | 0.05 / |
| Standard | 0.05 / | 0.05 / |
| standard | 0.002 / | 0.002 / |
| Standard | 0.01 / | 0.01 / |
| batch_prediction | 0.001 / | 0.0015 / |

### Free Tier
- Monthly 10 hours of free compute resources (for video classification, t-tests, ALS prediction)
- Monthly 100 hours of free compute time (for ALS matrix factorization)
- Monthly 100 free calls (for graph algorithms, Swing Train, one-sample t-test)
- Monthly 1000 free requests (for collaborative filtering, batch prediction)

### Billing Notes
- GPU instances are billed per hour; minimum charge is 1 hour.
- Distributed training incurs additional multi-node resource fees.
- Tasks are billed based on actual runtime; minimum billing unit is 1 minute for some services, 1 hour for others.
- Free tier quotas reset monthly. Usage beyond free tier is billed at standard rates.