Package: tbnb 0.1.0

Maurizio Romano
tbnb: Threshold-Based and Iterative Threshold-Based Naive Bayes Classifier
Implements the Threshold-Based Naive Bayes (Tb-NB) classifier and its iterative refinement (iTb-NB) for binary sentiment / text classification problems. The classifier computes a continuous log-likelihood ratio score per document and uses a data-driven decision threshold estimated via K-fold cross-validation on a user-selected criterion (accuracy, F1 score, Matthews correlation coefficient, balanced error, etc.). An optional iterative refinement procedure locally re-estimates the threshold in regions of class overlap using either Gaussian kernel density estimation or a Central Limit Theorem bootstrap approximation. The package exposes an idiomatic R formula + data.frame interface together with a 'quanteda'-based text preprocessing pipeline, supports user-supplied document-feature matrices, and includes an optional word-embedding extension that augments the Bag-of-Words with K nearest semantic neighbours of each token. The package additionally implements the p-value extension proposed by Romano (2025) for both document- and feature-level interpretability via tbnb_pvalues(). Methods are described in Romano, Contu, Mola, Conversano (2024) <doi:10.1007/s11634-023-00536-8>, Romano, Zammarchi, Conversano (2024) <doi:10.1007/s10260-023-00721-1>, and Romano (2025) <doi:10.1007/978-3-031-96736-8_41>.
Authors:
tbnb_0.1.0.tar.gz
tbnb_0.1.0.tar.gz(r-4.7-any)tbnb_0.1.0.tar.gz(r-4.6-any)
tbnb_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
tbnb/json (API)
| # Install 'tbnb' in R: |
| install.packages('tbnb', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org')) |
- toy_reviews - Toy hotel reviews dataset
This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.
Last updated from:faa86269cf. Checks:4 OK. Indexed: yes.
| Target | Result | Time | Files | Syslog |
|---|---|---|---|---|
| linux-devel-x86_64 | OK | 142 | ||
| source / vignettes | OK | 185 | ||
| linux-release-x86_64 | OK | 133 | ||
| wasm-release | OK | 124 |
Exports:itbnbtbnb_available_criteriatbnb_categorizetbnb_embeddingtbnb_hospitality_seedstbnb_iteratetbnb_metricstbnb_optimize_thresholdtbnb_posthoc_plotstbnb_preprocesstbnb_pvaluestbnb_score
Dependencies:clifastmatchISOcodesjsonlitelatticelifecyclemagrittrMatrixquantedaRcpprlangSnowballCstopwordsstringixml2yaml