Fuzzy Hypergeometric Naive Bayes (R6 class)
Source:R/FuzzyHiperGeometricNaiveBayes.R
FuzzyHipergeometricNaiveBayesModel.RdR6 implementation of the Fuzzy Hypergeometric Naive Bayes classifier. Create the model with
FuzzyHipergeometricNaiveBayesModel$new(), train it with $fit(train, cl) and classify new
observations with $predict(newdata). The functional interface
FuzzyHipergeometricNaiveBayes() trains and returns an object of this class.
Super class
FuzzyClassifier -> FuzzyHipergeometricNaiveBayes
Methods
FuzzyHipergeometricNaiveBayes$new()
Create a new (untrained) classifier.
Usage
FuzzyHipergeometricNaiveBayes$new(fuzzy = TRUE)Examples
model <- FuzzyHipergeometricNaiveBayesModel$new()
x <- data.frame(s1 = c(1, 2, 1, 2), n1 = c(5, 5, 6, 6))
y <- factor(c("A", "A", "B", "B"))
model$fit(train = x, cl = y)
#> ℹ Fuzzy Hypergeometric Naive Bayes: 4 observations, 2 predictors and 2 classes
#> ℹ Training the model: estimating its parameters
#> ✔ Model trained successfully [10ms]
#>
model$predict(x)
#> [1] A B A B
#> Levels: A B
model
#> <FuzzyHipergeometricNaiveBayes> Fuzzy Hypergeometric Naive Bayes
#> ✔ Trained on 4 observations in 0.001s
#> Hyperparameters: fuzzy = TRUE
#> Predictors (2): s1, n1
#> Classes (2): A, B