Skip to content

Commit

Permalink
Still output the results when K = 1
Browse files Browse the repository at this point in the history
  • Loading branch information
statwangz committed Oct 16, 2023
1 parent 2b4506f commit 76eacb0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions R/mfairBackfitting.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 76eacb0

Please sign in to comment.