Invert/reserve/undo a recipe

Hello everyone,
is there a possibility to invert/undo a recipe? For example, I apply a recipe which scales and center my input data and then I fit the model. Then, I would like to reproject the modelled output to the original input space, normally I would do this using scaled:center and scaled:scale from the scale function.
Is there any function to do this?

Thanks for the help in advance!

No. There might be in the future but it wouldn't really solve your problem.

The original data goes into the recipe before processing. Why not just use that? Those data are what you are trying to reproduce?

1 Like

I would like to apply the reversed recipe on new data coming from the model, in other words, I would like to use the model to predict new data and then reproject this data on the original training data space.

Not to be argumentative, but if you have the original data to make predictions, why would you need to back-transform the processed data?

Because I want to pre-process a model output generated from new data.
I have two datasets: training (inputs and outputs) and testing (only inputs). I want to use the model, trained on the former, to generate the predictions with the latter and THEN reproject this testing output in the original space of the training data.

So you want to backtransform the prediction of the model?

Exactly! That's the right term!

We plan on adding a post-processing component to workflows that can reverse outcome transformation. Generally, we suggest doing them outside of a recipe since the outcome data are not guaranteed to be present when bake(x, new_data = NULL) is used.

1 Like

Yes, I understand. Thanks for the answer!

For any outcome transformation, we plan on adding post-processing tools to workflows so that the outcome predictions can be converted into the original units. I'm hoping to get to that later in the year.

I don't think that we'll make tools for reversing the non-outcome values (for the reasons listed above).


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.