From 950bcdd31e2767359adba682b86d06689d58ac9e Mon Sep 17 00:00:00 2001 From: sisyphus-jasp Date: Fri, 6 Mar 2026 04:11:45 +0100 Subject: [PATCH] [jaspMachineLearning] Fix confusion matrix in Classification Boosting to display all... --- R/mlClassificationBoosting.R | 11 +- .../data-split.new.svg | 44 ++ .../relative-influence-plot.new.svg | 81 ++ .../data-split.new.svg | 44 ++ .../decision-tree-plot.new.svg | 77 ++ .../mlclassificationknn/data-split.new.svg | 44 ++ .../mlclassificationlda/data-split.new.svg | 42 + ...near-discriminant-matrix-subplot-1.new.svg | 34 + ...near-discriminant-matrix-subplot-2.new.svg | 34 + ...near-discriminant-matrix-subplot-3.new.svg | 34 + ...near-discriminant-matrix-subplot-4.new.svg | 59 ++ ...near-discriminant-matrix-subplot-5.new.svg | 227 ++++++ ...near-discriminant-matrix-subplot-6.new.svg | 34 + ...near-discriminant-matrix-subplot-8.new.svg | 59 ++ .../data-split-1.new.svg | 42 + .../data-split-2.new.svg | 42 + .../data-split.new.svg | 42 + .../data-split.new.svg | 44 ++ .../mean-decrease-in-accuracy.new.svg | 77 ++ .../total-increase-in-node-purity.new.svg | 81 ++ .../mlclassificationsvm/data-split.new.svg | 44 ++ .../all-predictors.new.svg | 340 ++++++++ .../k-distance-plot.new.svg | 70 ++ .../all-predictors.new.svg | 287 +++++++ .../all-predictors.new.svg | 456 +++++++++++ .../dendogram.new.svg | 745 ++++++++++++++++++ .../all-predictors-2.new.svg | 395 ++++++++++ .../all-predictors-3.new.svg | 346 ++++++++ .../mlclusteringkmeans/all-predictors.new.svg | 344 ++++++++ .../all-predictors.new.svg | 234 ++++++ .../all-predictors.new.svg | 234 ++++++ .../mlregressionboosting/data-split.new.svg | 44 ++ .../relative-influence-plot.new.svg | 79 ++ .../data-split.new.svg | 44 ++ .../decision-tree-plot.new.svg | 162 ++++ .../_snaps/mlregressionknn/data-split.new.svg | 44 ++ .../mlregressionlinear/data-split.new.svg | 42 + .../data-split.new.svg | 44 ++ .../mean-decrease-in-accuracy.new.svg | 81 ++ .../total-increase-in-node-purity.new.svg | 73 ++ .../data-split.new.svg | 44 ++ .../_snaps/mlregressionsvm/data-split.new.svg | 44 ++ 42 files changed, 5345 insertions(+), 3 deletions(-) create mode 100644 tests/testthat/_snaps/mlclassificationboosting/data-split.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationboosting/relative-influence-plot.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationdecisiontree/data-split.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationdecisiontree/decision-tree-plot.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationknn/data-split.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationlda/data-split.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-1.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-2.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-3.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-4.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-5.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-6.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-8.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationlogisticmultinomial/data-split-1.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationlogisticmultinomial/data-split-2.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationnaivebayes/data-split.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationrandomforest/data-split.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationrandomforest/mean-decrease-in-accuracy.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationrandomforest/total-increase-in-node-purity.new.svg create mode 100644 tests/testthat/_snaps/mlclassificationsvm/data-split.new.svg create mode 100644 tests/testthat/_snaps/mlclusteringdensitybased/all-predictors.new.svg create mode 100644 tests/testthat/_snaps/mlclusteringdensitybased/k-distance-plot.new.svg create mode 100644 tests/testthat/_snaps/mlclusteringfuzzycmeans/all-predictors.new.svg create mode 100644 tests/testthat/_snaps/mlclusteringhierarchical/all-predictors.new.svg create mode 100644 tests/testthat/_snaps/mlclusteringhierarchical/dendogram.new.svg create mode 100644 tests/testthat/_snaps/mlclusteringkmeans/all-predictors-2.new.svg create mode 100644 tests/testthat/_snaps/mlclusteringkmeans/all-predictors-3.new.svg create mode 100644 tests/testthat/_snaps/mlclusteringkmeans/all-predictors.new.svg create mode 100644 tests/testthat/_snaps/mlclusteringmodelbased/all-predictors.new.svg create mode 100644 tests/testthat/_snaps/mlclusteringrandomforest/all-predictors.new.svg create mode 100644 tests/testthat/_snaps/mlregressionboosting/data-split.new.svg create mode 100644 tests/testthat/_snaps/mlregressionboosting/relative-influence-plot.new.svg create mode 100644 tests/testthat/_snaps/mlregressiondecisiontree/data-split.new.svg create mode 100644 tests/testthat/_snaps/mlregressiondecisiontree/decision-tree-plot.new.svg create mode 100644 tests/testthat/_snaps/mlregressionknn/data-split.new.svg create mode 100644 tests/testthat/_snaps/mlregressionlinear/data-split.new.svg create mode 100644 tests/testthat/_snaps/mlregressionrandomforest/data-split.new.svg create mode 100644 tests/testthat/_snaps/mlregressionrandomforest/mean-decrease-in-accuracy.new.svg create mode 100644 tests/testthat/_snaps/mlregressionrandomforest/total-increase-in-node-purity.new.svg create mode 100644 tests/testthat/_snaps/mlregressionregularized/data-split.new.svg create mode 100644 tests/testthat/_snaps/mlregressionsvm/data-split.new.svg diff --git a/R/mlClassificationBoosting.R b/R/mlClassificationBoosting.R index 8edcfa69..bfd8c984 100644 --- a/R/mlClassificationBoosting.R +++ b/R/mlClassificationBoosting.R @@ -147,27 +147,32 @@ mlClassificationBoosting <- function(jaspResults, dataset, options, ...) { dataProbs <- gbm::predict.gbm(fit, newdata = dataset, n.trees = noOfTrees, type = "response") dataPredictions <- colnames(dataProbs)[apply(dataProbs, 1, which.max)] testPredictions <- dataPredictions[-trainingIndex] + targetLevels <- levels(dataset[, options[["target"]]]) + testPredictions <- factor(testPredictions, levels = targetLevels) + testReal <- factor(testSet[, options[["target"]]], levels = targetLevels) # Create results object result <- list() result[["model"]] <- fit result[["formula"]] <- formula result[["noOfFolds"]] <- noOfFolds result[["noOfTrees"]] <- noOfTrees - result[["confTable"]] <- table("Pred" = testPredictions, "Real" = testSet[, options[["target"]]]) + result[["confTable"]] <- table("Pred" = testPredictions, "Real" = testReal) result[["testAcc"]] <- sum(diag(prop.table(result[["confTable"]]))) result[["relInf"]] <- summary(fit, plot = FALSE) result[["auc"]] <- .classificationCalcAUC(testSet, trainingSet, options, "boostingClassification", noOfFolds = noOfFolds, noOfTrees = noOfTrees) result[["ntrain"]] <- nrow(trainingSet) result[["ntest"]] <- nrow(testSet) result[["testPred"]] <- testPredictions - result[["testReal"]] <- testSet[, options[["target"]]] + result[["testReal"]] <- testReal result[["train"]] <- trainingSet result[["test"]] <- testSet result[["method"]] <- if (options[["modelValid"]] == "validationManual") "OOB" else "" result[["testIndicatorColumn"]] <- testIndicatorColumn result[["classes"]] <- dataPredictions if (options[["modelOptimization"]] != "manual") { - result[["validationConfTable"]] <- table("Pred" = validationPredictions, "Real" = validationSet[, options[["target"]]]) + validationPredictions <- factor(validationPredictions, levels = targetLevels) + validationReal <- factor(validationSet[, options[["target"]]], levels = targetLevels) + result[["validationConfTable"]] <- table("Pred" = validationPredictions, "Real" = validationReal) result[["validAcc"]] <- sum(diag(prop.table(result[["validationConfTable"]]))) result[["nvalid"]] <- nrow(validationSet) result[["valid"]] <- validationSet diff --git a/tests/testthat/_snaps/mlclassificationboosting/data-split.new.svg b/tests/testthat/_snaps/mlclassificationboosting/data-split.new.svg new file mode 100644 index 00000000..689c5b50 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationboosting/data-split.new.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + +Train: 114 +Validation: 29 +Test: 35 +Total: 178 + + + + + +data-split + + diff --git a/tests/testthat/_snaps/mlclassificationboosting/relative-influence-plot.new.svg b/tests/testthat/_snaps/mlclassificationboosting/relative-influence-plot.new.svg new file mode 100644 index 00000000..1293ceb8 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationboosting/relative-influence-plot.new.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Proanthocyanins +Alcalinity +Nonflavanoids +Ash +Magnesium +Malic +Phenols +Dilution +Hue +Alcohol +Flavanoids +Color +Proline + + + + + + + + + +0 +5 +10 +15 +20 +25 +30 +35 +Relative Influence +relative-influence-plot + + diff --git a/tests/testthat/_snaps/mlclassificationdecisiontree/data-split.new.svg b/tests/testthat/_snaps/mlclassificationdecisiontree/data-split.new.svg new file mode 100644 index 00000000..b254084a --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationdecisiontree/data-split.new.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + +Train: 96 +Validation: 24 +Test: 30 +Total: 150 + + + + + +data-split + + diff --git a/tests/testthat/_snaps/mlclassificationdecisiontree/decision-tree-plot.new.svg b/tests/testthat/_snaps/mlclassificationdecisiontree/decision-tree-plot.new.svg new file mode 100644 index 00000000..43ac1390 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationdecisiontree/decision-tree-plot.new.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +< + -0.741 + + + -0.741 + +< + 0.591 + + + 0.591 + +Petal.Length +n = 96 + +setosa +n = 30 + +Petal.Width +n = 66 + +versicolor +n = 32 + +virginica +n = 34 + +setosa +n = 30 + +versicolor +n = 32 + +virginica +n = 34 + + + + + +decision-tree-plot + + diff --git a/tests/testthat/_snaps/mlclassificationknn/data-split.new.svg b/tests/testthat/_snaps/mlclassificationknn/data-split.new.svg new file mode 100644 index 00000000..689c5b50 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationknn/data-split.new.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + +Train: 114 +Validation: 29 +Test: 35 +Total: 178 + + + + + +data-split + + diff --git a/tests/testthat/_snaps/mlclassificationlda/data-split.new.svg b/tests/testthat/_snaps/mlclassificationlda/data-split.new.svg new file mode 100644 index 00000000..c71e60c8 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationlda/data-split.new.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + +Train: 143 +Test: 35 +Total: 178 + + + + + +data-split + + diff --git a/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-1.new.svg b/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-1.new.svg new file mode 100644 index 00000000..8671359b --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-1.new.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + +LD1 + + +linear-discriminant-matrix-subplot-1 + + diff --git a/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-2.new.svg b/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-2.new.svg new file mode 100644 index 00000000..0e26527a --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-2.new.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + +LD2 + + +linear-discriminant-matrix-subplot-2 + + diff --git a/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-3.new.svg b/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-3.new.svg new file mode 100644 index 00000000..2f335974 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-3.new.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + +LD1 + + +linear-discriminant-matrix-subplot-3 + + diff --git a/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-4.new.svg b/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-4.new.svg new file mode 100644 index 00000000..5ef6e498 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-4.new.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-6 +-4 +-2 +0 +2 +4 +6 +8 +Density +linear-discriminant-matrix-subplot-4 + + diff --git a/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-5.new.svg b/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-5.new.svg new file mode 100644 index 00000000..4cbffa76 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-5.new.svg @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Type + + + + + + +1 +2 +3 +linear-discriminant-matrix-subplot-5 + + diff --git a/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-6.new.svg b/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-6.new.svg new file mode 100644 index 00000000..eb5317c1 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-6.new.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + +LD2 + + +linear-discriminant-matrix-subplot-6 + + diff --git a/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-8.new.svg b/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-8.new.svg new file mode 100644 index 00000000..fb2ecf61 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationlda/linear-discriminant-matrix-subplot-8.new.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-8 +-6 +-4 +-2 +0 +2 +4 +6 +Density +linear-discriminant-matrix-subplot-8 + + diff --git a/tests/testthat/_snaps/mlclassificationlogisticmultinomial/data-split-1.new.svg b/tests/testthat/_snaps/mlclassificationlogisticmultinomial/data-split-1.new.svg new file mode 100644 index 00000000..3af22552 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationlogisticmultinomial/data-split-1.new.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + +Train: 160 +Test: 40 +Total: 200 + + + + + +data-split-1 + + diff --git a/tests/testthat/_snaps/mlclassificationlogisticmultinomial/data-split-2.new.svg b/tests/testthat/_snaps/mlclassificationlogisticmultinomial/data-split-2.new.svg new file mode 100644 index 00000000..a1148ca2 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationlogisticmultinomial/data-split-2.new.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + +Train: 120 +Test: 30 +Total: 150 + + + + + +data-split-2 + + diff --git a/tests/testthat/_snaps/mlclassificationnaivebayes/data-split.new.svg b/tests/testthat/_snaps/mlclassificationnaivebayes/data-split.new.svg new file mode 100644 index 00000000..fa95a138 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationnaivebayes/data-split.new.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + +Train: 120 +Test: 30 +Total: 150 + + + + + +data-split + + diff --git a/tests/testthat/_snaps/mlclassificationrandomforest/data-split.new.svg b/tests/testthat/_snaps/mlclassificationrandomforest/data-split.new.svg new file mode 100644 index 00000000..689c5b50 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationrandomforest/data-split.new.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + +Train: 114 +Validation: 29 +Test: 35 +Total: 178 + + + + + +data-split + + diff --git a/tests/testthat/_snaps/mlclassificationrandomforest/mean-decrease-in-accuracy.new.svg b/tests/testthat/_snaps/mlclassificationrandomforest/mean-decrease-in-accuracy.new.svg new file mode 100644 index 00000000..5a280d98 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationrandomforest/mean-decrease-in-accuracy.new.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Magnesium +Ash +Alcalinity +Proanthocyanins +Malic +Nonflavanoids +Hue +Alcohol +Phenols +Color +Dilution +Flavanoids +Proline + + + + + + + +0.00 +0.05 +0.10 +0.15 +0.20 +0.25 +Mean Decrease in Accuracy +mean-decrease-in-accuracy + + diff --git a/tests/testthat/_snaps/mlclassificationrandomforest/total-increase-in-node-purity.new.svg b/tests/testthat/_snaps/mlclassificationrandomforest/total-increase-in-node-purity.new.svg new file mode 100644 index 00000000..e2c5db28 --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationrandomforest/total-increase-in-node-purity.new.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Nonflavanoids +Proanthocyanins +Phenols +Magnesium +Malic +Ash +Alcalinity +Flavanoids +Hue +Dilution +Proline +Alcohol +Color + + + + + + + + + +-0.02 +0.00 +0.02 +0.04 +0.06 +0.08 +0.10 +0.12 +Total Increase in Node Purity +total-increase-in-node-purity + + diff --git a/tests/testthat/_snaps/mlclassificationsvm/data-split.new.svg b/tests/testthat/_snaps/mlclassificationsvm/data-split.new.svg new file mode 100644 index 00000000..b254084a --- /dev/null +++ b/tests/testthat/_snaps/mlclassificationsvm/data-split.new.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + +Train: 96 +Validation: 24 +Test: 30 +Total: 150 + + + + + +data-split + + diff --git a/tests/testthat/_snaps/mlclusteringdensitybased/all-predictors.new.svg b/tests/testthat/_snaps/mlclusteringdensitybased/all-predictors.new.svg new file mode 100644 index 00000000..780d3aad --- /dev/null +++ b/tests/testthat/_snaps/mlclusteringdensitybased/all-predictors.new.svg @@ -0,0 +1,340 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +-1 +0 +1 +2 + + + + + + +Alcohol +Malic +Ash +Alcalinity +Magnesium +Phenols +Flavanoids +Nonflavanoids +Proanthocyanins +Color +Hue +Dilution +Proline +Cluster Mean + + +Cluster + + + + + + + + + + +1 +2 +3 +4 +Noisepoint +all-predictors + + diff --git a/tests/testthat/_snaps/mlclusteringdensitybased/k-distance-plot.new.svg b/tests/testthat/_snaps/mlclusteringdensitybased/k-distance-plot.new.svg new file mode 100644 index 00000000..4f63f741 --- /dev/null +++ b/tests/testthat/_snaps/mlclusteringdensitybased/k-distance-plot.new.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + +Maximum curvature = 2.16 + + + + + + + + +0 +1 +2 +3 +4 +5 +6 + + + + + + + + + + + + + +0 +50 +100 +150 +200 +Points Sorted by Distance +5-Nearest Neighbors +Distance +k-distance-plot + + diff --git a/tests/testthat/_snaps/mlclusteringfuzzycmeans/all-predictors.new.svg b/tests/testthat/_snaps/mlclusteringfuzzycmeans/all-predictors.new.svg new file mode 100644 index 00000000..b5db25f8 --- /dev/null +++ b/tests/testthat/_snaps/mlclusteringfuzzycmeans/all-predictors.new.svg @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +-1 +0 +1 +2 +3 + + + + + + + +Alcohol +Malic +Ash +Alcalinity +Magnesium +Phenols +Flavanoids +Nonflavanoids +Proanthocyanins +Color +Hue +Dilution +Proline +Cluster Mean + + +Cluster + + + + + + + + +1 +2 +3 +4 +all-predictors + + diff --git a/tests/testthat/_snaps/mlclusteringhierarchical/all-predictors.new.svg b/tests/testthat/_snaps/mlclusteringhierarchical/all-predictors.new.svg new file mode 100644 index 00000000..655679df --- /dev/null +++ b/tests/testthat/_snaps/mlclusteringhierarchical/all-predictors.new.svg @@ -0,0 +1,456 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-3 +-2 +-1 +0 +1 +2 +3 +4 + + + + + + + + + +Alcohol +Malic +Ash +Alcalinity +Magnesium +Phenols +Flavanoids +Nonflavanoids +Proanthocyanins +Color +Hue +Dilution +Proline +Cluster Mean + + +Cluster + + + + + + + + + + + + + + +1 +2 +4 +5 +6 +7 +8 +all-predictors + + diff --git a/tests/testthat/_snaps/mlclusteringhierarchical/dendogram.new.svg b/tests/testthat/_snaps/mlclusteringhierarchical/dendogram.new.svg new file mode 100644 index 00000000..04115d17 --- /dev/null +++ b/tests/testthat/_snaps/mlclusteringhierarchical/dendogram.new.svg @@ -0,0 +1,745 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +x +dendogram + + diff --git a/tests/testthat/_snaps/mlclusteringkmeans/all-predictors-2.new.svg b/tests/testthat/_snaps/mlclusteringkmeans/all-predictors-2.new.svg new file mode 100644 index 00000000..d9271b15 --- /dev/null +++ b/tests/testthat/_snaps/mlclusteringkmeans/all-predictors-2.new.svg @@ -0,0 +1,395 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +-1 +0 +1 +2 + + + + + + +Alcohol +Malic +Ash +Alcalinity +Magnesium +Phenols +Flavanoids +Nonflavanoids +Proanthocyanins +Color +Hue +Dilution +Proline +Cluster Mean + + +Cluster + + + + + + + + + + + + +1 +2 +3 +4 +5 +6 +all-predictors-2 + + diff --git a/tests/testthat/_snaps/mlclusteringkmeans/all-predictors-3.new.svg b/tests/testthat/_snaps/mlclusteringkmeans/all-predictors-3.new.svg new file mode 100644 index 00000000..0e7ec666 --- /dev/null +++ b/tests/testthat/_snaps/mlclusteringkmeans/all-predictors-3.new.svg @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2.0 +-1.5 +-1.0 +-0.5 +0.0 +0.5 +1.0 +1.5 + + + + + + + + + +Alcohol +Malic +Ash +Alcalinity +Magnesium +Phenols +Flavanoids +Nonflavanoids +Proanthocyanins +Color +Hue +Dilution +Proline +Cluster Mean + + +Cluster + + + + + + + + + + +1 +2 +3 +4 +5 +all-predictors-3 + + diff --git a/tests/testthat/_snaps/mlclusteringkmeans/all-predictors.new.svg b/tests/testthat/_snaps/mlclusteringkmeans/all-predictors.new.svg new file mode 100644 index 00000000..1be56706 --- /dev/null +++ b/tests/testthat/_snaps/mlclusteringkmeans/all-predictors.new.svg @@ -0,0 +1,344 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +-1 +0 +1 +2 +3 +4 + + + + + + + + +Alcohol +Malic +Ash +Alcalinity +Magnesium +Phenols +Flavanoids +Nonflavanoids +Proanthocyanins +Color +Hue +Dilution +Proline +Cluster Mean + + +Cluster + + + + + + + + + + +1 +2 +3 +4 +5 +all-predictors + + diff --git a/tests/testthat/_snaps/mlclusteringmodelbased/all-predictors.new.svg b/tests/testthat/_snaps/mlclusteringmodelbased/all-predictors.new.svg new file mode 100644 index 00000000..efb20b5d --- /dev/null +++ b/tests/testthat/_snaps/mlclusteringmodelbased/all-predictors.new.svg @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-1.5 +-1.0 +-0.5 +0.0 +0.5 +1.0 +1.5 + + + + + + + + +Alcohol +Malic +Ash +Alcalinity +Magnesium +Phenols +Flavanoids +Nonflavanoids +Proanthocyanins +Color +Hue +Dilution +Proline +Cluster Mean + + +Cluster + + + + + + +1 +2 +3 +all-predictors + + diff --git a/tests/testthat/_snaps/mlclusteringrandomforest/all-predictors.new.svg b/tests/testthat/_snaps/mlclusteringrandomforest/all-predictors.new.svg new file mode 100644 index 00000000..b86a5421 --- /dev/null +++ b/tests/testthat/_snaps/mlclusteringrandomforest/all-predictors.new.svg @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-1.5 +-1.0 +-0.5 +0.0 +0.5 +1.0 +1.5 + + + + + + + + +Alcohol +Malic +Ash +Alcalinity +Magnesium +Phenols +Flavanoids +Nonflavanoids +Proanthocyanins +Color +Hue +Dilution +Proline +Cluster Mean + + +Cluster + + + + + + +1 +2 +3 +all-predictors + + diff --git a/tests/testthat/_snaps/mlregressionboosting/data-split.new.svg b/tests/testthat/_snaps/mlregressionboosting/data-split.new.svg new file mode 100644 index 00000000..689c5b50 --- /dev/null +++ b/tests/testthat/_snaps/mlregressionboosting/data-split.new.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + +Train: 114 +Validation: 29 +Test: 35 +Total: 178 + + + + + +data-split + + diff --git a/tests/testthat/_snaps/mlregressionboosting/relative-influence-plot.new.svg b/tests/testthat/_snaps/mlregressionboosting/relative-influence-plot.new.svg new file mode 100644 index 00000000..53e8d6e5 --- /dev/null +++ b/tests/testthat/_snaps/mlregressionboosting/relative-influence-plot.new.svg @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Ash +Dilution +Magnesium +Nonflavanoids +Alcalinity +Malic +Proanthocyanins +Hue +Flavanoids +Phenols +Proline +Color + + + + + + + + + +0 +10 +20 +30 +40 +50 +60 +70 +Relative Influence +relative-influence-plot + + diff --git a/tests/testthat/_snaps/mlregressiondecisiontree/data-split.new.svg b/tests/testthat/_snaps/mlregressiondecisiontree/data-split.new.svg new file mode 100644 index 00000000..b254084a --- /dev/null +++ b/tests/testthat/_snaps/mlregressiondecisiontree/data-split.new.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + +Train: 96 +Validation: 24 +Test: 30 +Total: 150 + + + + + +data-split + + diff --git a/tests/testthat/_snaps/mlregressiondecisiontree/decision-tree-plot.new.svg b/tests/testthat/_snaps/mlregressiondecisiontree/decision-tree-plot.new.svg new file mode 100644 index 00000000..ca57122f --- /dev/null +++ b/tests/testthat/_snaps/mlregressiondecisiontree/decision-tree-plot.new.svg @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +< + 0.449 + +< + -0.203 + +< + 0.442 + + + 0.442 + + + -0.203 + +< + -0.705 + + + -0.705 + + + 0.449 + +< + 1.3 + +< + 1.12 + + + 0.46 + +< + 0.46 + + + 1.12 + + + 1.3 + +Petal.Length +n = 96 + +Petal.Length +n = 54 + +Sepal.Width +n = 33 + +4.73 +n = 17 + +5.19 +n = 16 + +Sepal.Width +n = 21 + +5.57 +n = 12 + +5.92 +n = 9 + +Petal.Length +n = 42 + +Petal.Width +n = 34 + +Petal.Width +n = 23 + +6.19 +n = 16 + +6.66 +n = 7 + +6.60 +n = 11 + +7.58 +n = 8 + +4.73 +n = 17 + +5.19 +n = 16 + +5.57 +n = 12 + +5.92 +n = 9 + +6.19 +n = 16 + +6.66 +n = 7 + +6.60 +n = 11 + +7.58 +n = 8 + + + + + +decision-tree-plot + + diff --git a/tests/testthat/_snaps/mlregressionknn/data-split.new.svg b/tests/testthat/_snaps/mlregressionknn/data-split.new.svg new file mode 100644 index 00000000..689c5b50 --- /dev/null +++ b/tests/testthat/_snaps/mlregressionknn/data-split.new.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + +Train: 114 +Validation: 29 +Test: 35 +Total: 178 + + + + + +data-split + + diff --git a/tests/testthat/_snaps/mlregressionlinear/data-split.new.svg b/tests/testthat/_snaps/mlregressionlinear/data-split.new.svg new file mode 100644 index 00000000..fa95a138 --- /dev/null +++ b/tests/testthat/_snaps/mlregressionlinear/data-split.new.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + +Train: 120 +Test: 30 +Total: 150 + + + + + +data-split + + diff --git a/tests/testthat/_snaps/mlregressionrandomforest/data-split.new.svg b/tests/testthat/_snaps/mlregressionrandomforest/data-split.new.svg new file mode 100644 index 00000000..689c5b50 --- /dev/null +++ b/tests/testthat/_snaps/mlregressionrandomforest/data-split.new.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + +Train: 114 +Validation: 29 +Test: 35 +Total: 178 + + + + + +data-split + + diff --git a/tests/testthat/_snaps/mlregressionrandomforest/mean-decrease-in-accuracy.new.svg b/tests/testthat/_snaps/mlregressionrandomforest/mean-decrease-in-accuracy.new.svg new file mode 100644 index 00000000..997ef645 --- /dev/null +++ b/tests/testthat/_snaps/mlregressionrandomforest/mean-decrease-in-accuracy.new.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Nonflavanoids +Magnesium +Proanthocyanins +Dilution +Ash +Alcalinity +Hue +Phenols +Malic +Flavanoids +Proline +Color + + + + + + + + + + +-0.05 +0.00 +0.05 +0.10 +0.15 +0.20 +0.25 +0.30 +0.35 +Mean Decrease in Accuracy +mean-decrease-in-accuracy + + diff --git a/tests/testthat/_snaps/mlregressionrandomforest/total-increase-in-node-purity.new.svg b/tests/testthat/_snaps/mlregressionrandomforest/total-increase-in-node-purity.new.svg new file mode 100644 index 00000000..f981e064 --- /dev/null +++ b/tests/testthat/_snaps/mlregressionrandomforest/total-increase-in-node-purity.new.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Nonflavanoids +Proanthocyanins +Magnesium +Ash +Dilution +Hue +Malic +Alcalinity +Proline +Phenols +Flavanoids +Color + + + + + + +0 +2 +4 +6 +8 +Total Increase in Node Purity +total-increase-in-node-purity + + diff --git a/tests/testthat/_snaps/mlregressionregularized/data-split.new.svg b/tests/testthat/_snaps/mlregressionregularized/data-split.new.svg new file mode 100644 index 00000000..689c5b50 --- /dev/null +++ b/tests/testthat/_snaps/mlregressionregularized/data-split.new.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + +Train: 114 +Validation: 29 +Test: 35 +Total: 178 + + + + + +data-split + + diff --git a/tests/testthat/_snaps/mlregressionsvm/data-split.new.svg b/tests/testthat/_snaps/mlregressionsvm/data-split.new.svg new file mode 100644 index 00000000..b254084a --- /dev/null +++ b/tests/testthat/_snaps/mlregressionsvm/data-split.new.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + +Train: 96 +Validation: 24 +Test: 30 +Total: 150 + + + + + +data-split + +