Computes and extracts conditional fractions from a contingency table for use during attribute assignment.
Arguments
- object
A
ReplicaAdderobject.- dt
A contingency table containing the target attribute and a
countcolumn.
Value
A data frame or data.table containing:
The target attribute.
Any relevant margin variables.
A
fractioncolumn.
Details
The function converts contingency-table counts into
conditional probabilities using
calculate_fractions and returns the resulting
fractions indexed by the target attribute and any relevant
margin variables.
This function is used internally by
enhance during conditional attribute assignment.
Fractions are calculated separately within each conditioning group.
The result is subsequently used by:
If margin constraints have been supplied using
renew, the returned table will also
include the corresponding margin variables.
The function automatically removes duplicate index names when margins overlap with the target attribute.
