Learn R Programming

svs (version 1.0.2)

weighting_functions: Weighting Functions

Description

Local and global weighting functions.

Usage

lw_tf(x)

lw_raw(x)

lw_log(x)

lw_bin(x)

gw_idf(x)

gw_idf_alt(x)

gw_gfidf(x)

gw_nor(x)

gw_ent(x)

gw_bin(x)

gw_raw(x)

Arguments

x
A numeric matrix.

Value

  • A numeric matrix.

itemize

  • gw_idf

emph

  • f(x) = log( ncol(x) / n + 1)
  • n =
  • f(x) = log( ncol(x) / n) + 1
  • n =
  • f(x) = rowSums(x) / n
  • n =
  • f(x) = x / sum(x)
  • f(x) = 1 +
  • f(x) = 1
  • f(x) = 1

item

  • gw_idf_alt
  • gw_gfidf
  • gw_nor
  • gw_ent
  • gw_bin
  • gw_raw

Details

There are many local and global weighting functions. In this package, local weighting functions are prefixed with lw_ and global weighting functions with gw_, so users can define their own weighting functions. Local weighting functions (i.e. weighting every cell in the matrix):
  • lw_tf
{Term frequency: f(x) = x.} lw_raw{Raw frequency, which is the same as the term frequency: f(x) = x.} lw_log{Logarithm: f(x) = log(x + 1).} lw_bin{Binary: f(x) = 1 if x > 0 and 0 otherwise.}

See Also

fast_lsa.