liveBook · Manning

Random split

As explained in Graph Algorithms for Data Science

A random dataset split partitions examples or graph relationships into subsets through random assignment.

A random split assigns graph relationships at random to training and test sets when relationship timestamps are unavailable. It supports link prediction and link completion, where missing links must be predicted without a time component. section 10.2.2

Use a random split for link prediction by following these practical steps:

  • Randomly select relationships for the training and test sets instead of using past and future timestamps. section 10.2.2
  • Construct network features from relationships kept separate from the supervised samples used for model training and evaluation. section 10.2.2 section 10.2
  • Optionally create a validation set when hyperparameter optimization is planned. section 10.2.2

Twitch shared-audience network

For link prediction on the Twitch shared-audience network, a Cypher query matches SHARED_AUDIENCE relationships, keeps each relationship with rand() <= 0.9, and creates a separate FEATURE_REL relationship for network-feature construction. section 10.2.2

Figure 10.7 Random approach to relationship split for the link prediction task
10-07

Use the relationship-split figure to compare random assignment with time-based assignment. section 10.2.2

How Graph Algorithms for Data Science covers it

How deep it goes
Explains random train/test assignment and feature-leakage prevention, but does not detail model training or evaluation algorithms.
Examples
Uses the Twitch shared-audience network, Neo4j, Cypher, and a rand() threshold to construct feature relationships.
What it assumes
Assumes a loaded graph dataset and a working Neo4j environment with a Jupyter notebook for database access.
What you can do after
Apply random relationship assignment and separate feature links from supervised samples for link-prediction datasets.
How it connects
Connects link prediction with time-based split, link completion, network features, feature leakage, and supervised classification.

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.