Relative Difference Processor
The Relative Difference Processor expresses a numeric variable as a relative difference to the sum of reference variables. This is useful for preserving mathematical relationships between correlated variables.
Description
This processor is designed for scenarios where one variable represents a proportion or share of a total. For example:
minutes_in_game = f(minutes_played_home + minutes_played_away + minutes_on_bench)income_per_category = f(total_income)
Instead of treating minutes_in_game as an independent variable, this processor expresses it as:
minutes_in_game_ratio = minutes_in_game / (minutes_played_home + minutes_played_away + minutes_on_bench)
Use case: Preserve the mathematical/logical relationships in your data during avatarization. The ratio is maintained in avatars, ensuring consistency.
Concrete example
Imagine a sports dataset:
player_id | minutes_played_home | minutes_played_away | minutes_on_bench | minutes_in_game
1 | 1500 | 800 | 200 | 2300
2 | 1200 | 1000 | 100 | 2200
3 | 900 | 1100 | 250 | 2150
The minutes_in_game is the sum of the three reference variables. Without the processor, these relationships might not be preserved during avatarization.
After applying Relative Difference Processor:
During preprocessing:
minutes_in_game_ratio = minutes_in_game / (minutes_played_home + minutes_played_away + minutes_on_bench)
player_id | ratio
1 | 2300 / 2500 = 0.92
2 | 2200 / 2300 = 0.956
3 | 2150 / 2250 = 0.955
The ratio is avatarized, then reversed during post-processing:
During post-processing:
minutes_in_game_avatar = ratio_avatar × (sum of reference variables in avatar)
This ensures the mathematical relationship is preserved in the final avatars.
How to Use it in Web
In the web interface, the processor is not available yet. You can either use the Python API or process your data on your own before uploading it to the web interface.
How to use it in python
Please refer to the Python documentation for usage details.