Replies: 4 comments
-
Hey @lwq-star! I'm here to assist you with any bugs, questions, or contributions you have. Let's tackle this issue together! To convert the predicted values obtained from a regression model in PyTorch Tabular back to the original scale, you can use the if self.datamodule.do_target_transform:
for i, target_col in enumerate(self.config.target):
pred_df[f"{target_col}_prediction"] = self.datamodule.target_transforms[i].inverse_transform(
point_predictions[:, i].reshape(-1, 1)
) This code snippet shows how the inverse transformation is applied to the predicted values to convert them back to the original scale. The |
Beta Was this translation helpful? Give feedback.
-
Wrong demonstration ! |
Beta Was this translation helpful? Give feedback.
-
@lwq-star If you can be a bit more clear on what you are trying to acheive, i can try to help out. PyTorch Tabular applies necessary transformations on the input data automatically.. the trained trandformers are saved in What dosu bot shared is for target transformation.. similarly for continuous variable scaling there is another transformer in the data module. |
Beta Was this translation helpful? Give feedback.
-
moving this to discussions |
Beta Was this translation helpful? Give feedback.
-
PyTorch Tabular has the following functions : Continuous features are scaled automatically using StandardScaler and target transformation can be enabled with a parameter. This will also handle the inverse tranformation automatically.
But how can I to convert the predicted values obtained after the original data is input into the model for regression model into the original scale?
scikit-learn have power.inverse_transform and scaler.inverse_transform functions to get original scale but PyTorch Tabular?
This is my code for data preprocessing:
Beta Was this translation helpful? Give feedback.
All reactions