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

loopify step_classdist() #1183

Merged
merged 2 commits into from
Aug 2, 2023
Merged

loopify step_classdist() #1183

merged 2 commits into from
Aug 2, 2023

Conversation

EmilHvitfeldt
Copy link
Member

Related to #1156.

This PR does a small refactor to step_classdist() to bring them up to the same standard as #1156.

@EmilHvitfeldt EmilHvitfeldt mentioned this pull request Aug 2, 2023
12 tasks
Copy link
Contributor

@simonpcouch simonpcouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Groovy!

R/classdist.R Outdated Show resolved Hide resolved
@@ -230,34 +230,40 @@ mah_pooled <- function(means, x, cov_mat) {

#' @export
bake.step_classdist <- function(object, new_data, ...) {
if (length(object$objects[[1]]$center) == 0) {
col_names <- names(object$objects[[1]][[1]])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Transitioning to selection by position has me a little 🤨 but this looks safe.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this wasn't ideal, but it is because the information is in two different places depending on pool. But it just happens to be that names(object$objects[[1]][[1]]) captures both places 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, the positioning is just "first"

Co-authored-by: Simon P. Couch <[email protected]>
@EmilHvitfeldt EmilHvitfeldt merged commit d774ebc into main Aug 2, 2023
9 checks passed
@EmilHvitfeldt EmilHvitfeldt deleted the loopify-classdist branch August 2, 2023 22:30
@github-actions
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants