salton - bavla/biblio GitHub Wiki

Salton cosine index

https://en.wikipedia.org/wiki/Cosine_similarity

https://link.springer.com/article/10.1007/s11192-012-0940-1

From the matching matrix/network Co:

S[u,v] = Co[u,v]/sqrt(Co[u,u]*Co[v,v])

Standard Salton cosine index

If all diagonal entries of the matching matrix/network Co are positive the Salton matrix can be computed as follows:

D = diag(1/sqrt(Co[v,v]))

S = D * Co * D

n is the number of nodes in the network Co.

select/read projection network Co
Network/Create Vector/Get loops = V1
Vector/Transform/Absolute+Sqrt = V2
Vector/Transform/Invert = V3; D = diag(V3)
select V1
File/Vector/Dispose
select V2
File/Vector/Dispose
Operations/Network+Vector/Vector#Network/Output = D * Co
Operations/Network+Vector/Vector#Network/Input = (D * Co) * D 
File/Network/Change label [Salton]
select V3
File/Vector/Dispose
select D * Co
File/Network/Dispose

Salton cosine index from co-appearance matrix with isolates

In a network with isolates (works without an author in WA network) the corresponding rows and columns in the matrix Co are null. To avoid the division by zero we define

D = diag(1/max(1,sqrt(Co[v,v])))

S = D * Co * D

select/read projection network Co
Network/Create Vector/Get loops = V1
Vector/Create Constant Vector [n,1] = V2
select V1 as Second vector
Vectors/Max(First,Second)
Vector/Transform/Absolute+Sqrt
Vector/Transform/Invert = V3; D = diag(V3)
Operations/Network+Vector/Vector#Network/Output = D * Co
Operations/Network+Vector/Vector#Network/Input = (D * Co) * D