Learn R Programming

smdc (version 0.0.2)

simSyn: Synthesis of Document Similarity

Description

This function synthesize the similarity.

Usage

simSyn(sims, weight)

Arguments

sims
List of similarity matrix.
weight
Weight vector of similarity matrix.

Value

Weighted sum of similarity matrix

Examples

Run this code

## The function is currently defined as
function (sims, weight) 
{
    len = length(sims)
    if (len != length(weight)) {
        stop(message = "different lengths between sims and weight")
    }
    sim <- weight[1] * sims[[1]]
    for (i in 2:len) {
        sim <- sim + weight[i] * sims[[i]]
    }
    return(sim)
  }

Run the code above in your browser using DataLab