Skip to content

Commit

Permalink
help js
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasRieger committed May 15, 2020
1 parent 3f7eab4 commit 347734b
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 32 deletions.
9 changes: 6 additions & 3 deletions R/cosineTopics.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
#' Cosine Similarity.
#'
#' @details
#' The Cosine Similarity for two topics \eqn{\bm z_{i}} and \eqn{\bm z_{j}} is calculated by
#' \deqn{ \cos(\theta,\bm z_{i}, \bm z_{j}) = \frac{ \sum_{v=1}^{V}{n_{i}^{(v)} \cdot n_{j}^{(v)}} }{ \sqrt{\sum_{v=1}^{V}{\left(n_{i}^{(v)}\right)^2}} \cdot \sqrt{\sum_{v=1}^{V}{\left(n_{j}^{(v)}\right)^2}} }}
#' with \eqn{V} is the vocabulary size, and \eqn{n_k^{(v)}} is the count of
#' The Cosine Similarity for two topics \eqn{\bm z_{i}} and \eqn{\bm z_{j}}
#' is calculated by
#' \deqn{ \cos(\theta | \bm z_{i}, \bm z_{j}) = \frac{ \sum_{v=1}^{V}{n_{i}^{(v)} \cdot n_{j}^{(v)}} }{ \sqrt{\sum_{v=1}^{V}{\left(n_{i}^{(v)}\right)^2}} \cdot \sqrt{\sum_{v=1}^{V}{\left(n_{j}^{(v)}\right)^2}} }}
#' with \eqn{\theta} determining the angle between the corresponding
#' count vectors \eqn{\bm z_{i}} and \eqn{\bm z_{j}},
#' \eqn{V} is the vocabulary size and \eqn{n_k^{(v)}} is the count of
#' assignments of the \eqn{v}-th word to the \eqn{k}-th topic.
#'
#' @family TopicSimilarity functions
Expand Down
5 changes: 3 additions & 2 deletions R/jaccardTopics.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
#' Jaccard Coefficient.
#'
#' @details
#' The modified Jaccard Coefficient for two topics \eqn{\bm z_{i}} and \eqn{\bm z_{j}} is calculated by
#' The modified Jaccard Coefficient for two topics \eqn{\bm z_{i}} and
#' \eqn{\bm z_{j}} is calculated by
#' \deqn{J_m(\bm z_{i}, \bm z_{j} \mid \bm c) = \frac{\sum_{v = 1}^{V} 1_{\left\{n_{i}^{(v)} > c_i ~\wedge~ n_{j}^{(v)} > c_j\right\}}\left(n_{i}^{(v)}, n_{j}^{(v)}\right)}{\sum_{v = 1}^{V} 1_{\left\{n_{i}^{(v)} > c_i ~\vee~ n_{j}^{(v)} > c_j\right\}}\left(n_{i}^{(v)}, n_{j}^{(v)}\right)}}
#' with \eqn{V} is the vocabulary size, and \eqn{n_k^{(v)}} is the count of
#' with \eqn{V} is the vocabulary size and \eqn{n_k^{(v)}} is the count of
#' assignments of the \eqn{v}-th word to the \eqn{k}-th topic. The threshold vector \eqn{\bm c}
#' is determined by the maximum threshold of the user given lower bounds \code{limit.rel}
#' and \code{limit.abs}. In addition, at least \code{atLeast} words per topic are
Expand Down
16 changes: 5 additions & 11 deletions R/jsTopics.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,12 @@
#' Jensen-Shannon Divergence.
#'
#' @details
#' The Jensen-Shannon Similarity for two topics \eqn{\bm z_{i}} and \eqn{\bm z_{j}} ...
#' The Jensen-Shannon Similarity for two topics \eqn{\bm z_{i}} and
#' \eqn{\bm z_{j}} is calculated by
#' \deqn{\text{JS}(\bm z_{i}, \bm z_{j}) = 1 - \left( \text{KLD}(p_i, (p_i+p_j)/2) + \text{KLD}((p_j, (p_i+p_j)/2)) \right)/2 }
#'
#' \eqn{J_m} is calculated by
#' \deqn{J_m(\bm z_{i}, \bm z_{j} \mid \bm c) = \frac{\sum_{v = 1}^{V} 1_{\left\{n_{i}^{(v)} > c_i ~\wedge~ n_{j}^{(v)} > c_j\right\}}\left(n_{i}^{(v)}, n_{j}^{(v)}\right)}{\sum_{v = 1}^{V} 1_{\left\{n_{i}^{(v)} > c_i ~\vee~ n_{j}^{(v)} > c_j\right\}}\left(n_{i}^{(v)}, n_{j}^{(v)}\right)}}
#' with \eqn{V} is the vocabulary size, and \eqn{n_k^{(v)}} is the count of
#' assignments of the \eqn{v}-th word to the \eqn{k}-th topic. The threshold vector \eqn{\bm c}
#' is determined by the maximum threshold of the user given lower bounds \code{limit.rel}
#' and \code{limit.abs}. In addition, at least \code{atLeast} words per topic are
#' considered for calculation. According to this, if there are less than
#' \code{atLeast} words considered as relevant after applying \code{limit.rel}
#' and \code{limit.abs} the \code{atLeast} most common words per topic are taken
#' to determine topic similarities.
#' with \eqn{V} is the vocabulary size and \eqn{n_k^{(v)}} is the count of
#' assignments of the \eqn{v}-th word to the \eqn{k}-th topic.
#'
#' @family TopicSimilarity functions
#'
Expand Down
9 changes: 6 additions & 3 deletions man/cosineTopics.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/jaccardTopics.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 5 additions & 11 deletions man/jsTopics.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 347734b

Please sign in to comment.