lp_matrix: Link prediction with pairwise node (dis-)similarities

Description Usage Arguments Value Author(s) Examples

View source: R/link_predictors.R

Description

Given a network of interest and a matrix of pairwise node (dis-)similarities produced by some algorithm, it computes the likelihood score of interaction, for all disconnected node pairs, based on such (dis-)similarities.

Usage

1
lp_matrix(g, m, type = "sim")

Arguments

g

igraph; The network of interest.

m

matrix; A square matrix of pairwise node (dis-)similarities.

type

character; One of "sim" or "dis", which indicate whether the matrix stores similarities (high values -> higher likelihood of interaction) or dissimilarities (low values -> higher likelihood of interaction).

Value

Tibble with the following columns:

nodeA

The ID of a network node.

nodeB

The ID of a network node.

scr

The likelihood score of interaction for the node pair.

Author(s)

Gregorio Alanis-Lobato galanisl@uni-mainz.de

Examples

1
2
3
4
5
6
# Compute a node similarity matrix with one of the algorithms included in 
# igraph
dice <- igraph::similarity(karate_club, method = "dice")

# Now compute likelihood scores for disconnected node pairs with this matrix
sim <- lp_matrix(g = karate_club, dice, type = "sim")

galanisl/LinkPrediction documentation built on May 17, 2019, 12:10 p.m.