R Under development (unstable) (2024-02-13 r85898 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(testthat) > library(FuzzyClass) > > data <- iris > > # Test for ExpNBFuzzyParam > test_that("Test for ExpNBFuzzyParam", { + fit <- ExpNBFuzzyParam(train = iris[,-5], cl = iris[,5]) + pred <- predict(fit,iris[,-5]) + expect_equal(TRUE, is.factor(pred)) + }) Test passed 🎊 > > # Test for FuzzyBetaNaiveBayes > test_that("Test for FuzzyBetaNaiveBayes", { + fit <- FuzzyBetaNaiveBayes(train = iris[,-5], cl = iris[,5]) + pred <- predict(fit,iris[,-5]) + expect_equal(TRUE, is.factor(pred)) + }) Test passed 🥳 > > # Test for FuzzyBinomialNaiveBayes > test_that("Test for FuzzyBinomialNaiveBayes", { + fit <- FuzzyBinomialNaiveBayes(train = round(iris[,-5]), cl = iris[,5]) + pred <- predict(fit,round(iris[,-5])) + expect_equal(TRUE, is.factor(pred)) + }) Test passed 🥇 > > test_that("Test for FuzzyBinomialNaiveBayes - one column", { + fit <- FuzzyBinomialNaiveBayes(train = round(iris[,1]), cl = iris[,5]) + pred <- predict(fit,round(iris[,1])) + expect_equal(TRUE, is.factor(pred)) + }) Test passed 🥇 > > # Test for FuzzyExponentialNaiveBayes > test_that("Test for FuzzyExponentialNaiveBayes", { + fit <- FuzzyExponentialNaiveBayes(train = iris[,-5], cl = iris[,5]) + pred <- predict(fit,iris[,-5]) + expect_equal(TRUE, is.factor(pred)) + }) Test passed 😸 > > # Test for FuzzyGammaNaiveBayes > test_that("Test for FuzzyGammaNaiveBayes", { + fit <- FuzzyGammaNaiveBayes(train = iris[,-5], cl = iris[,5]) + pred <- predict(fit,iris[,-5]) + expect_equal(TRUE, is.factor(pred)) + }) Test passed 🥇 > > # Test for FuzzyGaussianNaiveBayes > test_that("Test for FuzzyGaussianNaiveBayes", { + fit <- FuzzyGaussianNaiveBayes(train = iris[,-5], cl = iris[,5]) + pred <- predict(fit,iris[,-5]) + expect_equal(TRUE, is.factor(pred)) + }) Test passed 🥳 > > # Test for FuzzyNaiveBayes > test_that("Test for FuzzyNaiveBayes", { + fit <- FuzzyNaiveBayes(train = iris[,-5], cl = iris[,5]) + pred <- predict(fit,iris[,-5]) + expect_equal(TRUE, is.factor(pred)) + }) Test passed 😀 > > # Test for FuzzyPoissonNaiveBayes > test_that("Test for FuzzyPoissonNaiveBayes", { + fit <- FuzzyPoissonNaiveBayes(train = round(iris[,-5]), cl = iris[,5]) + pred <- predict(fit,round(iris[,-5])) + expect_equal(TRUE, is.factor(pred)) + }) Test passed 🥇 > > test_that("Test for FuzzyPoissonNaiveBayes - one column", { + fit <- FuzzyPoissonNaiveBayes(train = round(iris[,1]), cl = iris[,5]) + pred <- predict(fit,round(iris[,1])) + expect_equal(TRUE, is.factor(pred)) + }) Test passed 🥳 > > # Test for FuzzyTrapezoidalNaiveBayes > test_that("Test for FuzzyTrapezoidalNaiveBayes", { + fit <- FuzzyTrapezoidalNaiveBayes(train = iris[,-5], cl = iris[,5]) + pred <- predict(fit,round(iris[,-5])) + expect_equal(TRUE, is.factor(pred)) + }) ── Warning: Test for FuzzyTrapezoidalNaiveBayes ──────────────────────────────── steady-state not reached Backtrace: ▆ 1. ├─FuzzyClass::FuzzyTrapezoidalNaiveBayes(...) 2. └─FuzzyClass:::FuzzyTrapezoidalNaiveBayes.default(...) 3. └─FuzzyClass:::estimation_parameters_trape(M, cols, dados) 4. └─base::lapply(...) 5. └─FuzzyClass (local) FUN(X[[i]], ...) 6. └─base::lapply(...) 7. └─FuzzyClass (local) FUN(X[[i]], ...) 8. └─FuzzyClass:::getParametersTrapezoidal(SubSet) 9. └─rootSolve::multiroot(f = model, start = c(pmedio, pmedio + 0.1)) 10. └─rootSolve::steady(...) 11. └─rootSolve::stode(y, times, func, parms = parms, ...) > > # Test for FuzzyTriangularNaiveBayes > test_that("Test for FuzzyTriangularNaiveBayes", { + fit <- FuzzyTriangularNaiveBayes(train = iris[,-5], cl = iris[,5]) + pred <- predict(fit,round(iris[,-5])) + expect_equal(TRUE, is.factor(pred)) + }) Test passed 😀 > > # Test for GauNBFuzzyParam > test_that("Test for GauNBFuzzyParam", { + fit <- GauNBFuzzyParam(train = iris[,-5], cl = iris[,5]) + pred <- predict(fit,round(iris[,-5])) + expect_equal(TRUE, is.factor(pred)) + }) Test passed 🎉 > > > proc.time() user system elapsed 3.96 0.34 5.78