Creating an Intelligent Scenario
Function
This API is used to create an intelligent scenario in a specified workspace.
URI
POST /v2.0/{project_id}/workspaces/{workspace_id}/intelligent-scenes
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. |
| workspace_id | Yes | String | Workspace ID |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | User token. For details on how to obtain the user token, see Obtaining a User Token Through Password Authentication. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Content type. The value is application/json. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| category | Yes | String | Scenario type. The options are:
|
| datasource_id | Yes | String | Data source ID |
| scene_name | Yes | String | Scenario name, which can contain letters, digits, underscores (_), and hyphens (-) Minimum: 1 Maximum: 64 |
| specs_config | Yes | SpecsConfig object | Computing specifications |
| schedule | No | String | Scheduling information |
| job_configs | Yes | jobConfig object | Job settings |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| offline | Yes | String | Offline computing specifications |
| nearline | No | String | Real-time computing specifications |
| rank | No | String | Deep learning computing specifications |
| online_tps | No | Integer | Max. number of concurrent online services |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| nearline_recall_param | No | NearLineRecallParam object | Parameters of a nearline retrieval job (required for nearline retrieval jobs) |
| max_recommended_num | No | Integer | Max. number of candidate sets (required for retrieval jobs) Minimum: 1 Maximum: 200 |
| match_feature_pairs | No | Array of MatchFeaturePair objects | Matched feature pair (required for feature matching-based retrieval jobs) |
| striping | No | Striping object | Row-based strategy (required for feature matching-based retrieval job, itemCF retrieval job, and userCF retrieval job) |
| match_type | No | String | Matching type (required for feature matching-based retrieval jobs). The options are:
|
| matrix_factorization | No | MatrixFactorization object | Matrix decomposition parameter settings (required for the ALS-based MF jobs) |
| behavior_frequencys | No | Array of BehaviorFrequency objects | Behavior frequency information (required for historical behavior-based candidate set generation jobs) |
| file_path | No | String | File path (required for business rule - manual import retrieval jobs) |
| ucb_param | No | UcbParam object | UCB job parameter (required for UCB-based retrieval jobs) |
| behavior_gravity | No | BehaviorGravity object | Gravity decay factor (required for the comprehensive behavior popularity-based retrieval jobs) |
| category | No | Category object | Type (required for the comprehensive behavior popularity-based retrieval jobs) |
| behavior_logic | No | String | Behavior filter logic (required for historical behavior filter jobs). The options are:
|
| features_engineering | No | EtlBasicParameter object | Feature parameter (required for offline feature engineering jobs) |
| sample_param | No | SampleParam object | Sample parameter (required for offline feature engineering jobs) |
| deep_learning_parameters | No | DeepLearingParam object | General parameters of a ranking job (required by LR, DeepFM, and AutoGroup) |
| algorithm_specify_parameters | No | AlgorithmSpecifyParameters object | Specific parameter of a ranking algorithm (required for LR, DeepFM, and AutoGroup) |
| load_widetable | No | Boolean | Importing a wide table (required for offline data import jobs) |
| load_profile | No | Boolean | Importing a profile (required for offline data import jobs) |
| save_mode | No | String | Retaining a wide table (required for offline data import jobs). The options are:
|
| indicators | No | Array of Indicator objects | Statistical indicator (required for effect evaluation jobs) |
| offline_rank_job_name | No | String | Name of an offline ranking job (required for online training jobs) |
| update_interval | No | Integer | Update interval (required for online training jobs) |
| optimizer | No | Optimizer object | Optimizer (required for online training jobs) |
| flows | No | Flow object | Online process flow (required for online training jobs) |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| time_limit | No | Boolean | Time filter |
| timeFeature | No | String | Time feature |
| retainDays | No | Integer | Retention period (days) |
| recall_fileds | No | Array of RecallFiled objects | Retrieved field |
| itemCF_job_name | No | String | Name of an itemCF job |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | No | String | Field name |
| value | No | Integer | Number of used field values Minimum: 1 Maximum: 10 Default: 1 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| user_feature_name | No | String | User feature |
| item_feature_name | No | String | Item feature |
| weight | No | Double | Weight |
| match_count | No | Boolean | Measurement of the number of matched tags |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| nearest_neighborhood | Yes | Integer | Nearest neighbors |
| band | Yes | Integer | Similarity degree Minimum: 1 Maximum: 20 |
| row | Yes | Integer | Similarity distance Minimum: 1 Maximum: 10 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| implicit_vector_rank | Yes | Integer | Embedding size Minimum: 1 Maximum: 100 |
| regular_param | Yes | Double | Optimization lambda Minimum: 1.0E-8 Maximum: 1 |
| max_iterator_num | Yes | Integer | Number of iterations Minimum: 1 Maximum: 50 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| behavior_type | Yes | String | Behavior type. The options are:
|
| lower_limit | No | Integer | Min. times Minimum: 1 |
| upper_limit | No | Integer | Max. times Minimum: 1 |
| time_interval | Yes | Integer | Time range Minimum: 1 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| alpha | Yes | Double | Tradeoff parameter Minimum: 0 Maximum: 1 |
| min_used_num | Yes | Integer | Min. number of behaviors Minimum: 30 Maximum: 1000 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| weaken_factor | No | Double | Decay factor Minimum: 0.1 Maximum: 5 |
| view_type | No | String | Behavior quantity counting mode. The options are:
|
| algo_type | No | String | Algorithm type. The options are:
|
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| user_meta_list | No | Array of strings | User feature |
| item_meta_list | No | Array of strings | Item feature |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| user_features | No | Array of FeatureTransformation objects | User feature |
| item_features | No | Array of FeatureTransformation objects | Item feature |
| rank_etl_filter | No | RankETLFilter object | Filter parameter |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| attr | No | Attribute object | Feature |
| discrete_method | No | String | Discrete method. The options are:
|
| params | No | Object | Specific processing parameter |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Name |
| data_type | No | String | Data type |
| other_uses | No | Array of strings | Other usage |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| filter_type | Yes | String | Behavior deduplication mode. The options are:
|
| time_type | Yes | String | Time type. The options are: Day Week Month |
| is_monday_first | No | Boolean | Whether Monday is the first day |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| divide_type | Yes | String | Division mode of training and test sets. The options are:
|
| train_rate | No | Double | Training data ratio Minimum: 0.01 Maximum: 1 |
| test_rate | No | Double | Test data ratio Minimum: 0.01 Maximum: 1 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| initial_parameters | No | Initial object | Initialization parameter |
| optimize_parameters | No | Optimizer object | Optimization parameter |
| regular_parameters | No | Regular object | Lambda parameter |
| max_iterations | No | Integer | Max. iterations Minimum: 1 Maximum: 1000 |
| early_stop_iterations | No | Integer | Iterations at early stopping Minimum: 1 Maximum: 1000 |
| batch_size | No | Integer | Batch size Minimum: 1 |
| dataset_split_parts | No | Integer | Number of training datasets to be split Minimum: 1 Maximum: 10 |
| restart_train | No | Boolean | Retraining |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| initial_method | Yes | String | Initialization method Enumeration values:
|
| mean_value | No | Double | Mean Minimum: -1 Maximum: 1 |
| standard_deviation | No | Double | Standard deviation Minimum: 0 Maximum: 1 |
| min_value | No | Double | Min. value Minimum: -1 Maximum: 0 |
| max_value | No | Double | Max. value Minimum: 0 Maximum: 1 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| l2_regularization | No | Double | Lambda 2 Minimum: 0 Maximum: 1 |
| regular_loss_compute_mode | No | String | Regular loss calculation mode Enumeration values:
|
| embed_l2_regularization | No | Double | Lambda 2 of embedding size Minimum: 0 Maximum: 1 |
| wide_l2_regularization | No | Double | Lambda 2 of the wide part Minimum: 0 Maximum: 1 |
| structure_l2_regularization | No | Double | Lambda 2 of the structured part Minimum: 0 Maximum: 1 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| latent_vector_length | No | Integer | Embedding size (required for DeepFM) Minimum: 1 Maximum: 100 |
| architecture | No | Array of integers | Neural network structure (required for DeepFM) |
| active_function | No | String | Activation function (required for DeepFM and AutoGroup) Enumeration values:
|
| value_keep_probability | No | Double | Neuron retention probability (required for DeepFM and AutoGroup) Minimum: 0 Maximum: 1 |
| embed_size | No | Array of integers | Embedding size of each degree (required for AutoGroup) |
| mlp_architecture | No | Array of integers | Neural network structure (required for AutoGroup) |
| max_order | No | Integer | Max. interactions (required for AutoGroup) |
| hash_sizes | No | Array of integers | Hash length (required for AutoGroup) |
| hash_compensation | No | Array of numbers | Feature interaction penalty coefficient (required for AutoGroup) |
| use_wide_part | No | Boolean | Wide part required (required for AutoGroup) |
| structure_optimizer | No | Optimizer object | Optimizer parameter (required for AutoGroup) |
| merge_multi_hot | No | Boolean | Merge multi-value feature (required for AutoGroup) |
| fix_structure | No | Boolean | Fix hash structure (required for AutoGroup) |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| indicator_name | No | String | Indicator. The options are: PV UV Custom |
| indicator_params | No | IndicatorParam object | Indicator parameter (required for custom metric) |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| customize_parameter | No | CustomizeParameter object | Custom parameter |
| customize_formula | No | CustomizeFormula object | Custom formula |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| alias | Yes | String | Alias |
| behavior_type | Yes | String | Behavior type |
| threshold | No | Double | Threshold Minimum: 0 Maximum: 1 |
| deduplication | Yes | String | Deduplication |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| alias | No | String | Alias |
| formula | No | String | Formula |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| type | No | String | Optimizer type Enumeration values:
|
| learning_rate | No | Integer | Learning rate Minimum: 0 Maximum: 1 |
| initial_accumulator_value | No | Double | Initial gradient sum Minimum: 0 Maximum: 1 |
| lambda1 | No | Double | Lambda 1 Minimum: 0 Maximum: 1 |
| lambda2 | No | Double | Lambda 2 Minimum: 0 Maximum: 1 |
| epsilon | No | Double | Epsilon Minimum: 0 Maximum: 1 |
| decay_rate | No | Double | Decay factor Minimum: 0 Maximum: 1 |
| decay_steps | No | Double | Decay step Minimum: 1 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| flow_id | Yes | String | Process flow ID |
| attr_pair_rules_filter | No | Array of AttrPairRules objects | Feature pair filter |
| attr_pair_rules_reserve | No | Array of AttrPairRules objects | Feature pair to be reserved |
| deduplication_list | No | Array of Deduplication objects | Feature deduplication |
| attribute_info | No | AttributeInfo object | Comprehensive ranking information |
| bloom_filter_conf | No | BloomFilterConf object | Bloom filter settings |
| group_attr | No | String | The scatter attribute for grouping |
| pre_deal | No | Boolean | Deduplication before ranking |
| rank_setting | No | String | Ranking configuration information |
| rules | No | Rule object | Candidate set merging |
| filter_sets | No | Array of strings | Filter configuration information |
| attr_value_rules_filter | No | Array of AttrValueRules objects | Feature filter |
| attr_value_rules_reserve | No | Array of AttrValueRules objects | Feature to be reserved |
| ctr_job | No | String | Ranking job (required when click-through rate is used) |
| ratio | No | Integer | Traffic proportion Minimum: 1 Maximum: 100 |
| toppings | No | Array of strings | List of candidate sets to be pinned on top |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| attr_pairs | No | Array of AttrPair objects | Feature pair |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| party_a | No | String | Feature name of the recommended item |
| party_b | No | String | Feature name of the recommended item |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| rank_feature_pairs | No | Array of RankFeaturePair objects | Matched feature pair |
| numerical_attrs | No | Array of NumericalAttr objects | Feature weight |
| num_statistics_type | No | String | Statistics mode. The options are:
Enumeration values:
|
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| feature_name_a | No | String | Feature of the item to be recommended |
| feature_name_b | No | String | Feature of the recommended item |
| weight | No | Float | Weight Minimum: 0.01 Maximum: 1 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Feature name |
| weight | Yes | Float | Weight Minimum: 0.001 Maximum: 1 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| behaviors | No | Array of strings | Type of the behavior to be filtered |
| interval | No | Integer | Filter time Minimum: 1 Maximum: 7 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| table_name | Yes | String | Table name of a candidate set |
| rule_ratio | Yes | Integer | Rule ratio Minimum: 1 Maximum: 100 |
| priority | Yes | Integer | Priority Minimum: 1 Maximum: 10 |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| is_success | Boolean | Whether the request is successful |
| message | String | Response message (This field is not returned when the request is successful.) |
| error_code | String | Error code (This parameter is not returned when the request is successful.) |
| scene | scene object | Scenario |
| Parameter | Type | Description |
|---|---|---|
| category | String | Type |
| type | String | Scenario type |
| scene_name | String | Scenario name |
| scene_id | String | Scenario ID |
| datasource_id | String | Data source ID |
| status | String | Status |
| created_at | String | Creation time |
| update_at | String | Update time |
| workspace_id | String | Workspace ID |
| service_type | String | Service type |
Example Requests
This API is used to create a scenario.
/v2.0/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/workspaces/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/intelligent-scenes
{
"category" : "popularity",
"job_configs" : { },
"schedule" : "00 50 01 * * ?",
"specs_config" : {
"online_tps" : 5,
"offline" : "4CU",
"nearline" : "2CU",
"rank" : "8CU"
},
"description" : "",
"datasource_id" : "aa6d657026de42a2927a50400ae69a4b",
"scene_name" : "ceshi3"
} Example Responses
Status code: 200
OK
{
"scene" : {
"type" : "UI",
"service_type" : "rec",
"scene_name" : "ceshi3",
"category" : "popularity",
"scene_id" : "ae1d4f1ee659404eaefb7a3a3f1c716f",
"datasource_id" : "aa6d657026de42a2927a50400ae69a4b",
"status" : "Draft",
"created_at" : 1588857123744,
"update_at" : 0,
"schedule" : "00 50 01 * * ?",
"next_schedule_time" : 1588873800000,
"workspace_id" : "06a7c49afc00d4972ff1c0113d8c49ba",
"description" : ""
},
"is_success" : true
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
Error Codes
See Error Codes.
Last Article: Creating a Custom Scenario
Next Article: Querying the Details of a Scenario
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.