Data transformation formulas
Data types and data transformation: normalisation, discretisation, sampling and compression. 14 formulas for GATE DA Database Management and Warehousing, each with when to use it. Each is explained in the topic notes.
IAE Academy: Data types and data transformation: normalisation, discretisation, sampling and compression formulas (GATE DA)
All 14 Data transformation formulas
MIN-MAX NORMALISATION TO [NEW_MIN, NEW_MAX]
Linear map of the observed range onto the target range; for [0,1] it reduces to (v - min)/(max - min). Preserves the shape of the distribution and the order of values. Undefined when max = min (all values equal).
Z-SCORE NORMALISATION
Result has mean 0 and standard deviation 1 (under the same convention for sigma). Convention: use the population standard deviation (divide by n) unless the question says sample (divide by n - 1). Not bounded to a fixed range; undefined when sigma = 0. A variant divides by the mean absolute deviation s = (1/n) times the sum of |v - mean| instead of sigma; it is less affected by outliers because deviations are not squared.
DECIMAL SCALING
Moves the decimal point; j is fixed by the value of largest absolute magnitude. Result lies strictly inside (-1, 1). Examples: max|v| = 986 gives j = 3; max|v| = 1000 gives j = 4.
EQUAL-WIDTH BINNING
Bins have the same width and usually unequal counts. Convention here: left-closed, right-open, with the last bin closed so the maximum belongs to it.
EQUAL-FREQUENCY (EQUAL-DEPTH) BINNING
Sort the data and put n/k consecutive values in each bin; widths differ. If k does not divide n, bin sizes are floor(n/k) or ceil(n/k) and the question must say which bins take the extra values. Tied values may need to share a bin.
ENTROPY-BASED (SUPERVISED) SPLIT
D_1 and D_2 are the tuples with attribute value at most, and above, the candidate split point T; p_i is the fraction of a set in class i. Choose the T that minimises Info_T(D), which is the same as maximising the information gain Entropy(D) - Info_T(D). Apply recursively to each part until a stopping rule is met.
INCLUSION PROBABILITY, SRSWOR
Sample of n distinct tuples from N, all subsets equally likely.
INCLUSION PROBABILITY, SRSWR
n independent draws, each tuple chosen with probability 1/N per draw; N^n ordered outcomes.
EXPECTED NUMBER OF DISTINCT TUPLES, SRSWR
By linearity of expectation over the N tuples. The limit is the bootstrap fact: a with-replacement sample of size N contains about 63.2% of the distinct tuples, and about 36.8% never appear.
PROPORTIONAL ALLOCATION IN STRATIFIED SAMPLING
Stratum h of size N_h receives a share of the total sample n in proportion to its size; round so that the n_h sum to n.
SYSTEMATIC SAMPLING
When N = nk exactly, every tuple has inclusion probability 1/k = n/N, but only k distinct samples are possible.
COMPRESSION RATIO
A ratio above 1 means the data shrank. Space saving = 1 - compressed/original.
FIXED-LENGTH CODE SIZE
For an alphabet of m >= 2 distinct symbols. A Huffman code never needs more bits per symbol on average than this, and needs fewer for some unequal frequency distributions (not all: probabilities 0.3, 0.3, 0.2, 0.2 give Huffman lengths 2, 2, 2, 2).
AVERAGE CODE LENGTH AND THE ENTROPY BOUND
p_i is the probability (relative frequency) of symbol i and l_i its code length in bits. No lossless symbol-by-symbol prefix code averages below H; Huffman's code is optimal among them and reaches H exactly when every p_i is a power of 1/2.
Where this was asked: 2024 (1). See the 1 previous-year question on Data transformation. This shows what was asked, not what will be asked.