Help Center> RES> API Reference> APIs (Old Version)> Job-related APIs> Parameters for Supported Strategies

Parameters for Supported Strategies

RES supports multiple strategies. This section describes the retrieval and ranking strategies. Table 1 describes the strategy parameters.

Recommendation Based on Specific Behavior Popularity

Table 2 SpecificBehavior parameters

Parameter

Mandatory

Type

Description

data_source_config

Yes

JSON

Data source configuration. For details, see Table 3.

algorithm_config

Yes

JSON

Algorithm configuration

candidate_set_config

Yes

JSON

Candidate set configuration. For details, see Table 4.

Table 3 data_source_config parameters

Parameter

Mandatory

Type

Description

behavior_type

Yes

String

Behavior types:

  • view indicates that an item/content is exposed to users.
  • click indicates that a user clicks an item or content.
  • collect indicates that a user adds an item or content to favorites.
  • uncollect indicates that a user removes an item or content from favorites.
  • search_click indicates that a user clicks an item in the search results.
  • comment indicates that a user makes comments on an item or content.
  • share indicates that a user shares an item/content with others.
  • like indicates that a user gives an item/content a thumb-up.
  • dislike indicates that a user gives an item/content a thumb-down.
  • grade indicates that a user rates an item/content.
  • consume indicates that a user buys an item (primarily refers to commodities).
  • use indicates that a user watches videos/listens to a kind of music/reads something (primarily refers to content)...

start_time

Configure either this parameter or retain_day.

long

Start time of user behavior. This parameter coexists with end_time.

end_time

Configure either this parameter or retain_day.

long

End time of user behavior. This parameter coexists with start_time.

retain_day

Configure either this parameter or start_time.

Integer

Time span during which user behavior data can be retained. The value is an integer ranging from 1 to 10,000.

Table 4 candidate_set_config parameters

Parameter

Mandatory

Type

Description

is_recommended_by_category

Yes

Boolean

Category-based recommendation. The value can be true or false.

Recommendation Based on Comprehensive Behavior Popularity

Table 5 BehaviorsWeight parameters

Parameter

Mandatory

Type

Description

data_source_config

Yes

JSON

Data source configuration. For details, see Table 6.

algorithm_config

Yes

JSON

Algorithm configuration

candidate_set_config

Yes

JSON

Candidate set configuration. For details, see Table 8.

Table 6 data_source_config parameters

Parameter

Mandatory

Type

Description

behavior_weights

Yes

List

Behavior weight. For details, see Table 7.

start_time

Configure either this parameter or retain_day.

long

Start time of a user behavior. This parameter coexists with end_time.

end_time

Configure either this parameter or retain_day.

long

End time of a user behavior. This parameter coexists with start_time.

retain_day

Configure either this parameter or start_time.

Integer

Time span during which user behavior data can be retained. The value is an integer ranging from 1 to 10,000.

Table 7 behavior_weights parameters

Parameter

Mandatory

Type

Description

behavior_type

Yes

String

Behavior types:

  • view indicates that an item/content is exposed to users.
  • click indicates that a user clicks an item or content.
  • collect indicates that a user adds an item or content to favorites.
  • uncollect indicates that a user removes an item or content from favorites.
  • search_click indicates that a user clicks an item in the search results.
  • comment indicates that a user makes comments on an item or content.
  • share indicates that a user shares an item/content with others.
  • like indicates that a user gives an item/content a thumb-up.
  • dislike indicates that a user gives an item/content a thumb-down.
  • grade indicates that a user rates an item/content.
  • consume indicates that a user buys an item (primarily refers to commodities).
  • use indicates that a user watches videos/listens to a kind of music/reads something (primarily refers to content)...

weight

Yes

Double

Weight. Value range: (0, 1]. Only one digit is allowed after the decimal point.

Table 8 candidate_set_config parameters

Parameter

Mandatory

Type

Description

is_recommended_by_category

Yes

Boolean

Category-based recommendation. The value can be true or false.

ItemCF Recommendation

Table 9 ItemCF parameters

Parameter

Mandatory

Type

Description

data_source_config

Yes

JSON

Data source configuration. For details, see Table 10.

algorithm_config

Yes

JSON

Algorithm configuration. For details, see Table 11.

candidate_set_config

Yes

JSON

Candidate set configuration. For details, see Table 12.

Table 10 data_source_config parameters

Parameter

Mandatory

Type

Description

retain_days

