NETWORK Procedure

NODESIMILARITY Statement

  • NODESIMILARITY < options >;

The NODESIMILARITY statement invokes an algorithm that calculates how similar the neighborhoods of pairs of nodes are in an input graph. The node similarity problem is described in the section Node Similarity.

You can specify the following options:

ADAMICADAR=TRUE | FALSE

specifies whether to calculate Adamic-Adar node similarity. You can specify the following values:

TRUE

calculates Adamic-Adar node similarity and saves the results in the output table that is specified in the OUTSIMILARITY= option.

FALSE

does not calculate Adamic-Adar node similarity.

By default, ADAMICADAR=FALSE.

BOTTOMK=number

specifies the maximum number of lowest-ranked similarity pairs to output in the OUTSIMILARITY= table, where number can be any integer greater than or equal to 0. If more than one similarity measure is requested, you must use the ORDERBY= option to specify which similarity measure to use for ranking.

COMMONNEIGHBORS=TRUE | FALSE

specifies whether to calculate common neighbors node similarity. You can specify the following values:

TRUE

calculates common neighbors node similarity and saves the results in the output table that is specified in the OUTSIMILARITY= option.

FALSE

does not calculate common neighbors node similarity.

By default, COMMONNEIGHBORS=FALSE.

CONVERGENCETHRESHOLD=number

specifies the convergence threshold for vector similarity. If the convergence value drops below this threshold before the procedure completes the number of samples that are requested in the NSAMPLES= option, the vector embeddings training phase terminates early. By default, CONVERGENCETHRESHOLD=0.01.

COSINE=TRUE | FALSE

specifies whether to calculate cosine node similarity. You can specify the following values:

TRUE

calculates cosine node similarity and saves the results in the output table that is specified in the OUTSIMILARITY= option.

FALSE

does not calculate cosine node similarity.

By default, COSINE=FALSE.

DICE=TRUE | FALSE

specifies whether to calculate Dice node similarity. You can specify the following values:

TRUE

calculates Dice node similarity and saves the results in the output table that is specified in the OUTSIMILARITY= option.

FALSE

does not calculate Dice node similarity.

By default, DICE=FALSE.

EMBED=TRUE | FALSE

specifies whether to calculate vector embeddings. You can specify the following values:

TRUE

calculates vector embeddings and saves the results in the output table that is specified in the OUTNODES= option.

FALSE

does not calculate vector embeddings.

By default, EMBED=FALSE when VECTOR=FALSE, and EMBED=TRUE when VECTOR=TRUE.

EMBEDDINGS=(columns)

specifies the names of one or more data variables to be used as precalculated vector embeddings. The value of the variables can be numeric only. Each variable must exist in the input table that is specified in the NODES= option, and a nonmissing value must exist for each variable for each node that appears in the graph. This option is ignored unless VECTOR=TRUE or EMBED=TRUE is specified.

JACCARD=TRUE | FALSE

specifies whether to calculate Jaccard node similarity. You can specify the following values:

TRUE

calculates Jaccard node similarity and saves the results in the output table that is specified in the OUTSIMILARITY= option.

FALSE

does not calculate Jaccard node similarity.

By default, JACCARD=TRUE.

MAXSCORE=number

specifies the maximum similarity score to output in the OUTSIMILARITY= table, where number must be in the range left-bracket 0 comma 1 right-bracket. The MAXSCORE= option is supported only for the Jaccard and vector similarity measures; it does not apply to the Adamic-Adar, common neighbors, cosine, or Dice similarity measure. If you specify both JACCARD=TRUE and VECTOR=TRUE, node pairs are output if either the Jaccard or vector similarity score satisfies the maximum similarity condition. By default, MAXSCORE=1.

MINSCORE=number

specifies the minimum similarity score to output in the OUTSIMILARITY= table, where number must be in the range left-bracket 0 comma 1 right-bracket. The MINSCORE= option is supported only for the Jaccard and vector similarity measures; it does not apply to the Adamic-Adar, common neighbors, cosine, or Dice similarity measure. If you specify both JACCARD=TRUE and VECTOR=TRUE, node pairs are output if either the Jaccard or vector similarity score satisfies the minimum similarity condition. By default, MINSCORE=0.

NDIMENSIONS=number

specifies the number of dimensions for node-embedding vectors. By default, NDIMENSIONS=100.

NEGATIVESAMPLEFACTOR=number

specifies a multiplier for the number of negative training samples per positive training sample for the vector algorithm. If NSAMPLES=s, the vector algorithm uses s positive samples and number times s negative samples. By default, NEGATIVESAMPLEFACTOR=5.

NSAMPLES=number

specifies the number of training samples for the vector algorithm. By default, NSAMPLES=1000 times StartAbsoluteValue upper E EndAbsoluteValue, where StartAbsoluteValue upper E EndAbsoluteValue is the number of links in the input graph. For distributed execution, this number of training samples is processed per machine.

ORDERBY=ADAMICADAR | COMMONNEIGHBORS | COSINE | DICE | JACCARD | VECTOR

specifies the similarity measure to use for ranking the similarity pairs to output in the OUTSIMILARITY= table. This option is ignored if neither the TOPK= option nor the BOTTOMK= option is specified.

OUTCONVERGENCE=libref.data-table

specifies the output data table to contain the convergence curves for vector similarity. libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the output data table. For more information about this two-level name, see the section Using CAS Sessions and CAS Engine Librefs in Chapter 1, Introduction.

OUTSIMILARITY=libref.data-table

specifies the output data table to contain the similarity scores between pairs of nodes. libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the output data table. For more information about this two-level name, see the section Using CAS Sessions and CAS Engine Librefs in Chapter 1, Introduction.

PROXIMITYORDER=FIRST | SECOND

specifies the type of proximity to use in the vector algorithm. You can specify the following values:

FIRST

uses first-order proximity in the vector algorithm.

SECOND

uses second-order proximity in the vector algorithm.

By default, PROXIMITYORDER=SECOND.

SINK=sink-node

specifies the sink node for node similarity calculations.

SOURCE=source-node

specifies the source node for node similarity calculations.

SPARSE=TRUE | FALSE

specifies whether to output sparse similarity data. You can specify the following values:

TRUE

outputs a sparse set of node pairs in the OUTSIMILARITY= table.

FALSE

outputs a dense set of node pairs in the OUTSIMILARITY= table.

You cannot specify SPARSE=TRUE when you specify VECTOR=TRUE. By default, SPARSE=FALSE.

TOPK=number

specifies the maximum number of highest-ranked similarity pairs to output in the OUTSIMILARITY= table, where number can be any integer greater than or equal to 0. If more than one similarity measure is requested, you must use the ORDERBY= option to specify which similarity measure to use for ranking.

VECTOR=TRUE | FALSE

specifies whether to calculate vector node similarity. You can specify the following values:

TRUE

calculates vector node similarity and saves the results in the output table that is specified in the OUTSIMILARITY= option.

FALSE

does not calculate vector node similarity.

When you specify VECTOR=TRUE, you cannot specify SPARSE=TRUE. By default, VECTOR=FALSE.

Last updated: August 07, 2026