Link rows by rownum¶
network
Create network links using explicit lists of target row numbers and optional weights.
This step essentially just adds metadata to the input columns to ensure Graphext knows that these columns define network links and that they belong to the same set of links (there can be multiple "layers" of links in the same dataset). But it also makes sure all links are valid. E.g. that they don't refer to rows that don't exist, that attributes match the number of target rows etc.
Usage¶
The following are the step's expected inputs and outputs and their specific types.
link_rows_by_rownum(
targets_in: number|list[number],
*attrs_in: column,
{
"param": value
}
) -> (targets_out: column, *attrs_out: column)
where the object {"param": value}
is optional in most cases and if present may contain any of the parameters described in the
corresponding section below.
Example¶
To simply link rows using a default weight of 1.0
link_rows_by_rownum(ds.targets_in, ds.weights_in) -> (ds.valid_targets, ds.valid_weights)
Inputs¶
targets_in: column:number|list[number]
A column of lists containing numeric IDs corresponding to the rows acting as the targets of links.
*attrs_in: column
Optional corresponding lists of weights and/or other attributes for those targets.
Outputs¶
targets_out: column
Column containing new targets.
*attrs_out: column
If optional inputs were provided, new weight/attribute columns between connected nodes.
Parameters¶
weight_column: string | null
Name of the column acting as the weights of the links. Must refer to one of the optional columns passed to the step. If null
, an extra
output column will be created containing a weight of 1.0 for each link defined in
the target column (unless a weight_factor
is applied, in which the weights will
have the corresponding value, see below).
weight_factor: number = 1.0
Multiply link weights by this number. If an input column with weights was identified using weight_column
, the values
in that column will be multiplied by this factor. If no weights were passed in,
the newly added weights will all have this value.