From 5a51750161f7bfabedbb894ffeb4887ec40b717e Mon Sep 17 00:00:00 2001 From: "Steven Paul Sanderson II, MPH" Date: Wed, 24 Jan 2024 21:57:15 -0500 Subject: [PATCH] Fixes #222 --- NEWS.md | 3 +++ R/make-classification-fast.R | 1 + R/make-regression-fast.R | 1 + 3 files changed, 5 insertions(+) diff --git a/NEWS.md b/NEWS.md index df920f7..ac018be 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,9 +5,12 @@ None ## New Features 1. Fix #217 - Add plotting function for `extract_regression_residuals()` +2. Fix #215 - Add plotting function for `extract_wflw_predictions()` ## Minor Fixes and Improvements 1. Fix #214 - Drop selection message from `load_deps()` +2. Fix #222 - Update `fast_regression()` and `fast_classification()` to drop NULL +predictions. # tidyAML 0.0.4 diff --git a/R/make-classification-fast.R b/R/make-classification-fast.R index cb79e36..88e07c2 100644 --- a/R/make-classification-fast.R +++ b/R/make-classification-fast.R @@ -101,6 +101,7 @@ fast_classification <- function(.data, .rec_obj, .parsnip_fns = "all", if (.drop_na){ mod_pred_tbl <- mod_pred_tbl[!sapply(mod_pred_tbl$fitted_wflw, function(x) length(x) == 0), ] + mod_pred_tbl <- mod_pred_tbl[!sapply(mod_pred_tbl$pred_wflw, function(x) length(x) == 0), ] } # Return ---- diff --git a/R/make-regression-fast.R b/R/make-regression-fast.R index f23dbc8..18ad31c 100644 --- a/R/make-regression-fast.R +++ b/R/make-regression-fast.R @@ -92,6 +92,7 @@ fast_regression <- function(.data, .rec_obj, .parsnip_fns = "all", if (.drop_na){ mod_pred_tbl <- mod_pred_tbl[!sapply(mod_pred_tbl$fitted_wflw, function(x) length(x) == 0), ] + mod_pred_tbl <- mod_pred_tbl[!sapply(mod_pred_tbl$pred_wflw, function(x) length(x) == 0), ] } # Return ----