Log transformation and trees
A log transform compresses large positive differences while keeping the order. In this course, log1p(x) means ln(1+x) for nonnegative counts.
For nonnegative counts, log1p(x)=ln(1+x): 0 becomes 0, 9 becomes about 2.303 and 99 about 4.605. The +1 permits zero. The transformation preserves order, compresses large gaps, and changes differences, ratios and units. It does not automatically make a variable normal or repair invalid records.
An ordinary threshold decision tree uses order rather than Euclidean distance. The rule score<75 becomes z<0 under the saved score scale, with identical decisions: 70 Stay, 80 Withdraw, 79 Withdraw. Thus scaling is often unnecessary for ordinary numerical tree splits. This is not a claim that every model or implementation behaves identically under every transformation.
Choose transformation based on the question, feature meaning and model. Standardisation uses training spread; min-max uses training endpoints; log compresses a long numerical tail. Preserve original measurements and the reason for transformation.
Sources: W4 PDF pp. 2-42; L4 Tasks 1-7. All fixed worked values here were recalculated from the supplied examples. These toy rules are teaching devices, not deployable student-support recommendations.
Practice problems
Supplementary study questions on the lecture concepts — not verbatim exam questions. Each answer counts toward spaced review.
1. Conceptual understanding
Definitions and distinctions.
What is log1p(0)?
What does log1p do for nonnegative counts?
2. Application
Apply the concept to a case or calculation.
What is log1p(9), approximately?
For nonnegative counts 9<99, what happens after log1p?
3. Interpretation and limitations
Evaluate assumptions and justify conclusions.
Does a log transform guarantee a normal distribution?
Why can monotone scaling preserve a threshold tree's split?
Explain it in writing
Self-checked, not marked. Write a few sentences, then compare with the example answer. Your writing is saved as you type.
Show an example answer
The added one makes zero map to ln(1)=0. Ordinary ln(0) is undefined. The transformation still needs to match the variable and task.
Check: did you answer the question, use evidence or working, and avoid claiming more than the evidence supports?
Show an example answer
A tree uses ordered comparisons with cutoffs. A monotone rescaling can move the cutoffs while preserving the same split. Euclidean distance directly depends on numerical gaps.
Check: did you answer the question, use evidence or working, and avoid claiming more than the evidence supports?