Given a specified meta-path, similarity metric(s), and aggregation method(s), compute the meta-path based similarity score between two nodes.

compare_sets(
  set1,
  set2,
  mp,
  metric = c("pc", "pathsim", "npc", "dwpc"),
  method = c("maximum"),
  node_list,
  edge_list = NULL,
  neighbor_list = NULL,
  check = TRUE,
  verbose = TRUE
)

Arguments

set1

IDs of node set #1 as a vector.

set2

IDs of node set #2 as a vector.

mp

Meta-path as a vector of node types (e.g., c("TypeA", "TypeB", "TypeC")).

metric

A vector of permissible similarity metrics (e.g., c("npc", "dwpc")), see defined metrics below:

Path Count

Specify "pc", corresponding to get_pc().

Normalized Path Count

Specify "npc", corresponding to get_npc().

Degree-Weighted Path Count

Specify "dwpc", corresponding to get_dwpc().

PathSim

Specify "pathsim", corresponding to get_pathsim().

node_list

Node list as a data.table which must contain the following columns:

Node

Node IDs (corresponding to either Origin or Destination in the edge list).

NodeType

Node types (corresponding to either OriginType or DestinationType in the edge list).

edge_list

Edge list as a data.table which must contain the following columns:

Origin

IDs of the origin nodes for each edge.

Destination

IDs of the destination nodes for each edge.

OriginType

Types of the origin node for each edge.

DestinationType

Types of the destination node for each edge.

EdgeType

Types of each edge.

neighbor_list

Neighbor reference object constructed by get_neighbor_list().

check

Should type checking be performed? Default is TRUE.

verbose

Should the intermediate calculations be printed to the console?

Value

A list with six elements:

Set1

IDs of node set #1 provided (i.e., set1).

Set2

ID of node set #2 provided (i.e., set2).

Comparisons

List of pairwise comparisons.

Details

Intermediate computations produced by get_similarity().

Similarities

Pairwise similarity scores.

SetSimilarity

Aggregate set similarity score(s).

See also

get_neighbor_list() for neighbor reference object construction, get_similarity_function() for similarity metrics, and get_aggregation_function() for aggregation methods. This function is a wrapper around get_similarity().