FuzzyClass 0.3.0
R6 classes
- All classifiers are now implemented as R6 classes that inherit from the new base class
FuzzyClassifier. Each classifier has a generator named after its function with the suffixModel(e.g.FuzzyGaussianNaiveBayesModel,GauNBFuzzyParamModel,DWFuzzyGammaNaiveBayesModel) and the methods$new(),$fit(train, cl),$predict(newdata, type),$set_params(...),$is_fitted()and$print(). Calls can be chained:FuzzyGammaNaiveBayesModel$new()$fit(x, y)$predict(x_new). - Training now reports its progress with an informative message (classifier, number of observations, predictors and classes, and the training time). It can be silenced with
verbose = FALSEor globally withoptions(FuzzyClass.verbose = FALSE)(seefuzzy_verbose()). - The functional interface is unchanged:
FuzzyGaussianNaiveBayes(train, cl)and the other functions train and return the R6 object, andpredict(fit, newdata)/predict(fit, newdata, type = "matrix")keep working.type = "prob"is now accepted as a synonym of"matrix". Predictions are identical to version 0.2.0. - The estimated quantities are now stored in
fit$estimates(they were the elements of the S3 list returned in previous versions), together withfit$params,fit$predictors,fit$classes,fit$n_obsandfit$fit_time. - Informative error messages (powered by
cli) for untrained models,train/clwith different sizes and missing required arguments (wdelta,weta).
tidymodels
- New parsnip model
fuzzy_naive_bayes(), so every classifier can be used withparsnip,workflows,recipes,rsample,tuneandyardstick. The classifier is chosen by the engine ("gaussian","gamma","beta","exponential","binomial","poisson","geometric","trapezoidal","triangular","hypergeometric","bayes_rule","naive","dw_gamma","dw_hypergeometric","gaussian_fuzzy_param","exponential_fuzzy_param"and"poisson_fuzzy_param"). - The main arguments
fuzzy,alpha_cutandranking_method(metd) can be tuned withtune(); theirdialsparameter objects arefuzzy_membership(),alpha_cut()andranking_method(). -
parsnip,dialsand the other tidymodels packages are only suggested: the model is registered whenparsnipis loaded.
Other changes
- Requires R >= 4.1.0. New imports:
R6andcli. - The tests now use the standard
testthatstructure (tests/testthat/), so they run withR CMD checkanddevtools::test().
FuzzyClass 0.2.0
CRAN release: 2026-10-09
- Added new method for fuzzy number ordering as
metd = 5in functionsGauNBFuzzyParam,ExpNBFuzzyParam, andPoiNBFuzzyParam. - Significant performance optimization across all classifiers: vectorized predictions using native matrix operations and
max.colfor substantial speedups. - Fixed discrete variables validation (
verifyNumbersFunction) ensuring compatibility with R 4.2+ and resolving missing argument errors inDWFuzzyHipergeometricNaiveBayes,FuzzyBinomialNaiveBayes,FuzzyHipergeometricNaiveBayes, andFuzzyPoissonNaiveBayes. - Fixed mathematical consistency in
FuzzyHipergeometricNaiveBayesby applying joint membership once to the class score, consistent with other models. - Fixed prior class probability multiplication in
FuzzyGeoNaiveBayesapplied once per class. - Cleaned up package dependencies: removed unused dependencies (
dplyr,tibble,tidyr,rlang,purrr) fromImports. - Fixed class/label misalignment: parameters were estimated in the order the classes appear in the data while predictions were labelled with the sorted factor levels, so predictions were wrong whenever the training data were not sorted by class. All classifiers now use the factor levels (
get_classes()) for estimation and prediction, and the columns oftype = "matrix"follow the levels. -
FuzzyGammaNaiveBayes/DWFuzzyGammaNaiveBayes: exact Gamma maximum likelihood estimates (the previous optimisation was bounded bymax(x), which truncated the shape/scale). -
FuzzyBetaNaiveBayes: removed the artificial upper bound (10) on the Beta shapes; the method of moments is used as starting value. -
FuzzyGeoNaiveBayes: probability mass function consistent with the estimator (dgeom, support 0, 1, 2, …); memberships use the same intervals in training and prediction, empty intervals (and values outside the training range) receive 0.001. -
FuzzyBinomialNaiveBayes: closed-form method of moments withn >= max(x). -
GauNBFuzzyParam/ExpNBFuzzyParam: confidence intervals (alpha-cuts) use the class sample size instead of the total sample size.ExpNBFuzzyParamranks densities (as the Gaussian and Poisson versions), since the ranking methods assume non-negative fuzzy numbers. -
PoiNBFuzzyParam: alpha-cuts are now nested (they shrink as alpha increases). - Ranking methods (
metd = 1..5) vectorized; the closed form of the Q distance replaces one eigen decomposition per observation.doParallel,foreachandparallelare no longer needed;coresis kept for backward compatibility. -
FuzzyTriangularNaiveBayes/FuzzyTrapezoidalNaiveBayes: densities outside the support are floored at 1e-10, avoiding ties decided by class order. -
FuzzyNaiveBayes: the argumentsmandPiare now passed to the estimators (they were ignored).
FuzzyClass 0.1.7
CRAN release: 2025-09-03
- Add the “Fuzzy Hipergeometric Naive Bayes classifier” as
FuzzyHipergeometricNaiveBayes - Add the “Double Weighted Fuzzy Hipergeometric Naive Bayes classifier” as
DWFuzzyHipergeometricNaiveBayes - Fix: memberships functions. Now they work correctly with dataframes
FuzzyClass 0.1.6
CRAN release: 2024-02-14
- Add the “Fuzzy Rule-based System” with some functions
- Fix:
FuzzyNaiveBayesto one column in the data - Fix: “membership” to dataframe with one column in the data
- Fix: “Frequency” to discrete distributions
FuzzyClass 0.1.5
CRAN release: 2023-08-17
- Add the “double weighted fuzzy gamma naive bayes classifier” as
DWFuzzyGammaNaiveBayes - Add the “geometric fuzzy gamma naive bayes classifier” as
GeometricFuzzyGammaNaiveBayes - Add the “Fuzzy Bayes Rule classifier” as
FuzzyBayesRule - Remove the ordering method for functions with fuzzy parameters
metd=4.
FuzzyClass 0.1.4
CRAN release: 2023-03-07
- Added a new ordering method for functions with fuzzy parameters:
GauNBFuzzyParam,ExpNBFuzzyParam,GamNBFuzzyParamandPoiNBFuzzyParam. The form can be used consideringmetd = 4.
FuzzyClass 0.1.3
CRAN release: 2022-11-16
- Update in parameters estimation in function
FuzzyTriangularNaiveBayes. - Update
predicthas been optimized to functionsFuzzyGammaNaiveBayes. - Update functions of
GamNBFuzzyParamandGauNBFuzzyParam. -
predictfunction has been optimized toFuzzyGammaNaiveBayes,FuzzyBetaNaiveBayes,FuzzyBinomialNaiveBayes,FuzzyExponencialNaiveBayes,FuzzyTriangularNaiveBayes,FuzzyPoissonNaiveBayes