# Extract node pagerank¶

networkgraphcentrality

Calculate network node pagerank.

Calculates the PageRank centrality for each node in the network. PageRank is a measure of the importance of a node in a network. It is based on the idea that a node is important if it is linked to by other important nodes. The algorithm is iterative and the importance of a node is calculated as the sum of the importance of the nodes that link to it. The importance of a node is then distributed to the nodes it links to. The algorithm is run until convergence. A damping factor is used to avoid the problem of dead ends.

For more information about the algorithm and its parameters see the wikipedia entry or the original paper here.

## Usage¶

The following are the step's expected inputs and outputs and their specific types.

Step signature
``````extract_node_pagerank(
targets: list[number],
*weights: list[number],
{
"param": value
}
) -> (pagerank: number)
``````

where the object `{"param": value}` is optional in most cases and if present may contain any of the parameters described in the corresponding section below.

#### Example¶

Example call (in recipe editor)
``````extract_node_pagerank(ds.targets, ds.weights) -> (ds.page_rank)
``````

## Inputs¶

targets: column:list[number]

A column containing link targets. Source is implied in the index.

*weights: column:list[number]

An optional column containing link weights.

## Outputs¶

pagerank: column:number

Calculates the Google PageRank for the specified vertices.

## Parameters¶

directed: boolean = False

Whether the links are directed or not.

damping: number

The damping factor. `1 - damping` is the PageRank value for nodes with no incoming links. It is also the probability of resetting the random walk to a uniform distribution in each step.

Range: `0 ≤ damping ≤ 1`