liveBook · Manning

In-out parameter

As explained in Graph Algorithms for Data Science

An in-out factor is a node2vec parameter controlling the balance between depth-first and breadth-first random-walk exploration.

The in-out parameter controls how node2vec random walks explore a graph. Higher values bias walks toward nearby nodes, approximating breadth-first search; lower values send walks farther outward, approximating depth-first search. section 9.3.2

Breadth-first-style walks capture local structure and structural roles, while depth-first-style walks tend to produce community- or homophily-based embeddings. In Neo4j Graph Data Science, the parameter appears as inOutFactor. section 9.3.2 section 9.3.3

Choosing 0.5 for shared-audience streams

For an undirected graph of streams connected by shared audiences, setting inOutFactor to 0.5 encourages depth-first walks and embeddings that emphasize how closely streams are connected. section 9.3.3

Listing 9.7 Calculating node2vec embeddings and storing them to the database
data = run_query("""
CALL gds.beta.node2vec.write('twitch',
 {embeddingDimension:8, relationshipWeightProperty:'weight',
  inOutFactor:0.5, writeProperty:'node2vec'})
""")

This listing shows the inOutFactor setting alongside embedding dimension, relationship weights, and the output property in a node2vec write operation. section 9.3.3

How Graph Algorithms for Data Science covers it

How deep it goes
Explains high and low values through breadth-first and depth-first behavior, but defers systematic hyperparameter optimization.
Examples
Uses inOutFactor 0.5 for shared-audience stream embeddings and invites configuration experiments during classification evaluation.
What you can do after
Apply it via Neo4j Graph Data Science to favor local structural or outward community-oriented embeddings.
How it connects
Connects random walks, node2vec embeddings, breadth-first search, depth-first search, homophily, and structural roles.

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.