Skip to contents

R6 implementation of the Double Weighted Fuzzy Gamma Naive Bayes classifier. Create the model with DWFuzzyGammaNaiveBayesModel$new(), train it with $fit(train, cl) and classify new observations with $predict(newdata). The functional interface DWFuzzyGammaNaiveBayes() trains and returns an object of this class.

Super class

FuzzyClassifier -> DWFuzzyGammaNaiveBayes

Methods

Inherited methods


DWFuzzyGammaNaiveBayes$new()

Create a new (untrained) classifier.

Usage

DWFuzzyGammaNaiveBayes$new(fuzzy = TRUE, wdelta, weta)


DWFuzzyGammaNaiveBayes$clone()

The objects of this class are cloneable with this method.

Usage

DWFuzzyGammaNaiveBayes$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

model <- DWFuzzyGammaNaiveBayesModel$new(wdelta = rep(1/3, 3), weta = c(0.3, 0.2, 0.5))
data(GamWeightData)
model$fit(train = GamWeightData[, -4], cl = GamWeightData[, 4])
#> ℹ Double Weighted Fuzzy Gamma Naive Bayes: 600 observations, 3 predictors and 3 classes
#> ℹ Training the model: estimating its parameters
#> ✔ Model trained successfully [5ms]
#> 
head(model$predict(GamWeightData[, -4]))
#> [1] 1 1 1 1 1 1
#> Levels: 1 2 3
model
#> <DWFuzzyGammaNaiveBayes> Double Weighted Fuzzy Gamma Naive Bayes
#> ✔ Trained on 600 observations in 0.003s
#>   Hyperparameters: fuzzy = TRUE, wdelta = c(0.333333333333333, 0.333333333333333, 0.333333333333333), weta = c(0.3, 0.2, 0.5)
#>   Predictors (3): Var1, Var2, Var3
#>   Classes (3): 1, 2, 3