Skip to content

paskn/topicl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7fef3d0 · Jan 29, 2025

History

31 Commits
Jan 29, 2025
Jan 29, 2025
Feb 28, 2018
Jan 27, 2025
Jan 29, 2025
Jan 28, 2025
Jan 28, 2025
Jan 28, 2025
Feb 28, 2018
Jan 28, 2025
Jan 28, 2025
Jan 28, 2025
Jan 15, 2025

Repository files navigation

topicl

The goal of topicl is to provide tools for identifying stable (reproducible) topics and for their analysis.

Installation

You can install the development version of topicl from GitHub with:

# install.packages("pak")
pak::pak("paskn/topicl")

Example

See vignette for details.

This is a basic example which shows you how to solve a common problem:

library(topicl)
library(stm)
library(dplyr)

modA <- stm(poliblog5k.docs, 
            poliblog5k.voc, K=25,
            prevalence=~rating, 
            data=poliblog5k.meta,
            max.em.its=2, 
            init.type="Random",
            seed = 9934,
            verbose = F) 
           
modB <- stm(poliblog5k.docs, 
            poliblog5k.voc, K=25,
            prevalence=~rating, 
            data=poliblog5k.meta,
            max.em.its=2, 
            init.type="Random",
            seed = 9576,
            verbose = F) 
           
compare_solutions(list(modA, modB), depth=500) |> 
  arrange(desc(jaccard)) |> 
  head()
#> # A tibble: 6 × 5
#>   model_id_A topic_id_A model_id_B topic_id_B jaccard
#>   <chr>      <chr>      <chr>      <chr>        <dbl>
#> 1 mod_1      topic_4    mod_2      topic_24     0.161
#> 2 mod_1      topic_7    mod_2      topic_6      0.152
#> 3 mod_1      topic_4    mod_2      topic_3      0.144
#> 4 mod_1      topic_24   mod_2      topic_24     0.143
#> 5 mod_1      topic_3    mod_2      topic_5      0.142
#> 6 mod_1      topic_4    mod_2      topic_9      0.142

About

Find good stable topics and more in R

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages