Normalization of Similarity Matrix

Share:

Description

This function normalizes similarity matrix.

Usage

1
normalize(sim)

Arguments

sim

Similarity matrix.

Value

Normalized similarity matrix.

Author(s)

Masaaki TAKADA

Examples

1
2
3
4
5
6
7
8
## The function is currently defined as
function (sim) 
{
    meanVec <- apply(sim, 1, mean, na.rm = TRUE)
    sdVec <- apply(sim, 1, sd, na.rm = TRUE)
    sim <- t(scale(t(sim), meanVec, sdVec))
    return(sim)
  }