Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

train vs fit #20

Open
simonpcouch opened this issue Jun 3, 2024 · 2 comments
Open

train vs fit #20

simonpcouch opened this issue Jun 3, 2024 · 2 comments

Comments

@simonpcouch
Copy link
Contributor

simonpcouch commented Jun 3, 2024

The method to fit a tailor is called fit() and a new helper function calls that operation fitting:

tailor/R/utils.R

Lines 76 to 81 in e98131d

#' @export
#' @keywords internal
#' @rdname tailor-internals
tailor_requires_fit <- function(x) {
any(purrr::map_lgl(x$operations, tailor_operation_requires_fit))
}

At the same time, some other functionality (printing, the slot $trained, the following helper) uses train:

tailor/R/utils.R

Lines 64 to 70 in e98131d

tailor_fully_trained <- function(x) {
if (length(x$operations) == 0L) {
return(FALSE)
}
all(purrr::map_lgl(x$operations, tailor_operation_trained))
}

train follows the precedent of recipes::fully_trained(), print methods elsewhere, etc. I'm not sure if this might be a point of confusion for users.

@topepo
Copy link
Member

topepo commented Jun 3, 2024

I'm wondering if we should differentiate between "trained", "untrained", and "n/a". The last case is things like probability thresholding that don't estimate anything.

@simonpcouch
Copy link
Contributor Author

The requires_fit slot can help us tell which operations don't estimate anything!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants