The Factorization Machine (FM) algorithm is a nonlinear model that incorporates interactions among features. This algorithm is suitable for scenarios in which E-commerce, advertisements, and live video streaming are used to promote commodities.

Configure the component

The FM algorithm template provided by Machine Learning Studio includes the FM Train and FM Prediction components. You can log on to the Machine Learning Platform for AI (PAI) console and switch back to the former version. Then, on the page that appears, click Create in the FM-Embedding for Rec-System section. In the New Experiment dialog box, set the parameters to create an FM experiment.

You can configure the two components by using one of the following methods:
  • Use the PAI console
    Component Tab Parameter Description
    FM Train Fields Setting Feature column The feature columns. Data in the feature columns must be in the key-value format. Separate multiple features with commas (,).
    Label column The label column. Only the columns of the DOUBLE type are supported.
    Parameters Setting Task Type The task type. Valid values: regression and binary_classification.
    Iterations number N/A
    Regularization coefficient Three floating-point numbers separated by commas (,). The three numbers represent the regularization coefficients of the 0th order term, 1st order term, and 2nd order term.
    Learning rate The learning rate. If the training is diverged, set this parameter to a smaller value.
    Standard deviation N/A
    Dimension Three positive integers separated by commas (,). The three positive integers represent the lengths of the 0th order term, 1st order term, and 2nd order term.
    Block size The performance parameter.
    Output table lifecycle N/A
    Tuning cluster number The number of cores. This parameter must be used with the Memory size of a single node parameter. Valid values: 1 to 9999.
    Memory size of a single node The memory size of each core. This parameter must be used with the cluster number parameter. Valid values: 1024 to 64 × 1024. Unit: MB.
    FM Prediction Parameters Setting Prediction Result Column N/A
    Prediction Score Column N/A
    Prediction Detail Column N/A
    Reserved Columns The columns that you want to reserve in the output table.
    Tuning Cores The number of cores. This parameter must be used with the Memory Size per Core parameter. Valid values: 1 to 9999.
    Memory Size per Core The memory size of each core. This parameter must be used with the Cores parameter. Valid values: 1024 to 64 × 1024. Unit: MB.
  • Use commands
    Component Parameter Required Description Default value
    FM Train tensorColName Yes The name of the feature column. Data in the column must be in the key-value format. Separate multiple features with commas (,). Example: 1:1.0,3:1.0. N/A
    labelColName Yes The name of the label column. Only the columns of numeric data types are supported. If the task parameter is set to binary_classification, the value of the label must be 0 or 1. N/A
    task Yes The task type. Valid values: regression and binary_classification. regression
    numEpochs No The number of iterations. 10
    dim No Three positive integers separated by commas (,). The three positive integers represent the lengths of the 0th order term, 1st order term, and 2nd order term. 1,1,10
    learnRate No The learning rate.
    Note If the training is diverged, set the learnRate parameter to a smaller value.
    0.01
    lambda No Three floating-point numbers separated by commas (,). The three numbers represent the regularization coefficients of the 0th order term, 1st order term, and 2nd order term. 0.01,0.01,0.01
    initStdev No The standard deviation of parameter initialization. 0.05
    FM Prediction predResultColName No The name of the prediction result column. prediction_result
    predScoreColName No The name of the prediction score column. prediction_score
    predDetailColName No The name of the prediction detail column. prediction_detail
    keepColNames No The columns that you want to reserve in the output table. All columns
If you use the following data as input for the FM algorithm template, the model AUC generated by the training is about 0.97. Input data