Package: transitiontrees 0.1.2

Mohammed Saqr

transitiontrees: Pathway Trees and Predictive Pathway Discovery in Sequence Data

Discovers, ranks, and interprets predictive pathways in categorical sequence data. Fits a variable-depth pathway tree (prediction suffix tree; Ron, Singer and Tishby (1996) <doi:10.1023/A:1026490906255>) and exposes a pathway-centric application programming interface: most common pathways, most predictively divergent pathways, sharpest pathways, modal-flip diagnostics, and next-state predictions. Multiple pruning criteria (likelihood-ratio G-squared, Kullback-Leibler divergence, and the Akaike and Bayesian information criteria), smoothing for unseen contexts, and sequence sampling are supported. The fit and predictive surface are validated to machine precision against an independent external reference implementation of the model.

Authors:Mohammed Saqr [aut, cre, cph]

transitiontrees_0.1.2.tar.gz
transitiontrees_0.1.2.zip(r-4.7-any)transitiontrees_0.1.2.zip(r-4.6-any)transitiontrees_0.1.2.zip(r-4.5-any)
transitiontrees_0.1.2.tgz(r-4.6-any)transitiontrees_0.1.2.tgz(r-4.5-any)
transitiontrees_0.1.2.tar.gz(r-4.7-any)transitiontrees_0.1.2.tar.gz(r-4.6-any)
transitiontrees_0.1.2.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
transitiontrees/json (API)

