From 76eacb0e57a36d8f64298b6824a9ffaeeb767a50 Mon Sep 17 00:00:00 2001 From: WANG Zhiwei <48282751+statwangz@users.noreply.github.com> Date: Mon, 16 Oct 2023 17:08:47 +0800 Subject: [PATCH] Still output the results when K = 1 --- R/mfairBackfitting.R | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/R/mfairBackfitting.R b/R/mfairBackfitting.R index af690f0..63b3b32 100644 --- a/R/mfairBackfitting.R +++ b/R/mfairBackfitting.R @@ -28,8 +28,9 @@ fitBack <- function(object, sf_para = list()) { # Check K if (object@K == 1) { - stop("The backfitting algorithm is equivalent to the greedy algorithm - when rank K = 1!") + warning("The backfitting algorithm is equivalent to the greedy algorithm + when rank K = 1!\n") + return(object) } # End # Check fitted functions F(), i.e., tree_0 and tree_lists @@ -38,7 +39,7 @@ fitBack <- function(object, warning("The previous tree_0 (i.e., fitted functions) may not be saved!\n") warning("The new tree_lists obtained after the backfitting algorithm may not accurately predict the new sample - with auxiliary covariates.!\n") + with auxiliary covariates!\n") } if (length(object@tree_lists) == 0) { object@tree_lists <- lapply(1:object@K,