Skip to main content
Takes a dataset containing multiple pairs of link columns (targets + weights) and combines them into a single pair. This is useful when you have links from different sources (e.g., embedding similarity links and explicit foreign key links) and want to visualize or analyze them as a single graph. Each link pair can optionally be scaled by a weight multiplier, allowing you to control the relative importance of different link sources.

Usage

The following examples show how the step can be used in a recipe.

Examples

Merge embedding links with FK links, giving FK links 5x weight
merge_links(ds[["semantic_targets", "semantic_weights", "fk_targets", "fk_weights"]], {
  "link_pairs": [["semantic_targets", "semantic_weights"], ["fk_targets", "fk_weights"]],
  "weight_multipliers": [1.0, 5.0]
}) -> (ds.targets, ds.weights)

Inputs & Outputs

The following are the inputs expected by the step and the outputs it produces. These are generally columns (ds.first_name), datasets (ds or ds[["first_name", "last_name"]]) or models (referenced by name e.g. "churn-clf").
ds
dataset
required
A dataset containing the link column pairs to merge.
targets
column
required
Merged list of linked row numbers.
weights
column
required
Merged list of weights for corresponding targets.

Configuration

The following parameters can be used to configure the behaviour of the step by including them in a json object as the last “input” to the step, i.e. step(..., {"param": "value", ...}) -> (output).

Parameters

Pairs of [target_column, weight_column] names to merge. Each entry is a two-element array with the names of the target and weight columns forming a link pair. E.g., [[“targets_a”, “weights_a”], [“targets_b”, “weights_b”]].
Item
array[string]
Each item in array.
Item
string
Each item in array.
weight_multipliers
array[number]
Weight multiplier for each link pair. Optional list of multipliers (one per link pair). Each link pair’s weights will be multiplied by the corresponding value. Defaults to 1.0 for all pairs.
Item
number
Each item in array.Values must be in the following range:
0Item < inf