Yes

Integer

Time span during which user behavior data can be retained. The value is an integer ranging from 1 to 10,000.

behavior_weights

Yes

List

Behavior weight (excluding behavior uncollect and behavior dislike). For details, see Table 7.

Table 11 algorithm_config parameters

Parameter

Mandatory

Type

Description

similar_metric

Yes

String

Similarity measurement method (Cosine)

Table 12 candidate_set_config parameters

Parameter

Mandatory

Type

Description

max_recommended_num

Yes

Integer

Maximum number of recommendations. The value is a positive integer ranging from 1 to 10,000.

UserCF Recommendation

Table 13 UserCF parameters

Parameter

Mandatory

Type

Description

data_source_config

Yes

JSON

Data source configuration. For details, see Table 14.

algorithm_config

Yes

JSON

Algorithm configuration. For details, see Table 15.

candidate_set_config

Yes

JSON

Candidate set configuration. For details, see Table 16.

Table 14 data_source_config parameters

Parameter

Mandatory

Type

Description

retain_days

Yes

Integer

Time span during which user behavior data can be retained. The value is an integer ranging from 1 to 10,000.

behavior_weights

Yes

List

Behavior weight (excluding behavior uncollect and behavior dislike). For details, see Table 7.

Table 15 algorithm_config parameters

Parameter

Mandatory

Type

Description

similar_metric

Yes

String

Similarity measurement method (Cosine)

user_nn

Yes

Integer

Set of nearest neighbors of a user. The value is a positive integer ranging from 1 to 100,000,000.

Table 16 candidate_set_config parameters

Parameter

Mandatory

Type

Description

max_recommended_num

Yes

Integer

Maximum number of recommendations. The value is a positive integer ranging from 1 to 10,000.

ALS-based MF Recommendation

Table 17 AlsCF parameters

Parameter

Mandatory

Type

Description

data_source_config

Yes

JSON

Data source configuration. For details, see Table 18.

algorithm_config

Yes

JSON

Algorithm configuration. For details, see Table 19.

candidate_set_config

Yes

JSON

Candidate set configuration

Table 18 data_source_config parameters

Parameter

Mandatory

Type

Description

retain_days

Yes

Integer

Time span during which user behavior data can be retained. The value is an integer ranging from 1 to 10,000.

behavior_weights

Yes

List

Behavior weight. For details, see Table 7.

Table 19 algorithm_config parameters

Parameter

Mandatory

Type

Description

implicit_vector_rank

Yes

Integer

Implicit vector. The value is an integer ranging from 1 to 1000.

max_iterator_num

Yes

Integer

Maximum number of iterations. The value is an integer ranging from 1 to 2000 (excluding 2000).

regular_param

Yes

Double

Regular coefficient. The value must be greater than 0 and less than or equal to 1, with a maximum of eight decimal places reserved.

Business Rule - Historical Behavior-based Recommendation

Table 20 HistoryBehaviorMemory parameters

Parameter

Mandatory

Type

Description

data_source_config

Yes

JSON

Data source configuration. For details, see Table 21.

algorithm_config

Yes

JSON

Algorithm configuration. For details, see Table 22.

candidate_set_config

Yes

JSON

Candidate set configuration

Table 21 data_source_config parameters

Parameter

Mandatory

Type

Description

retain_days

Yes

Integer

Time span during which user behavior data can be retained. The value is an integer ranging from 1 to 10,000.

Table 22 algorithm_config parameters

Parameter

Mandatory

Type

Description

history_behavior_memories

Yes

List

Historical behavior. For details, see Table 23.

Table 23 his_behavior_memos parameters

Parameter

Mandatory

Type

Description

behavior_type

Yes

String

Behavior types:

  • view indicates that an item/content is exposed to users.
  • click indicates that a user clicks an item or content.
  • collect indicates that a user adds an item or content to favorites.
  • uncollect indicates that a user removes an item or content from favorites.
  • search_click indicates that a user clicks an item in the search results.
  • comment indicates that a user makes comments on an item or content.
  • share indicates that a user shares an item/content with others.
  • like indicates that a user gives an item/content a thumb-up.
  • dislike indicates that a user gives an item/content a thumb-down.
  • grade indicates that a user rates an item/content.
  • consume indicates that a user buys an item (primarily refers to commodities).
  • use indicates that a user watches videos/listens to a kind of music/reads something (primarily refers to content)...

least_intension

Yes

Integer

