Inter-Record Range Difference Processor
The Inter-Record Range Difference Processor (also called Range Difference Processor) transforms pairs of start/end columns into an internal representation that preserves their relationships. This is useful for temporal data, date ranges, and ordered pairs.
Description
This processor handles data where pairs of variables represent a range or interval:
- Start/end dates:
start_dateandend_date - Start/end times:
start_timeandend_time - Lower/upper bounds:
min_valueandmax_value
The processor transforms these pairs into an internal representation that:
- Preserves the temporal or logical order (start < end)
- Maintains the distance between the two values
- Allows avatarization while keeping the structure intact
- Automatically sorts by the start variable
Use case: When your data contains time periods, events with duration, or ordered pairs that must maintain their relative ordering.
Concrete example
Consider a dataset with event data:
person_id | event_name | start_date | end_date
1 | vacation | 2024-01-15 | 2024-01-22
2 | project | 2024-02-01 | 2024-03-15
3 | conference | 2024-03-20 | 2024-03-25
Problem without processor: During avatarization, start_date and end_date might be transformed independently, potentially creating impossible dates like end_date < start_date.
After applying Inter-Record Range Difference Processor:
Preprocessing step:
- Records the original start_date values for each person_id
- Calculates the duration: end_date - start_date
- Sorts by start_date internally
During avatarization:
- Dates are anonymized as a single unit (start_date and duration are preserved together)
Post-processing step:
- Reconstructs end_date = avatarized_start_date + original_duration
- Ensures end_date > start_date always holds
Result: Avatars maintain valid date ranges with preserved temporal logic.
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.
Key Points
- Order matters: Processors are applied in the order specified. If combining multiple processors, the start/end processor should typically be applied before others that modify time-based columns.
- Multiple ranges: You can apply this processor to multiple start/end pairs by creating separate processor instances.
- Non-date ranges: The processor also works with numeric ranges (e.g.,
min_scoreandmax_score), as long as the start < end relationship is logical.