This topic describes the DeepFM algorithm.
Overview
- You can enter the following types of feature:
- Categorical feature: a string type, such as gender (male or female) and commodity category (such as clothing, toys, or electronics).
- Numerical feature: integer or floating-point data type, such as user activity or commodity prices.
- Floating-point numbers between 0 and 1 are often returned, indicating the probability that the value is 1. They can be used for sorting or binary classification.
Scenarios
DeepFM is usually used in classification and sorting scenarios. It works better on scenes where features are manually built but do not directly reflect results. In recommendation scenarios, low-order feature combinations or high-order feature combinations affect final behaviors of users. However, you may not be able to identify feature combinations. DeepFM can automatically learn these combinations.
For example, in personalized commodity recommendation scenarios, click estimation models are usually required. Historical user behaviors such as clicks, unclicks, purchases can be used as training data to predict the probability of user clicks or purchases. If users have many historical behaviors and cannot directly reflect clicks or purchases in future, DeepFM can combine user behaviors and converts sparse features into high-dimentional dense features.
Parameters
The parameters in the following table are the values of the model_parameter
parameters in the CREATE MODEL
statement for creating a model. You can select the values based on your needs.
Parameter | Description |
---|---|
metrics | The metrics used to evaluate the model. Default value: accuracy. Valid values:
|
loss | The learning task and its learning objectives. Default value: binary_crossentropy. Valid values:
|
optimizer | The optimizer. Default value: adam. Valid values:
|
validation_split | The ratio of cross-validation data. Default value: 0.2. |
epochs | The number of iterations. Default value: 6. |
batch_size | The length of the batch. A short batch is prone to overfitting. Default value: 64. |
task | The type of the task. Default value: binary. Valid values:
|
Examples
/*polar4ai*/
CREATE MODEL airline_deepfm WITH
(model_class = 'deepfm',
x_cols = 'Airline,Flight,AirportFrom,AirportTo,DayOfWeek,Time,Length',
y_cols='Delay',model_parameter=(epochs=6))
AS (select * from db4ai.airlines)
/*polar4ai*/
select Airline FROM PREDICT(MODEL airline_deepfm,
select * from db4ai.airlines limit 20) WITH
(x_cols = 'Airline,Flight,AirportFrom,AirportTo,DayOfWeek,Time,Length',
y_cols='Delay')