Minimum strength. The value is an integer ranging from 1 to 100.

Manual Input-Based Candidate Set Generation

Table 24 ManualInput parameters

Parameter

Mandatory

Type

Description

data_source_config

Yes

JSON

Data source configuration

algorithm_config

Yes

JSON

Algorithm configuration. For details, see Table 25.

candidate_set_config

Yes

JSON

Candidate set configuration

Table 25 algorithm_config parameters

Parameter

Mandatory

Type

Description

obs_address

Yes

String

Manually entered OBS pat. The value is in the format of xx//xxx. Behind //, special characters such as .[^?*<>|\":] are not allowed, with a maximum of 256 characters supported.

Recommendation Based on Attribute Matching

Table 26 BehaviorsWeight parameters

Parameter

Mandatory

Type

Description

portrait_storage

Yes

JSON

Profile storage information. For details, see Table 27.

global_features_information_path

Yes

String

Global feature file

match_feature_pairs

Yes

List

Pair of attributes to be matched. For details, see Table 30.

recommended_number

Yes

Integer

Number of output recommendations. The value is an integer ranging from 1 to 1000.

row

Yes

Integer

Number of buckets in one group

band

Yes

Integer

Number of bucket groups

Table 27 portrait_storage parameters

Parameter

Mandatory

Type

Description

item_profile_storage

Yes

JSON

Item profile storage information. For details, see Table 28.

user_profile_storage

Yes

JSON

User profile storage information. For details, see Table 28.

Table 28 item_profile_storage and user_profile_storage parameters

Parameter

Mandatory

Type

Description

platform

Yes

String

Platform name. Currently, only CloudTable is supported.

platform_parameter

Yes

JSON

Storage platform parameter. For details, see Table 29.

Table 29 platform_parameter parameters

Parameter

Mandatory

Type

Description

cluster_id

Yes

String

Cluster ID

table_name

Yes

String

Table name. The value can contain a maximum of 64 characters.

cluster_name

No

String

Cluster name

Table 30 match_feature_pairs parameters

Parameter

Mandatory

Type

Description

user_feature_name

Yes

String

User feature

item_feature_name

Yes

String

Item feature

alias

Yes

String

Alias

weight

Yes

String

Weight value. The default value is 1.

Logistic Regression

Table 31 algorithm_parameters parameters

Parameter

Mandatory

Type

Description

fields_feature_size_path

Yes

String

File that identifies the number of features in each field. This file is generated by the ranking data processing API and is saved in the fields_feature_size directory under Result Save Path. The file is named part-00000. A complete file path is required.

max_iterations

Yes

Int

Maximum number of model training iterations The value range ranges from 1 to 1000.

early_stop_iterations

Yes

Int

Parameter that indicates when the AUC of consecutive early_stop_iterations in a test set is smaller than the current optimal AUC, the iteration stops and the training ends. The value range ranges from 1 to 1000 and cannot be greater than that of max_iterations.

initial_parameters

Yes

JSON

Initialization parameter. For details, see Table 32.

Example:

{

"initial_method":"normal","mean_value": 0, "standard_deviation":0.001

}

optimize_parameters

Yes

JSON

Optimization parameter. For details, see Table 33.

Example:

{

"type": "adam",

"epsilon": 1e-08,

"learning_rate": 0.001

}

regular_parameters

Yes

JSON

Regular parameter. For details, see Table 34.

Example:

{

"l2_regularization":0.001,

"regular_loss_compute_mode":"full"

}

algorithm_specify_parameters

Yes

JSON

-

Table 32 initial_parameters parameters

Parameter

Mandatory

Type

Description

normal

mean_value

Yes

Double

Mean value of normal. The value ranges from -1 to 1. The default value is 0.

standard_deviation

Yes

Double

Standard deviation of normal. The value ranges from 0 to 1. The default value is 0.001.

uniform

min_value

Yes

Double

Minimum value of uniform

The value must be less than that of max_value. The value is equal to or greater than -1 but less than 0. The default value is -0.001.

max_value

Yes

Double

Maximum value of uniform.

The value must be greater than that of min_value. The value ranges from 0 (0 is excluded) to 1. The default value is 0.001.

xavier

N/A

Yes

N/A

The initial weight of the neuron is initialized to a uniform (Gaussian or random) distribution with a mean value of 0 and variance of Var(wi) = 1/nin, where nin is the number of inputs of the neuron.

Table 33 optimize_parameters parameters

