Skip to content

Commit 10d52af

Browse files
committed
Ensuring process_y can read tibbles
1 parent a206d80 commit 10d52af

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

R/utils.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ process_x <- function(x) {
220220
#' @importFrom keras3 to_categorical
221221
#' @noRd
222222
process_y <- function(y, is_classification = NULL, class_levels = NULL) {
223+
# If y is a data frame/tibble, extract the first column
224+
if (is.data.frame(y)) {
225+
y <- y[[1]]
226+
}
227+
223228
if (is.null(is_classification)) {
224229
is_classification <- is.factor(y)
225230
}

0 commit comments

Comments
 (0)