liveBook · Manning

Feature set

As explained in Graph Algorithms for Data Science

A feature set is a collection of graph relationships retained to calculate network features for predictive modeling.

A feature set is a collection of graph relationships reserved for calculating network features in a link-prediction model. Keeping these relationships separate from training and test samples helps prevent feature leakage. section 10.6

Use the split to keep feature calculation independent from supervised evaluation:

  • Reserve the feature relationships for calculating measures such as network distance, preferential attachment, or neighborhood overlap. section 10.6
  • Use separate train and test relationships as classification samples; optionally add a validation set for hyperparameter optimization. section 10.2.2 section 10.6

Random relationship feature set

For the Twitch shared-audience network, randomly retain about 90% of matching Stream relationships as FEATURE_REL relationships. This provides a relationship set for calculating features when no time information is available. section 10.2.2

Listing 10.2 Constructing a relationship feature set
run_query("""
MATCH (s1:Stream)-[:SHARED_AUDIENCE]->(s2:Stream)
WITH s1, s2
WHERE rand() <= 0.9
MERGE (s1)-[:FEATURE_REL]->(s2);
""")

Shows a Neo4j query that constructs a relationship feature set by randomly selecting relationships and merging FEATURE_REL edges. section 10.2.2

How Graph Algorithms for Data Science covers it

How deep it goes
Defines the split and explains leakage, then demonstrates random relationship selection without detailing feature algorithms or model training.
Examples
Uses the Twitch shared-audience network and a Neo4j query that retains approximately 90% of relationships as FEATURE_REL edges.
What it assumes
Assumes a loaded Neo4j graph and basic link-prediction dataset splitting, while defining the feature, train, and test roles.
What you can do after
Apply it via Neo4j to construct a relationship subset for network-feature calculation in a link-prediction workflow.
How it connects
Connects link prediction with network features, train sets, test sets, validation sets, and feature leakage.

Also explained in

Compare how 2 books explain feature set →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Algorithms for Data Science. The section links point to the parts of the book it draws on.