Parameter

Mandatory

Type

Description

grad

learning_rate

Yes

Double

Hyper-parameter that controls the step size of the optimizer in the optimization direction The value ranges from 0 (0 is excluded) to 1. The default value is 0.001.

adagrad

initial_accumulator_value

Yes

Double

Parameter that can adjust the learning step dynamically The value ranges from 0 (0 is not included) to 1. The default value is 0.1.

learning_rate

Yes

Double

Hyper-parameter that controls the step size of the optimizer in the optimization direction The value ranges from 0 (0 is excluded) to 1. The default value is 0.001.

adam

epsilon

Yes

Double

Small constant that is used to ensure the value stability The value ranges from 0 (0 is excluded) to 1. The default value is 1.00E-08.

learning_rate

Yes

Double

Hyper-parameter that controls the step size of the optimizer in the optimization direction The value ranges from 0 (0 is excluded) to 1. The default value is 0.001.

ftrl

initial_accumulator_value

Yes

Double

Parameter that can adjust the learning step dynamically The value ranges from 0 (0 is not included) to 1. The default value is 0.1.

lambda1

Yes

Double

Overlaid on the norm (x, 1) of the model and used to limit the model value to prevent overfitting. The value ranges from 0 to 1. The default value is 0.

lambda2

Yes

Double

Overlaid on the norm (x, 2) of the model and used to limit the model value to prevent overfitting. The value ranges from 0 to 1. The default value is 0.

learning_rate

Yes

Double

Hyper-parameter that controls the step size of the optimizer in the optimization direction The value ranges from 0 (0 is not included) to 1. The default value is 0.1.

Table 34 regular_parameters parameters

Parameter

Mandatory

Type

Description

l2_regularization

Yes

Double

Overlaid on the norm (x, 2) of the model and used to limit the model value to prevent overfitting. The value ranges from 0 to 1. The default value is 0.

regular_loss_compute_mode

Yes

enum

Calculation mode for regular loss. full indicates that all parameters are calculated. batch indicates that only parameters of the current batch data are calculated. The calculation speed in batch mode is faster than that in full mode. The default value is full.

Factorization Machine

Table 35 algorithm_parameters parameters

Parameter

Mandatory

Type

Description

fields_feature_size_path

Yes

String

File that identifies the number of features in each field. This file is generated by the API that processes ranking data and is saved in the fields_feature_size directory under the run_path path. The file is named part-00000. Full path of the file is required.

max_iterations

Yes

Int

Maximum number of model training iterations The value range ranges from 1 to 1000.

early_stop_iterations

Yes

Int

Parameter that indicates when the AUC of consecutive early_stop_iterations in a test set is smaller than the current optimal AUC, the iteration stops and the training ends. The value range ranges from 1 to 1000 and cannot be greater than that of max_iterations.

algorithm_specify_parameters

Yes

JSON

Algorithm parameter. For details, see Table 36.

Example:

{

"latent_vector_length":10

}

initial_parameters

Yes

JSON

Initialization parameter. For details, see Table 32.

Example:

{

"initial_method": "normal",

"mean_value": 0.0; "standard_deviation": 0.001

}

optimize_parameters

Yes

JSON

Optimization parameter. For details, see Table 33.

Example:

{

"type": "adam",

"epsilon": 1e-08,

"learning_rate": 0.001

}

regular_parameters

Yes

JSON

Regular parameter. For details, see Table 34.

Example:

{

"l2_regularization":0.001,

"regular_loss_compute_mode":"full"

}

Table 36 algorithm_specify_parameters parameters

Parameter

Mandatory

Type

Description

latent_vector_length

Yes

Int

Length of the decomposed feature vector The value ranges from 1 to 1000. The default value is 10.

Field-aware Factorization Machine

Factorization Machine describes the details about algorithm_parameters.

Deep Network Factorization Machine

Table 37 algorithm_parameters parameters

Parameter

Mandatory

Type

Description

fields_feature_size_path

Yes

String

File that identifies the number of features in each field. This file is generated by the API that processes ranking data and is saved in the fields_feature_size directory under the run_path path. The file is named part-00000. Full path of the file is required.

max_iterations

Yes

Int

Maximum number of model training iterations The value range ranges from 1 to 1000.

early_stop_iterations

Yes

Int

Parameter that indicates when the AUC of consecutive early_stop_iterations in a test set is smaller than the current optimal AUC, the iteration stops and the training ends. The value range ranges from 1 to 1000 and cannot be greater than that of max_iterations.

