Skip to content

tbnb

0.1.0

Threshold-Based and Iterative Threshold-Based Naive Bayes Classifier

0packages depend
31downloads / year
79.1%test coverage
9/9checks pass

Overview

About
Maintained by Maurizio RomanoFirst published 2026-07-211 releasesCRAN page ↗

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.

Install

Health

CRAN checks
9OK
Slowest check: 3.1 min · r-oldrel-macos-x86_64
Check history
  • OK2026-07-22
    7 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE

Documentation

Documentation signals are not tracked yet for this package.

Downloads

31
CRAN downloads in the past year
Rank #24,520 · ~0/day · ~3/mo
tbnb
Daily download trend is not available in this view yet.

Dependencies

Declared dependencies
10 external dependencies (excludes base and recommended)
Depends (1)
R >= 4.0
Imports (6)
MatrixmethodsstatsgrDevicesgraphicsquanteda (>= 3.0.0)
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Code & Tests

Datasets

People & History

People (1)
Maintainer (1)
Author, Maintainer
Authors (1)
Author, Maintainer
Package Timeline

1 release. R releases are shown for context.

  • 0.1.0Latest
    2026-07-21 · current release
  • R
    R 4.6.0 released · 2026-04-24

Package metadata

First published
2026-07-21
Total releases
1 / 1 yrs
License
GPL (>= 3) OSI
Download size
not tracked yet
Installed size
not tracked yet
With dependencies
not tracked yet
Report a problem with this page →