# Install 'transitiontrees' in R:
install.packages('transitiontrees', repos = c('https://mohsaqr.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/mohsaqr/transitiontrees/issues

Datasets:

On CRAN:

Conda:

5.10 score 304 downloads 36 exports 17 dependencies

Last updated from:83add7aae8. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK181
source / vignettesOK406
linux-releaseOK169
macos-releaseOK145
macos-oldrelOK159
windows-develOK154
windows-releaseOK155
windows-oldrelOK176
wasm-releaseOK113

Exports:bootstrap_pathwayscommon_pathwayscompare_groupscompare_pruningcompare_smoothingcompare_treescontext_treedivergent_pathwaysgenerate_sequencesimpute_sequencesmine_contextsmine_sequencesmodel_fitn_nodespathway_existsperplexityplot_differenceplot_distributionsplot_divergenceplot_pathway_resamplesplot_pathwaysplot_predictiveplot_pruningplot_trajectoriesprepare_inputprune_treequery_pathwayscore_positionsscore_sequencessharp_pathwayssmooth_treesubtreetree_dependencetree_distancetree_pathwaystune_tree

Dependencies:clicpp11farverggplot2gluegtableisobandlabelinglifecycleR6RColorBrewerrlangS7scalesvctrsviridisLitewithr

Getting started: basic analysis and trajectory trees
1. Fit | 2. Inspect the fit | 3. The pathway tables | 4. Prune to the reliable tree | 5. Predict | 6. A first tree plot | 7. Trajectory trees: where sequences go, and how predictably | By frequency -- how many sequences walk each path | By predictability -- how confidently the model calls each step | Where to go next

Last update: 2026-06-09
Started: 2026-06-08

Ecosystem compatibility: TraMineR, tna, and Nestimate
The shared dataset | Route A -- a state-sequence (stslist) object | Route B -- a tna transition-network object | Route C -- a Nestimate network object | They agree | The boundary: sequences, never aggregated transitions | Group objects

Last update: 2026-06-09
Started: 2026-06-08

A complete analysis case: collaborative-regulation sequences
1. The data | 2. Fit | 3. Inspect | 4. The pathway tables | 5. Per-context diagnostics | 6. Prune to the reliable tree | 7. Held-out predictive quality | 8. Bootstrap reliability | 9. Do high and low achievers regulate differently? | Synthesis

Last update: 2026-06-08
Started: 2026-06-08

Advanced analysis: smoothing, tuning, comparison, and mining
Setup | 1. Smoothing schemes | 2. Pruning criteria | 3. Cross-validated tuning | 4. Bootstrap pathway reliability | 5. Comparing two cohorts | 6. Tree introspection | 7. Mining contexts and sequences | 8. Imputing gaps | 9. Generating sequences

Last update: 2026-06-08
Started: 2026-06-08

Visualization: every plot, and how to read it
Setup | 1. The fitted tree, four ways | Horizontal phylogram (default) | Radial dendrogram | Icicle / sunburst (needs ggraph + tidygraph) | Interactive collapsible tree (needs visNetwork) | 2. Pathway-centric plots | Next-state heatmap | Divergence lollipop | Per-context distributions | 3. Diagnostic plots | How much memory does one pathway need? | Predictive quality | 4. Forward trajectory trees (needs ggforce) | 5. Inferential plots | Bootstrap forest plot | Per-pathway resample distributions | Cohort comparison: permutation null | Tuning surface | Group difference map | Recap

Last update: 2026-06-08
Started: 2026-06-08

Readme and manuals

Help Manual

Help pageTopics
AI-collaboration messages (long format)ai_long
Coerce a context tree to a Tidy Data Frameas.data.frame.transitiontrees
Coerce a context tree Bootstrap to a Tidy Data Frameas.data.frame.transitiontrees_bootstrap
Coerce a context tree Comparison to a Tidy Data Frameas.data.frame.transitiontrees_comparison
Coerce a Group of Trees to One Tidy Data Frameas.data.frame.transitiontrees_group
Coerce a Group Comparison to a Tidy Data Frameas.data.frame.transitiontrees_group_comparison
Bootstrap Pathway Stability and Informativenessbootstrap_pathways
Most Common Pathways in a Fitted Treecommon_pathways
Compare Groups of Sequences for Structural Differencescompare_groups
Compare Pruning Criteria on One Treecompare_pruning
Compare Smoothing Schemes on One Datasetcompare_smoothing
Compare Two context trees by Symmetric Divergence with Permutation Testcompare_trees
Fit a Prediction Suffix Tree from Categorical Sequence Datacontext_tree
Most Predictively Divergent Pathwaysdivergent_pathways
Student engagement state sequences (stslist)engagement
Sample Sequences from a Fitted Context Treegenerate_sequences
Collaborative-regulation events (long format)group_regulation_long
Impute Missing States in Sequencesimpute_sequences
Log-Likelihood of a context treelogLik.transitiontrees
Mine Contexts by Next-State Probabilitymine_contexts
Mine Sequences by Predictive Surprisemine_sequences
Model-Fit Scalars in One Callmodel_fit
Number of Contexts (Nodes) in a Treen_nodes
Number of Observations Used to Fit a context treenobs.transitiontrees
Test Whether a Pathway Exists in the Treepathway_exists
Perplexity of a context treeperplexity
Difference (Subtraction) Map Between Two Groupsplot_difference
Per-Context Next-State Distributionsplot_distributions
Lollipop Chart of Pathway Divergenceplot_divergence
Plot Bootstrap Resample Distributions per Pathwayplot_pathway_resamples
Plot Pathways as a Probability Heatmapplot_pathways
Predictive Diagnostics for Held-Out Scoringplot_predictive
Illustrate Pruning Along a Pathway's Suffix Chainplot_pruning
Forward Trajectory Tree (Prefix Tree)plot_trajectories
Plot a Context Treeplot.transitiontrees
Plot a context tree Bootstrapplot.transitiontrees_bootstrap
Plot a context tree Comparisonplot.transitiontrees_comparison
Plot Each Tree in a context tree Groupplot.transitiontrees_group
Plot a Group Comparisonplot.transitiontrees_group_comparison
Plot a context tree CV Gridplot.transitiontrees_tune
Predict Next-State Probabilities from a Context Treepredict.transitiontrees
Reshape Long Event Data into a Wide Sequence Frameprepare_input
Print a Context-Tree Summaryprint.summary.transitiontrees
Print a Context Treeprint.transitiontrees
Print a context tree Bootstrapprint.transitiontrees_bootstrap
Print a context tree Comparisonprint.transitiontrees_comparison
Print a Group of Context Treesprint.transitiontrees_group
Print a Group Comparisonprint.transitiontrees_group_comparison
Print a context tree Tuning Gridprint.transitiontrees_tune
Prune a Context Treeprune_tree
Query the Probability of a Specific Pathway -> Next Statequery_pathway
Per-Position Scoringscore_positions
Per-Sequence Scoringscore_sequences
Sharpest Pathwayssharp_pathways
Simulate Sequences from a Fitted context treesimulate.transitiontrees
Re-Smooth a Fitted context treesmooth_tree
Extract the Subtree Rooted at a Pathwaysubtree
Summary of a Context Treesummary.transitiontrees
Summarise a context tree Bootstrapsummary.transitiontrees_bootstrap
Summarise a Group Comparisonsummary.transitiontrees_group_comparison
Student engagement trajectoriestrajectories
Per-Context Path Dependence of a Context Treetree_dependence
Symmetric KL Distance Between Two context treestree_distance
Pathways from a Fitted Treetree_pathways
Cross-Validated Hyperparameter Tuning for context treestune_tree