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

pipeop$predict_newdata() functionality #731

Open
mermast opened this issue Aug 23, 2023 · 0 comments
Open

pipeop$predict_newdata() functionality #731

mermast opened this issue Aug 23, 2023 · 0 comments

Comments

@mermast
Copy link

mermast commented Aug 23, 2023

Is there a way to transform a new data as per pipeline trained on a given task. For example:-

ames = mlr3data::ames_housing
ames1 = ames[1:2000,]
ames2 = ames[2001:nrow(ames),-c('Sale_Price')]
to_remove = c("Lot_Area_m2", "Condition_3", "Misc_Feature_2")
tsk_ames = as_task_regr(ames1, target = "Sale_Price", id = "ames")
# remove problematic features
tsk_ames$select(setdiff(tsk_ames$feature_names, to_remove))
po_encod = po("encode")
# to get the transformed data
po_encod$train(list(tsk_ames))[[1]]$data()
# this will through an error stating only tasks objects are allowed as input.
po_encod$predict(ames2)
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

1 participant