algorithm_specify_parameters

Yes

JSON

Algorithm parameter. For details, see Table 38.

Example:

{

"latent_vector_length":10

"architecture":[400,400,400]

"value_keep_probability":0.8

"active_function": "reul"

}

initial_parameters

Yes

JSON

Initialization parameter. For details, see Table 32.

Example:

{

"initial_method": "normal"

"mean_value": 0.0 "standard_deviation": 0.001

}

optimize_parameters

Yes

JSON

Optimization parameter. For details, see Table 33.

Example:

{

"type": "adam",

"epsilon": 1e-08,

"learning_rate": 0.001

}

regular_parameters

Yes

JSON

Regular parameter. For details, see Table 34.

Example:

{

"l2_regularization":0.001,

"regular_loss_compute_mode":"full"

}

Table 38 algorithm_specify_parameters parameters

Parameter

Mandatory

Type

Description

latent_vector_length

Yes

Int

Length of the decomposed feature vector The value ranges from 1 and 100, and the default value is 10.

architecture

Yes

List[Int]

Number of neural network layers/neuron nodes at each layer The number of neuron nodes at each layer is not greater than 5000, and the number of neural network layers is not greater than 10. Neural Network Structure is set to 400,400,400 by default.

value_keep_probability

Yes

Double

Probability that the value of a neuron is kept during neural network forwarding. The value range is greater than 0 and equal to or less than 1. The default value is 0.8.

active_function

Yes

Enum

Parameter that maps a value of a neuron or a group of neurons to an output value. The options are relu, sigmoid, and tanh. The default value is relu.

Product-network In Network

Table 39 algorithm_parameters parameters

Parameter

Mandatory

Type

Description

fields_feature_size_path

Yes

String

File that identifies the number of features in each field. This file is generated by the API that processes ranking data and is saved in the fields_feature_size directory under the run_path path. The file is named part-00000. Full path of the file is required.

max_iterations

Yes

Int

Maximum number of model training iterations The value ranges from 1 to 1000. The default value is 50.

early_stop_iterations

Yes

Int

Parameter that indicates when the AUC of consecutive early_stop_iterations in a test set is smaller than the current optimal AUC, the iteration stops and the training ends. The value range ranges from 1 to 1000 and cannot be greater than that of max_iterations. The default value is 5.

algorithm_specify_parameters

Yes

JSON

Algorithm parameter. For details, see Table 40.

Example:

{

"latent_vector_length":10,

"active_function":"relu",

"architecture":[400,400,400],

"value_keep_probability":0.8,

"sub_net_architecture":[40,5],

"is_drop_fm":"False"

}

initial_parameters

Yes

JSON

Initialization parameter. For details, see Table 32.

Example:

{

"initial_method": "xavier"

}

optimize_parameters

Yes

JSON

Optimization parameter. For details, see Table 33.

Example:

{

"type": "adam",

"epsilon": 1e-08,

"learning_rate": 0.001

}

regular_parameters

Yes

JSON

Regular parameter. For details, see Table 34.

Example:

{

"l2_regularization":0.001,

"regular_loss_compute_mode":"full"

}

Table 40 algorithm_specify_parameters parameters

Parameter

Mandatory

Type

Description

latent_vector_length

Yes

Int

Length of the decomposed feature vector The value ranges from 1 and 100, and the default value is 10.

architecture

Yes

List[Int]

Number of neural network layers/neuron nodes at each layer The number of neuron nodes at each layer ranges from 1 to 1000, and the number of neural network layers is not greater than 5. Neural Network Structure is set to 400,400,400 by default.

value_keep_probability

Yes

Double

Probability that the value of a neuron is kept during neural network forwarding. The value range is greater than 0 and equal to or less than 1. The default value is 0.8.

active_function

Yes

Enum

Parameter that maps a value of a neuron or a group of neurons to an output value The options are relu, sigmoid, and tanh. The default value is relu.

sub_net_architecture

Yes

List[Int]

Architecture of a neural network whose kernels are used to calculate the relationships between feature vectors The number of nodes at each layer ranges from 1 to 100, and the number of layers is not greater than 5. 40 and 5 are set by default.

is_drop_fm

Yes

Boolean

Whether to remove the factorization machine from the model architecture. If the value is True, the component is transformed into a DNN with a kernel function. The options are true and false. The default value is false.