Network Analysis
Treats offers as nodes in a directed graph. Edges encode how often one offer is accepted when another is co-presented. Personalized PageRank (or a related centrality pass) produces scores that highlight hub offers and structures implied by co-occurrence and acceptance.
Algorithm
Config value: "approach": "Network" (no behaviorAlgos sub-approach)
Edge weight from offer \(i\) to offer \(j\):
\(w(i \rightarrow j) = \frac{\text{accepted\_count}_j}{\text{total\_count}_j}\)
(Intuition: mass flows toward \(j\) in proportion to how often \(j\) is accepted relative to presentations involving the co-occurrence context.)
PageRank-style update (schematic):
\(\mathrm{PR}(u) = (1 - \alpha) \cdot \mathrm{personalization}(u) + \alpha \cdot \sum_{v} \mathrm{PR}(v) \cdot \frac{w(v \rightarrow u)}{\sum_{k} w(v \rightarrow k)}\)
- \(\alpha\): damping / teleport mixing (implementation default may use \(\alpha = 1.0\) for a specific variant—verify against your runtime version).
- iterations: Often set to \(N\) = number of offers for convergence passes over the graph.
Parameters
- alpha (\(\alpha\)): Damping factor between random jumps and graph propagation. Default:
1.0(check runtime notes for your build). - iterations: Number of propagation iterations; default ties to offer count (\(N\)).
- Processing Window: Time window in milliseconds for historical data used to build the graph.
- Historical Count: Max records to process per update cycle.
Cold Start
Recommendations are always returned. The real-time training path always produces a scored options array:
- No history: Every offer in the options store receives a uniform random score. All offers are ranked and passed to the post-score class.
- Sparse co-occurrence data: The algorithm may not produce meaningful graph-based rankings. Unscored offers receive a random fallback score.
- Sufficient co-occurrence data: PageRank scores drive the ranking, highlighting hub offers and structural relationships in the acceptance network.
The scored options are then sorted by arm_reward and handed to the configured dynamic post-score class, which controls the final offer selection and response formatting.
The runtime always returns recommendations. During cold start, offers are ranked randomly. Network Analysis begins producing meaningful graph-based rankings once sufficient co-occurrence and acceptance data is available. The post-score class determines the final presentation.
When To Use
- Offer relationships matter: bundles, complements, sequences, or co-presented sets
- Identifying hub or structurally central offers in an acceptance network
When NOT To Use
- Offers are independent (no meaningful co-presentation signal)
- You need fast exploration of brand-new items without a graph (prefer bandit methods)
Example
from prediction.apis import deployment_management as dm
from prediction.apis import online_learning_management as ol
from prediction import jwt_access
auth = jwt_access.Authenticate("http://localhost:3001/api", ecosystem_username, ecosystem_password)
deployment_id = "demo-network-analysis"
online_learning_uuid = ol.create_online_learning(
auth,
algorithm="ecosystem_rewards",
name=deployment_id,
description="Network Analysis (PageRank) configuration",
feature_store_collection="set_up_features",
feature_store_database="my_mongo_database",
options_store_database="my_mongo_database",
options_store_collection="demo-deployment_options",
randomisation_processing_count=5000,
randomisation_processing_window=604800000,
contextual_variables_offer_key="offer",
create_options_index=True,
create_covering_index=True
)
online_learning = dm.define_deployment_multi_armed_bandit(epsilon=0, dynamic_interaction_uuid=online_learning_uuid)
parameter_access = dm.define_deployment_parameter_access(
auth,
lookup_key="customer_id",
lookup_type="string",
database="my_mongo_database",
table_collection="customer_feature_store",
datasource="mongodb"
)
deployment_step = dm.create_deployment(
auth,
project_id="demo-project",
deployment_id=deployment_id,
description="Network Analysis demo deployment",
version="001",
plugin_post_score_class="PlatformDynamicEngagement.java",
plugin_pre_score_class="PreScoreDynamic.java",
scoring_engine_path_dev="http://localhost:8091",
mongo_connect=f"mongodb://{mongo_user}:{mongo_password}@localhost:54445/?authSource=admin",
parameter_access=parameter_access,
multi_armed_bandit=online_learning
)Set approach to Network in the randomisation object. This algorithm does not use behaviorAlgos or sub_approach. Populate the graph from logged co-presentations before going live.