Help Center/ Graph Engine Service/ User Guide/ Algorithms/ Real-time Recommendation
Updated on 2024-03-28 GMT+08:00

Real-time Recommendation

Overview

The Real-time Recommendation algorithm is based on the random walk model and is used to recommend nodes that are similar (have similar relationships or preferences) to the input node.

Application Scenarios

This algorithm can be used to recommend similar products based on historical purchasing or browsing data or recommend potential friends with similar preferences.

It is applicable to scenarios such as e-commerce and social networking.

Parameter Description

Table 1 Real-time Recommendation algorithm parameters

Parameter

Mandatory

Description

Type

Value Range

Default Value

sources

Yes

Node ID. Multiple node IDs separated by commas (,) are supported (standard CSV input format).

String

The number of source nodes cannot exceed 30.

-

alpha

No

Weight coefficient. A larger value indicates a longer step.

Double

A real number between 0 and 1 (excluding 0 and 1)

0.85

N

No

Total number of walk steps

Int

1–200,000

10,000

nv

No

Parameter indicating that the walk process ends ahead of schedule: minimum number of access times of a potential recommended node

NOTE:

If a node is accessed during random walk and the number of access times reaches nv, the node will be recorded as the potential recommended node.

Int

1-10

5

np

No

Parameter indicating that the walk process ends ahead of schedule: number of potential recommended nodes

NOTE:

If the number of potential recommended nodes of a source node reaches np, the random walk for the source node ends ahead of schedule.

Int

1–2000

1000

label

No

Expected type of the vertex to be output.

NOTE:
  • Expected type of the vertex to be output. If the value is null, the original calculation result of the algorithm is output without considering the vertex type.
  • If the value is not null, vertices with the label are filtered from the calculation result.

String

Node label

-

directed

No

Whether to consider the edge direction

Bool

true or false

true

alpha determines the jump probability coefficient, also called damping coefficient, which is a computing control variable in the algorithm.

Precautions

In the end conditions, the smaller the values of nv and np, the faster the algorithm ends.

Example

Set parameters sources to Lee, alpha to 0.85, N to 10,000, nv to 5, np to 1,000, directed to true, and label to null.

The sub-graph formed by top nodes in the calculation result is displayed on the canvas. The size of a node varies with the final scores. The JSON result is displayed in the query result area.