diff --git a/R/LearnerClasssifRpart.R b/R/LearnerClasssifRpart.R index 5424e02a..8fa68029 100644 --- a/R/LearnerClasssifRpart.R +++ b/R/LearnerClasssifRpart.R @@ -40,5 +40,5 @@ autoplot.LearnerClassifRpart = function(object, ...) { # nolint require_namespaces(c("partykit", "ggparty")) autoplot(partykit::as.party(object$model), ...) + - ggparty::geom_node_label(aes(label = paste0("n=", nodesize)), nudge_y = 0.03, ids = "terminal") + ggparty::geom_node_label(aes(label = paste0("n=", .data[["nodesize"]])), nudge_y = 0.03, ids = "terminal") } diff --git a/R/LearnerRegrRpart.R b/R/LearnerRegrRpart.R index 48b03417..af7d19b0 100644 --- a/R/LearnerRegrRpart.R +++ b/R/LearnerRegrRpart.R @@ -16,5 +16,5 @@ autoplot.LearnerRegrRpart = function(object, ...) { # nolint coord_flip(), theme(axis.ticks.x = element_blank(), axis.text.x = element_blank()) )) + - ggparty::geom_node_label(aes(label = paste0("n=", nodesize)), nudge_y = 0.03, ids = "terminal") + ggparty::geom_node_label(aes(label = paste0("n=", .data[["nodesize"]])), nudge_y = 0.03, ids = "terminal") } diff --git a/R/as_precrec.R b/R/as_precrec.R index 232f7103..9033310c 100644 --- a/R/as_precrec.R +++ b/R/as_precrec.R @@ -14,7 +14,7 @@ as_precrec = function(object) { roc_data = function(prediction) { - prediction = as_prediction(prediction) + prediction = mlr3::as_prediction(prediction) if (nlevels(prediction$truth) != 2L) { stopf("Need a binary classification problem to plot a ROC curve") } diff --git a/man/autoplot.LearnerClassifRpart.Rd b/man/autoplot.LearnerClassifRpart.Rd index 5fa1d993..80065ab8 100644 --- a/man/autoplot.LearnerClassifRpart.Rd +++ b/man/autoplot.LearnerClassifRpart.Rd @@ -10,7 +10,7 @@ \method{autoplot}{LearnerRegrRpart}(object, ...) } \arguments{ -\item{object}{(\link[mlr3:LearnerClassifRpart]{mlr3::LearnerClassifRpart} | \link[mlr3:LearnerRegrRpart]{mlr3::LearnerRegrRpart}).} +\item{object}{(\link[mlr3:mlr_learners_classif.rpart]{mlr3::LearnerClassifRpart} | \link[mlr3:mlr_learners_regr.rpart]{mlr3::LearnerRegrRpart}).} \item{...}{(\code{any}): Additional arguments, passed down to \code{\link[ggparty:autoplot.party]{ggparty::autoplot.party()}}.}