How can I get the inverse of a transformation applied on dataset in ml studio designer

Dharshanee Moodley 0 Reputation points
2024-09-05T13:50:12.66+00:00

Hi everyone,
I am creating a ML pipeline in Azure ML Studio Designer. I'm having an issue where I need to perform data normalisation at one point in my pipeline and I need to then reverse that transformation later in my pipeline.
Is there a way for me to reverse this transformation through the designer, or get access to the parameters used in the transformation so I can apply the inverse manually in a python notebook?

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,835 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 22,616 Reputation points
    2024-09-06T17:32:17.61+00:00

    When you apply a transformation (e.g., normalization), the transformation parameters (such as the mean and standard deviation for normalization) are crucial for reversing the transformation.

    Use a custom Python script within your pipeline to access and store these parameters after applying the transformation. The same parameters can later be used to reverse the normalization.

    In the later stages of your pipeline, you can create a Python notebook step where you apply the inverse of the transformation.

    For example, if you're using Min-Max Normalization, you would reverse it using the formula:

    original value=normalized value×(max−min)+min

    Similarly, for Z-score normalization, use:

    original value=(normalized value×standard deviation)+mean

    # Example for reversing z-score normalization
    def inverse_normalization(normalized_data, mean, std_dev):
        return (normalized_data * std_dev) + mean
    
    # Apply inverse to the dataset
    original_data = inverse_normalization(normalized_dataset, mean_value, std_dev_value)
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.