{
  "_id": "6a5f659e14e95619b75d64f6",
  "Package": "tbnb",
  "Type": "Package",
  "Title": "Threshold-Based and Iterative Threshold-Based Naive Bayes\nClassifier",
  "Version": "0.1.0",
  "Authors@R": "person(given = \"Maurizio\", family = \"Romano\",\nemail = \"romano.maurizio@unica.it\", role = c(\"aut\", \"cre\"))",
  "Description": "Implements the Threshold-Based Naive Bayes (Tb-NB)\nclassifier and its iterative refinement (iTb-NB) for binary\nsentiment / text classification problems. The classifier\ncomputes a continuous log-likelihood ratio score per document\nand uses a data-driven decision threshold estimated via K-fold\ncross-validation on a user-selected criterion (accuracy, F1\nscore, Matthews correlation coefficient, balanced error, etc.).\nAn optional iterative refinement procedure locally re-estimates\nthe threshold in regions of class overlap using either Gaussian\nkernel density estimation or a Central Limit Theorem bootstrap\napproximation. The package exposes an idiomatic R formula +\ndata.frame interface together with a 'quanteda'-based text\npreprocessing pipeline, supports user-supplied document-feature\nmatrices, and includes an optional word-embedding extension\nthat augments the Bag-of-Words with K nearest semantic\nneighbours of each token. The package additionally implements\nthe p-value extension proposed by Romano (2025) for both\ndocument- and feature-level interpretability via\ntbnb_pvalues(). Methods are described in Romano, Contu, Mola,\nConversano (2024) <doi:10.1007/s11634-023-00536-8>, Romano,\nZammarchi, Conversano (2024) <doi:10.1007/s10260-023-00721-1>,\nand Romano (2025) <doi:10.1007/978-3-031-96736-8_41>.",
  "License": "GPL (>= 3)",
  "Encoding": "UTF-8",
  "Language": "en-GB",
  "LazyData": "true",
  "Config/testthat/edition": "3",
  "RoxygenNote": "7.3.3",
  "NeedsCompilation": "no",
  "Packaged": {
    "Date": "2026-07-21 12:24:06 UTC",
    "User": "root"
  },
  "Author": "Maurizio Romano [aut, cre]",
  "Maintainer": "Maurizio Romano <romano.maurizio@unica.it>",
  "Repository": "https://cran.r-universe.dev",
  "Date/Publication": "2026-07-21 09:30:07 UTC",
  "RemoteUrl": "https://github.com/cran/tbnb",
  "RemoteRef": "HEAD",
  "RemoteSha": "faa86269cf5f9a5b901b1d2fe9a0fab1d641af93",
  "_user": "cran",
  "_type": "src",
  "_file": "tbnb_0.1.0.tar.gz",
  "_fileid": "https://r2.ropensci.org/07cc0fbfec1cc9d00cee129449ab4222deb746f3d1a443ebb2c5d658dce2766d",
  "_filesize": 331167,
  "_sha256": "07cc0fbfec1cc9d00cee129449ab4222deb746f3d1a443ebb2c5d658dce2766d",
  "_expires": "2026-10-29T12:27:08.000Z",
  "_created": "2026-07-21T12:24:06.000Z",
  "_published": "2026-07-21T12:27:10.272Z",
  "_jobs": [
    {
      "job": 88632031133,
      "time": 142,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "8494891054"
    },
    {
      "job": 88632031122,
      "time": 133,
      "config": "linux-release-x86_64",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "8494887677"
    },
    {
      "job": 88631267183,
      "time": 185,
      "config": "source",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "8494826947"
    },
    {
      "job": 88632031144,
      "time": 124,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "8494883007"
    }
  ],
  "_host": "GitHub-Actions",
  "_buildurl": "https://github.com/r-universe/cran/actions/runs/29829696851",
  "_status": "success",
  "_upstream": "https://github.com/cran/tbnb",
  "_commit": {
    "id": "faa86269cf5f9a5b901b1d2fe9a0fab1d641af93",
    "author": "Maurizio Romano <romano.maurizio@unica.it>",
    "committer": "cran-robot <csardi.gabor+cran@gmail.com>",
    "message": "version 0.1.0\n",
    "time": 1784626207
  },
  "_maintainer": {
    "name": "Maurizio Romano",
    "email": "romano.maurizio@unica.it"
  },
  "_distro": "resolute",
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 4.0",
      "role": "Depends"
    },
    {
      "package": "Matrix",
      "role": "Imports"
    },
    {
      "package": "methods",
      "role": "Imports"
    },
    {
      "package": "stats",
      "role": "Imports"
    },
    {
      "package": "grDevices",
      "role": "Imports"
    },
    {
      "package": "graphics",
      "role": "Imports"
    },
    {
      "package": "quanteda",
      "version": ">= 3.0.0",
      "role": "Imports"
    },
    {
      "package": "text2vec",
      "role": "Suggests"
    },
    {
      "package": "stopwords",
      "role": "Suggests"
    },
    {
      "package": "SnowballC",
      "role": "Suggests"
    },
    {
      "package": "cld2",
      "role": "Suggests"
    },
    {
      "package": "cld3",
      "role": "Suggests"
    },
    {
      "package": "dbscan",
      "role": "Suggests"
    },
    {
      "package": "viridisLite",
      "role": "Suggests"
    },
    {
      "package": "testthat",
      "version": ">= 3.0.0",
      "role": "Suggests"
    },
    {
      "package": "ggplot2",
      "role": "Suggests"
    }
  ],
  "_owner": "cran",
  "_selfowned": false,
  "_usedby": 0,
  "_updates": [
    {
      "week": "2026-30",
      "n": 1
    }
  ],
  "_tags": [
    {
      "name": "0.1.0",
      "date": "2026-07-21"
    }
  ],
  "_stars": 0,
  "_userbio": {
    "uuid": 6899542,
    "type": "organization",
    "name": "cran",
    "followers": 622,
    "description": "Unofficial read-only mirror of all CRAN R packages"
  },
  "_downloads": {
    "count": 0,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/tbnb"
  },
  "_rbuild": "4.6.1",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/readme.html",
    "extra/readme.md",
    "extra/tbnb.html",
    "manual.pdf"
  ],
  "_cranurl": false,
  "_releases": [
    {
      "version": "0.1.0",
      "date": "2026-07-21"
    }
  ],
  "_exports": [
    "itbnb",
    "tbnb_available_criteria",
    "tbnb_categorize",
    "tbnb_embedding",
    "tbnb_hospitality_seeds",
    "tbnb_iterate",
    "tbnb_metrics",
    "tbnb_optimize_threshold",
    "tbnb_posthoc_plots",
    "tbnb_preprocess",
    "tbnb_pvalues",
    "tbnb_score"
  ],
  "_datasets": [
    {
      "name": "toy_reviews",
      "title": "Toy hotel reviews dataset",
      "object": "toy_reviews",
      "class": [
        "data.frame"
      ],
      "fields": [
        "sentiment",
        "text"
      ],
      "rows": 200,
      "table": true,
      "tojson": true
    }
  ],
  "_help": [
    {
      "page": "itbnb",
      "title": "Fit a Threshold-Based Naive Bayes classifier (Tb-NB / iTb-NB)",
      "topics": [
        "itbnb",
        "itbnb.default",
        "itbnb.formula"
      ]
    },
    {
      "page": "plot.tbnb",
      "title": "Plot the distribution of decision scores by class",
      "topics": [
        "plot.tbnb"
      ]
    },
    {
      "page": "predict.tbnb",
      "title": "Predictions from a fitted 'tbnb' model",
      "topics": [
        "predict.tbnb"
      ]
    },
    {
      "page": "summary.tbnb",
      "title": "Summary of a fitted Tb-NB / iTb-NB model",
      "topics": [
        "summary.tbnb"
      ]
    },
    {
      "page": "tbnb_available_criteria",
      "title": "Names of the criteria supported by 'itbnb()' for threshold optimisation",
      "topics": [
        "tbnb_available_criteria"
      ]
    },
    {
      "page": "tbnb_categorize",
      "title": "Categorise the vocabulary of a fitted Tb-NB / iTb-NB model",
      "topics": [
        "tbnb_categorize"
      ]
    },
    {
      "page": "tbnb_embedding",
      "title": "Configure the word-embedding semantic augmentation of the BoW",
      "topics": [
        "tbnb_embedding"
      ]
    },
    {
      "page": "tbnb_hospitality_seeds",
      "title": "Built-in seed words for hospitality / hotel reviews",
      "topics": [
        "tbnb_hospitality_seeds"
      ]
    },
    {
      "page": "tbnb_iterate",
      "title": "Iterative refinement of the decision threshold (iTb-NB)",
      "topics": [
        "tbnb_iterate"
      ]
    },
    {
      "page": "tbnb_metrics",
      "title": "Compute all binary classification metrics from confusion counts",
      "topics": [
        "tbnb_metrics"
      ]
    },
    {
      "page": "tbnb_optimize_threshold",
      "title": "Cross-validated threshold optimisation for a Tb-NB classifier",
      "topics": [
        "tbnb_optimize_threshold"
      ]
    },
    {
      "page": "tbnb_posthoc_plots",
      "title": "Generate post-hoc analysis plots from a fitted Tb-NB / iTb-NB model",
      "topics": [
        "tbnb_posthoc_plots"
      ]
    },
    {
      "page": "tbnb_preprocess",
      "title": "Configure the text-preprocessing pipeline",
      "topics": [
        "tbnb_preprocess"
      ]
    },
    {
      "page": "tbnb_pvalues",
      "title": "P-values for documents and features (Tb-NB / iTb-NB)",
      "topics": [
        "tbnb_pvalues"
      ]
    },
    {
      "page": "toy_reviews",
      "title": "Toy hotel reviews dataset",
      "topics": [
        "toy_reviews"
      ]
    }
  ],
  "_readme": "https://github.com/cran/tbnb/raw/HEAD/README.md",
  "_rundeps": [
    "cli",
    "fastmatch",
    "ISOcodes",
    "jsonlite",
    "lattice",
    "lifecycle",
    "magrittr",
    "Matrix",
    "quanteda",
    "Rcpp",
    "rlang",
    "SnowballC",
    "stopwords",
    "stringi",
    "xml2",
    "yaml"
  ],
  "_vignettes": [
    {
      "source": "tbnb-intro.Rnw",
      "filename": "tbnb-intro.pdf",
      "title": "Introduction to tbnb",
      "engine": "utils::Sweave",
      "headings": [],
      "created": "2026-07-21 09:30:07",
      "modified": "2026-07-21 09:30:07",
      "commits": 1
    }
  ],
  "_score": 2.6989700043360187,
  "_indexed": true,
  "_nocasepkg": "tbnb",
  "_universes": [
    "cran"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "0.1.0",
      "date": "2026-07-21T12:26:22.000Z",
      "distro": "resolute",
      "commit": "faa86269cf5f9a5b901b1d2fe9a0fab1d641af93",
      "fileid": "https://r2.ropensci.org/6072bad50a1694240fc34379e6883686171a641646cde88f39e60a312e063ad3",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/cran/actions/runs/29829696851"
    },
    {
      "r": "4.6.1",
      "os": "linux",
      "version": "0.1.0",
      "date": "2026-07-21T12:26:16.000Z",
      "distro": "resolute",
      "commit": "faa86269cf5f9a5b901b1d2fe9a0fab1d641af93",
      "fileid": "https://r2.ropensci.org/2548cc42c2bd54861546d24d94ae97bb1896ce14d9988851c5362a65115600cd",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/cran/actions/runs/29829696851"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "0.1.0",
      "date": "2026-07-21T12:26:24.000Z",
      "commit": "faa86269cf5f9a5b901b1d2fe9a0fab1d641af93",
      "fileid": "https://r2.ropensci.org/3b136beb78f5484f5e5d3a147997457c29ee2c43bb075b7947ba1fdd2e644fce",
      "status": "success",
      "buildurl": "https://github.com/r-universe/cran/actions/runs/29829696851"
    }
  ]
}