Skip to main content

Unit 4: Decision Trees & Ensemble Learning

Course - Machine Learning Algorithms (21CSC555J)
Assessment - Continuous Test 2 (CT-2)
Unit - Unit 4: Decision Trees (CART) & Ensemble Learning (AdaBoost)
Total Weightage - 40 Marks (Question 3: 20 Marks; Question 4: 20 Marks)


Question 3: CART Classification Tree Construction (20 Marks)​

info

Question Statement

A retail company wants to build a CART classification tree to decide whether a customer will Buy (Yes) or Not Buy (No) a product based on two attributes: Age Group and Annual Income Level.

The training dataset is as follows:

CustomerAge GroupIncome LevelBuy
C1YoungLowNo
C2YoungMediumNo
C3MiddleLowYes
C4MiddleHighYes
C5SeniorMediumYes
C6SeniorHighYes
C7SeniorLowNo
  • (a) Calculate the Gini Index for the parent node (root) before any split. (4 Marks)
  • (b) Compute the Gini Index for each possible split based on: (8 Marks)
    • Age Group
    • Income Level
  • (c) Determine the Best Attribute to Split using Gini Index criterion. (4 Marks)
  • (d) Explain what would happen if both attributes had the same Gini value. (2 Marks)
  • (e) Mention two advantages of CART over ID3 or C4.5 decision trees. (2 Marks)

Solution 3​

πŸ“ Exam-Ready Answer (Structured for 20 Marks)​


(a) Gini Index for the Parent Node (Root) (4 Marks)​
  1. Step 1: Class Frequency Distribution at Root Node (1 Mark)

    • Total number of customer instances (NN): N=7N = 7
    • Number of instances with Buy=Yes\text{Buy} = \text{Yes}: NYes=4N_{\text{Yes}} = 4 (Customers: C3, C4, C5, C6)
    • Number of instances with Buy=No\text{Buy} = \text{No}: NNo=3N_{\text{No}} = 3 (Customers: C1, C2, C7)
  2. Step 2: Class Probabilities at Root (1 Mark) P(Buy=Yes)=p1=47P(\text{Buy} = \text{Yes}) = p_1 = \frac{4}{7} P(Buy=No)=p2=37P(\text{Buy} = \text{No}) = p_2 = \frac{3}{7}

  3. Step 3: State the Gini Index Formula (1 Mark) Gini(D)=1βˆ’βˆ‘i=1Cpi2=1βˆ’(p12+p22)\text{Gini}(D) = 1 - \sum_{i=1}^C p_i^2 = 1 - \left( p_1^2 + p_2^2 \right)

  4. Step 4: Substitution and Calculation (1 Mark) Gini(Root)=1βˆ’[(47)2+(37)2]=1βˆ’[1649+949]\text{Gini}(\text{Root}) = 1 - \left[ \left(\frac{4}{7}\right)^2 + \left(\frac{3}{7}\right)^2 \right] = 1 - \left[ \frac{16}{49} + \frac{9}{49} \right] Gini(Root)=1βˆ’2549=2449β‰ˆ0.4898(β‰ˆ0.490)\text{Gini}(\text{Root}) = 1 - \frac{25}{49} = \frac{24}{49} \approx \mathbf{0.4898} \quad (\approx 0.490)


(b) Compute Gini Index for Each Possible Split (8 Marks)​

In the Classification and Regression Trees (CART) methodology, trees are constructed strictly via binary splits. For an attribute with kk discrete categories, there are 2kβˆ’1βˆ’12^{k-1} - 1 unique binary partitions.


1. Candidate Binary Splits for Age Group (k=3k = 3: Young, Middle, Senior)​
  • Partition 1: {Young}\{\text{Young}\} vs {Middle,Β Senior}\{\text{Middle, Senior}\}

    • Left Node (DLD_L: Young, NL=2N_L = 2):
      • C1 (No), C2 (No) β€…β€ŠβŸΉβ€…β€ŠYes=0,No=2\implies \text{Yes} = 0, \text{No} = 2. Gini(DL)=1βˆ’[(02)2+(22)2]=1βˆ’1=0.0(PureΒ Node)\text{Gini}(D_L) = 1 - \left[ \left(\frac{0}{2}\right)^2 + \left(\frac{2}{2}\right)^2 \right] = 1 - 1 = \mathbf{0.0} \quad (\text{Pure Node})
    • Right Node (DRD_R: Middle + Senior, NR=5N_R = 5):
      • C3 (Yes), C4 (Yes), C5 (Yes), C6 (Yes), C7 (No) β€…β€ŠβŸΉβ€…β€ŠYes=4,No=1\implies \text{Yes} = 4, \text{No} = 1. Gini(DR)=1βˆ’[(45)2+(15)2]=1βˆ’(1625+125)=1βˆ’1725=825=0.320\text{Gini}(D_R) = 1 - \left[ \left(\frac{4}{5}\right)^2 + \left(\frac{1}{5}\right)^2 \right] = 1 - \left( \frac{16}{25} + \frac{1}{25} \right) = 1 - \frac{17}{25} = \frac{8}{25} = \mathbf{0.320}
    • Weighted Gini for Partition 1: Ginisplit({Young}Β vsΒ {Middle,Β Senior})=27(0.0)+57(0.320)=1.67β‰ˆ0.2286\text{Gini}_{\text{split}}(\{\text{Young}\} \text{ vs } \{\text{Middle, Senior}\}) = \frac{2}{7}(0.0) + \frac{5}{7}(0.320) = \frac{1.6}{7} \approx \mathbf{0.2286}
  • Partition 2: {Middle}\{\text{Middle}\} vs {Young,Β Senior}\{\text{Young, Senior}\}

    • Left Node (DLD_L: Middle, NL=2N_L = 2):
      • C3 (Yes), C4 (Yes) β€…β€ŠβŸΉβ€…β€ŠYes=2,No=0\implies \text{Yes} = 2, \text{No} = 0. Gini(DL)=1βˆ’[(22)2+0]=0.0(PureΒ Node)\text{Gini}(D_L) = 1 - \left[ \left(\frac{2}{2}\right)^2 + 0 \right] = \mathbf{0.0} \quad (\text{Pure Node})
    • Right Node (DRD_R: Young + Senior, NR=5N_R = 5):
      • C1 (No), C2 (No), C5 (Yes), C6 (Yes), C7 (No) β€…β€ŠβŸΉβ€…β€ŠYes=2,No=3\implies \text{Yes} = 2, \text{No} = 3. Gini(DR)=1βˆ’[(25)2+(35)2]=1βˆ’1325=1225=0.480\text{Gini}(D_R) = 1 - \left[ \left(\frac{2}{5}\right)^2 + \left(\frac{3}{5}\right)^2 \right] = 1 - \frac{13}{25} = \frac{12}{25} = \mathbf{0.480}
    • Weighted Gini for Partition 2: Ginisplit({Middle}Β vsΒ {Young,Β Senior})=27(0.0)+57(0.480)=2.47β‰ˆ0.3429\text{Gini}_{\text{split}}(\{\text{Middle}\} \text{ vs } \{\text{Young, Senior}\}) = \frac{2}{7}(0.0) + \frac{5}{7}(0.480) = \frac{2.4}{7} \approx \mathbf{0.3429}
  • Partition 3: {Senior}\{\text{Senior}\} vs {Young,Β Middle}\{\text{Young, Middle}\}

    • Left Node (DLD_L: Senior, NL=3N_L = 3):
      • C5 (Yes), C6 (Yes), C7 (No) β€…β€ŠβŸΉβ€…β€ŠYes=2,No=1\implies \text{Yes} = 2, \text{No} = 1. Gini(DL)=1βˆ’[(23)2+(13)2]=1βˆ’59=49β‰ˆ0.4444\text{Gini}(D_L) = 1 - \left[ \left(\frac{2}{3}\right)^2 + \left(\frac{1}{3}\right)^2 \right] = 1 - \frac{5}{9} = \frac{4}{9} \approx \mathbf{0.4444}
    • Right Node (DRD_R: Young + Middle, NR=4N_R = 4):
      • C1 (No), C2 (No), C3 (Yes), C4 (Yes) β€…β€ŠβŸΉβ€…β€ŠYes=2,No=2\implies \text{Yes} = 2, \text{No} = 2. Gini(DR)=1βˆ’[(24)2+(24)2]=1βˆ’0.500=0.500\text{Gini}(D_R) = 1 - \left[ \left(\frac{2}{4}\right)^2 + \left(\frac{2}{4}\right)^2 \right] = 1 - 0.500 = \mathbf{0.500}
    • Weighted Gini for Partition 3: Ginisplit({Senior}Β vsΒ {Young,Β Middle})=37(49)+47(0.500)=421+27=1021β‰ˆ0.4762\text{Gini}_{\text{split}}(\{\text{Senior}\} \text{ vs } \{\text{Young, Middle}\}) = \frac{3}{7}\left(\frac{4}{9}\right) + \frac{4}{7}(0.500) = \frac{4}{21} + \frac{2}{7} = \frac{10}{21} \approx \mathbf{0.4762}

BestΒ SplitΒ forΒ AgeΒ Group:Β {Young}Β vsΒ {Middle,Β Senior}β€…β€ŠβŸΉβ€…β€ŠGiniβ‰ˆ0.2286\mathbf{\text{Best Split for Age Group: } \{\text{Young}\} \text{ vs } \{\text{Middle, Senior}\} \implies \text{Gini} \approx 0.2286}


2. Candidate Binary Splits for Income Level (k=3k = 3: Low, Medium, High)​
  • Partition 1: {Low}\{\text{Low}\} vs {Medium,Β High}\{\text{Medium, High}\}

    • Left Node (DLD_L: Low, NL=3N_L = 3):
      • C1 (No), C3 (Yes), C7 (No) β€…β€ŠβŸΉβ€…β€ŠYes=1,No=2\implies \text{Yes} = 1, \text{No} = 2. Gini(DL)=1βˆ’[(13)2+(23)2]=1βˆ’59=49β‰ˆ0.4444\text{Gini}(D_L) = 1 - \left[ \left(\frac{1}{3}\right)^2 + \left(\frac{2}{3}\right)^2 \right] = 1 - \frac{5}{9} = \frac{4}{9} \approx \mathbf{0.4444}
    • Right Node (DRD_R: Medium + High, NR=4N_R = 4):
      • C2 (No), C4 (Yes), C5 (Yes), C6 (Yes) β€…β€ŠβŸΉβ€…β€ŠYes=3,No=1\implies \text{Yes} = 3, \text{No} = 1. Gini(DR)=1βˆ’[(34)2+(14)2]=1βˆ’1016=616=0.375\text{Gini}(D_R) = 1 - \left[ \left(\frac{3}{4}\right)^2 + \left(\frac{1}{4}\right)^2 \right] = 1 - \frac{10}{16} = \frac{6}{16} = \mathbf{0.375}
    • Weighted Gini for Partition 1: Ginisplit({Low}Β vsΒ {Medium,Β High})=37(49)+47(0.375)=421+1.57=4+4.521=8.521β‰ˆ0.4048\text{Gini}_{\text{split}}(\{\text{Low}\} \text{ vs } \{\text{Medium, High}\}) = \frac{3}{7}\left(\frac{4}{9}\right) + \frac{4}{7}(0.375) = \frac{4}{21} + \frac{1.5}{7} = \frac{4 + 4.5}{21} = \frac{8.5}{21} \approx \mathbf{0.4048}
  • Partition 2: {Medium}\{\text{Medium}\} vs {Low,Β High}\{\text{Low, High}\}

    • Left Node (DLD_L: Medium, NL=2N_L = 2):
      • C2 (No), C5 (Yes) β€…β€ŠβŸΉβ€…β€ŠYes=1,No=1\implies \text{Yes} = 1, \text{No} = 1. Gini(DL)=1βˆ’[(12)2+(12)2]=1βˆ’0.500=0.500\text{Gini}(D_L) = 1 - \left[ \left(\frac{1}{2}\right)^2 + \left(\frac{1}{2}\right)^2 \right] = 1 - 0.500 = \mathbf{0.500}
    • Right Node (DRD_R: Low + High, NR=5N_R = 5):
      • C1 (No), C3 (Yes), C4 (Yes), C6 (Yes), C7 (No) β€…β€ŠβŸΉβ€…β€ŠYes=3,No=2\implies \text{Yes} = 3, \text{No} = 2. Gini(DR)=1βˆ’[(35)2+(25)2]=1βˆ’1325=1225=0.480\text{Gini}(D_R) = 1 - \left[ \left(\frac{3}{5}\right)^2 + \left(\frac{2}{5}\right)^2 \right] = 1 - \frac{13}{25} = \frac{12}{25} = \mathbf{0.480}
    • Weighted Gini for Partition 2: Ginisplit({Medium}Β vsΒ {Low,Β High})=27(0.500)+57(0.480)=17+2.47=3.47β‰ˆ0.4857\text{Gini}_{\text{split}}(\{\text{Medium}\} \text{ vs } \{\text{Low, High}\}) = \frac{2}{7}(0.500) + \frac{5}{7}(0.480) = \frac{1}{7} + \frac{2.4}{7} = \frac{3.4}{7} \approx \mathbf{0.4857}
  • Partition 3: {High}\{\text{High}\} vs {Low,Β Medium}\{\text{Low, Medium}\}

    • Left Node (DLD_L: High, NL=2N_L = 2):
      • C4 (Yes), C6 (Yes) β€…β€ŠβŸΉβ€…β€ŠYes=2,No=0\implies \text{Yes} = 2, \text{No} = 0. Gini(DL)=1βˆ’[(22)2+0]=0.0(PureΒ Node)\text{Gini}(D_L) = 1 - \left[ \left(\frac{2}{2}\right)^2 + 0 \right] = \mathbf{0.0} \quad (\text{Pure Node})
    • Right Node (DRD_R: Low + Medium, NR=5N_R = 5):
      • C1 (No), C2 (No), C3 (Yes), C5 (Yes), C7 (No) β€…β€ŠβŸΉβ€…β€ŠYes=2,No=3\implies \text{Yes} = 2, \text{No} = 3. Gini(DR)=1βˆ’[(25)2+(35)2]=1βˆ’1325=1225=0.480\text{Gini}(D_R) = 1 - \left[ \left(\frac{2}{5}\right)^2 + \left(\frac{3}{5}\right)^2 \right] = 1 - \frac{13}{25} = \frac{12}{25} = \mathbf{0.480}
    • Weighted Gini for Partition 3: Ginisplit({High}Β vsΒ {Low,Β Medium})=27(0.0)+57(0.480)=2.47β‰ˆ0.3429\text{Gini}_{\text{split}}(\{\text{High}\} \text{ vs } \{\text{Low, Medium}\}) = \frac{2}{7}(0.0) + \frac{5}{7}(0.480) = \frac{2.4}{7} \approx \mathbf{0.3429}

BestΒ SplitΒ forΒ IncomeΒ Level:Β {High}Β vsΒ {Low,Β Medium}β€…β€ŠβŸΉβ€…β€ŠGiniβ‰ˆ0.3429\mathbf{\text{Best Split for Income Level: } \{\text{High}\} \text{ vs } \{\text{Low, Medium}\} \implies \text{Gini} \approx 0.3429}


Alternative: Multi-Way Attribute Gini Summary (Standard Exam Reference)​

If evaluated under the non-binary multi-way split definition (Gini(D,A)=βˆ‘βˆ£Dv∣∣D∣Gini(Dv)\text{Gini}(D, A) = \sum \frac{|D_v|}{|D|} \text{Gini}(D_v)):

  • Age Group: Gini(D,AgeΒ Group)=27(0.0)+27(0.0)+37(49)=421β‰ˆ0.1905\text{Gini}(D, \text{Age Group}) = \frac{2}{7}(0.0) + \frac{2}{7}(0.0) + \frac{3}{7}\left(\frac{4}{9}\right) = \frac{4}{21} \approx \mathbf{0.1905}
  • Income Level: Gini(D,IncomeΒ Level)=37(49)+27(0.500)+27(0.0)=421+17=721β‰ˆ0.3333\text{Gini}(D, \text{Income Level}) = \frac{3}{7}\left(\frac{4}{9}\right) + \frac{2}{7}(0.500) + \frac{2}{7}(0.0) = \frac{4}{21} + \frac{1}{7} = \frac{7}{21} \approx \mathbf{0.3333}

(c) Best Attribute to Split Using Gini Index Criterion (4 Marks)​
  1. Step 1: Compare Gini Values & Gini Gain (2 Marks) In decision tree learning, the optimal split is the one that minimizes the resulting weighted Gini index (or equivalently, maximizes the Gini Gain Ξ”Gini=Gini(Root)βˆ’Ginisplit\Delta \text{Gini} = \text{Gini}(\text{Root}) - \text{Gini}_{\text{split}}):
AttributeCandidate Binary SplitResulting Gini (Ginisplit\text{Gini}_{\text{split}})Gini Gain (Ξ”Gini=0.4898βˆ’Gini\Delta \text{Gini} = 0.4898 - \text{Gini})
Age Group{Young}\{\text{Young}\} vs {Middle,Β Senior}\{\text{Middle, Senior}\}0.2286\mathbf{0.2286}0.2612\mathbf{0.2612} (Maximum Gain)
Income Level{High}\{\text{High}\} vs {Low,Β Medium}\{\text{Low, Medium}\}0.34290.34290.14690.1469

(Under the multi-way formulation, Age Group Gini=0.1905\text{Gini} = 0.1905 vs Income Level Gini=0.3333\text{Gini} = 0.3333).

  1. Step 2: Conclusion & Selection (2 Marks)
    • Selected Best Attribute: Age Group (with binary split condition AgeΒ Group=Young\text{Age Group} = \text{Young} vs AgeΒ Group∈{Middle,Β Senior}\text{Age Group} \in \{\text{Middle, Senior}\}).
    • Reasoning: It produces the minimum weighted impurity (0.22860.2286) and achieves the highest impurity reduction (Ξ”Gini=0.2612\Delta \text{Gini} = 0.2612). It immediately isolates a completely pure terminal leaf node for Young customers (Buy=No\text{Buy} = \text{No} with 100%100\% certainty).

(d) Tie-Breaking: What Happens if Both Attributes Have the Same Gini Value? (2 Marks)​

If two attributes produce identical Gini index values, standard CART algorithms resolve the tie using the following established protocols:

  1. Domain-Specific / Cost Priority: Select the attribute that is cheaper, faster, or less intrusive to acquire in real-world production (e.g., Age Group may be easier to collect than verified Income).
  2. Subtree Balance / Child Node Distribution: Choose the split that creates more evenly distributed subset sizes (minimizing sample variance between child nodes).
  3. Deterministic Heuristic: Follow a consistent tie-breaking rule, such as selecting the attribute that appears first in the dataset schema (e.g., column index order).
  4. Secondary Information Metric: Compute Information Gain (Entropy) or Gain Ratio to assess if higher-order divergence distinguishes the attributes.

(e) Two Key Advantages of CART over ID3 or C4.5 (2 Marks)​
  1. Unified Framework for Classification & Regression:
    • CART seamlessly builds both Classification Trees (using the Gini Index for categorical targets) and Regression Trees (using Mean Squared Error / Variance Reduction for continuous numerical targets). In contrast, ID3 is strictly limited to classification, and C4.5 requires separate extensions.
  2. Binary Splitting Avoids Multi-Way Fragmentation:
    • CART strictly enforces binary splits (22 child nodes per split), preventing the exponential data fragmentation problem seen in ID3 (which creates a separate branch for every category). This preserves sample statistical power in lower nodes and naturally prevents overfitting on high-cardinality nominal attributes.
  3. Rigorous Cost-Complexity Pruning:
    • CART uses a mathematically disciplined Minimal Cost-Complexity Pruning algorithm (Ξ±\alpha-pruning parameterized with cross-validation), which is theoretically superior to the greedy heuristic error-based pruning utilized in C4.5.

Question 4: AdaBoost Transaction Fraud Classification (20 Marks)​

info

Question Statement

An online payment platform applies AdaBoost to classify transactions as Fraudulent or Genuine. Each weak learner is a decision stump based on one feature (like transaction amount or device ID).

  • i) Explain why decision stumps are used as weak learners in AdaBoost. (4 Marks)
  • ii) Describe how sample weights are updated after each iteration. (4 Marks)
  • iii) Suppose a stump misclassifies 10% of samples - explain how its error and alpha (importance weight) are computed. (4 Marks)
  • iv) Discuss how boosting reduces bias but can sometimes increase variance. (4 Marks)
  • v) If the dataset has missing values in the "Device ID" feature, explain how AdaBoost handles this situation. (4 Marks)

Solution 4​

πŸ“ Exam-Ready Answer (Structured for 20 Marks)​


(i) Why Decision Stumps are Used as Weak Learners in AdaBoost (4 Marks)​

A decision stump is a 1-level decision tree consisting of a single root split node (testing exactly one attribute threshold) connected directly to two terminal leaf nodes.

  1. Satisfaction of Weak Learner Condition (1 Mark):
    • Boosting theory (Freund & Schapire) requires base learners to perform only slightly better than random guessing (error Ο΅<0.5\epsilon < 0.5 in binary classification). A simple 1-feature stump easily satisfies this minimal requirement without needing complex parameter tuning.
  2. High Bias, Ultra-Low Variance Structure (1 Mark):
    • Stumps are extreme high-bias, low-variance models. Since boosting is fundamentally designed to reduce ensemble bias by additively combining weak models, starting with low-variance base learners prevents the ensemble from exploding in variance.
  3. Computational Speed & Scalability (1 Mark):
    • Training a stump requires scanning only O(Nβ‹…D)O(N \cdot D) candidate thresholds. In production transaction systems (such as high-frequency fraud detection), hundreds of boosting rounds can be trained in seconds.
  4. Interpretability & Feature Ranking (1 Mark):
    • Because each stump isolates a single feature (e.g., Amount>500\text{Amount} > 500), aggregating the stump weights provides an intuitive, mathematically exact measure of cumulative feature importance.

(ii) How Sample Weights are Updated After Each Iteration (4 Marks)​
  1. Step 1: Initialization (1 Mark)

    • At iteration m=1m = 1, all NN transaction samples are initialized with equal, uniform weights: wi(1)=1N,βˆ€i∈{1,2,…,N}w_i^{(1)} = \frac{1}{N}, \quad \forall i \in \{1, 2, \dots, N\}
  2. Step 2: Weighted Error Rate Computation (1 Mark)

    • For the mm-th weak learner hm(x)h_m(\mathbf{x}), the weighted misclassification error Ο΅m\epsilon_m is computed as the sum of weights of incorrectly predicted transactions: Ο΅m=βˆ‘i=1Nwi(m)β‹…I(yiβ‰ hm(xi))\epsilon_m = \sum_{i=1}^N w_i^{(m)} \cdot \mathbb{I}\left( y_i \ne h_m(\mathbf{x}_i) \right) where yi∈{βˆ’1,+1}y_i \in \{-1, +1\} and I(β‹…)\mathbb{I}(\cdot) is the indicator function.
  3. Step 3: Learner Importance Weight Ξ±m\alpha_m (1 Mark)

    • The voting weight assigned to stump hmh_m is: Ξ±m=12ln⁑(1βˆ’Ο΅mΟ΅m)\alpha_m = \frac{1}{2} \ln\left( \frac{1 - \epsilon_m}{\epsilon_m} \right)
  4. Step 4: Multiplicative Weight Update & Renormalization (1 Mark)

    • Sample weights for iteration m+1m + 1 are updated exponentially based on whether the transaction was correctly or incorrectly classified: wi(m+1)=wi(m)β‹…exp⁑(βˆ’Ξ±myihm(xi))Zmw_i^{(m+1)} = \frac{w_i^{(m)} \cdot \exp\left( -\alpha_m y_i h_m(\mathbf{x}_i) \right)}{Z_m}
    • For Correctly Classified Samples (yihm(xi)=+1y_i h_m(\mathbf{x}_i) = +1): wi(m+1)=wi(m)β‹…eβˆ’Ξ±m(weightΒ isΒ penalized/decreased)w_i^{(m+1)} = w_i^{(m)} \cdot e^{-\alpha_m} \quad (\text{weight is penalized/decreased})
    • For Misclassified Samples (yihm(xi)=βˆ’1y_i h_m(\mathbf{x}_i) = -1): wi(m+1)=wi(m)β‹…e+Ξ±m(weightΒ isΒ boosted/increased)w_i^{(m+1)} = w_i^{(m)} \cdot e^{+\alpha_m} \quad (\text{weight is boosted/increased})
    • ZmZ_m is the normalization factor ensuring βˆ‘i=1Nwi(m+1)=1\sum_{i=1}^N w_i^{(m+1)} = 1: Zm=βˆ‘i=1Nwi(m)exp⁑(βˆ’Ξ±myihm(xi))Z_m = \sum_{i=1}^N w_i^{(m)} \exp\left( -\alpha_m y_i h_m(\mathbf{x}_i) \right)
    • Core Insight: Transactions misclassified as genuine when fraudulent are amplified in weight, forcing subsequent stumps to concentrate heavily on resolving these hard-to-detect frauds.

(iii) Error and Alpha Computation for a Stump with 10% Misclassifications (4 Marks)​
  1. Step 1: Compute Weighted Error Rate (Ο΅m\epsilon_m) (1 Mark)

    • Given that the stump misclassifies 10%10\% of the total sample weight: Ο΅m=10%=0.10\epsilon_m = 10\% = \mathbf{0.10}
  2. Step 2: State the Formula for Importance Weight (Ξ±m\alpha_m) (1 Mark) Ξ±m=12ln⁑(1βˆ’Ο΅mΟ΅m)\alpha_m = \frac{1}{2} \ln\left( \frac{1 - \epsilon_m}{\epsilon_m} \right)

  3. Step 3: Step-by-Step Numerical Evaluation (1 Mark)

    • Evaluate the odds ratio: 1βˆ’Ο΅mΟ΅m=1βˆ’0.100.10=0.900.10=9\frac{1 - \epsilon_m}{\epsilon_m} = \frac{1 - 0.10}{0.10} = \frac{0.90}{0.10} = 9
    • Substitute into the logarithm: Ξ±m=12ln⁑(9)=12ln⁑(32)=ln⁑(3)\alpha_m = \frac{1}{2} \ln(9) = \frac{1}{2} \ln(3^2) = \ln(3)
    • Using ln⁑(3)β‰ˆ1.09861\ln(3) \approx 1.09861: Ξ±mβ‰ˆ1.0986\mathbf{\alpha_m \approx 1.0986}
  4. Step 4: Mathematical & Practical Interpretation (1 Mark)

    • High Positive Weight: Because Ο΅m=0.10β‰ͺ0.50\epsilon_m = 0.10 \ll 0.50 (substantially better than random guessing), Ξ±mβ‰ˆ1.099\alpha_m \approx 1.099 is strongly positive.
    • Voting Influence: In the final ensemble decision rule: H(x)=sign(βˆ‘m=1MΞ±mhm(x))H(\mathbf{x}) = \text{sign}\left( \sum_{m=1}^M \alpha_m h_m(\mathbf{x}) \right) this high-performing stump receives a powerful voting weight of +1.0986+1.0986, significantly influencing the fraud classification outcome.

(iv) How Boosting Reduces Bias but Can Sometimes Increase Variance (4 Marks)​
  1. How Boosting Reduces Bias (2 Marks):

    • Additive Sequential Correction: Individual decision stumps have severe underfitting (high bias) because a single threshold cannot capture complex decision surfaces.
    • Progressive Residual Modeling: Each successive learner is trained on the reweighted distribution of samples misclassified by preceding learners.
    • Non-Linear Boundary Synthesis: Linearly combining numerous piecewise linear stumps forms highly expressive, intricate, non-linear decision boundaries: lim⁑Mβ†’βˆžBias2β†’0\lim_{M \to \infty} \text{Bias}^2 \to 0 This guarantees that the ensemble training error drops exponentially toward zero as iterations increase.
  2. Why Boosting Can Sometimes Increase Variance (2 Marks):

    • Extreme Sensitivity to Outliers & Label Noise: If a payment dataset contains mislabeled transactions (e.g., an abnormal genuine purchase falsely flagged as fraud) or anomalous outliers, AdaBoost repeatedly misclassifies them.
    • Exponential Weight Explosion: The weight of these noisy points escalates exponentially (emΞ±e^{m \alpha}), causing the algorithm to over-focus on learning isolated noise points rather than generalizable fraud patterns.
    • Overfitting & Decision Boundary Fragmentation: The ensemble boundary contorts into irregular, sharp pockets around noisy outliers, leading to high variance, brittle predictions, and deteriorated test accuracy.
    • Mitigation: Employing shrinkage (learning rate Ξ·<1\eta < 1), limiting maximum boosting iterations MM, or using robust variants like Gradient Boosting with Huber loss.

(v) Handling Missing Values in the "Device ID" Feature (4 Marks)​

In practical fraud detection, "Device ID" is frequently missing due to private browsing modes, cookie blocking, or emulator masking. AdaBoost handles this through several robust mechanisms:

  1. Feature Bypassing via Alternative Stumps (Primary CART/Stump Defense) (1.5 Marks):
    • In AdaBoost, each weak learner selects only one best feature to split on at each iteration. If "Device ID" contains extensive missing entries that degrade its split quality, the algorithm automatically selects an alternative, fully observed attribute (e.g., Transaction Amount, IP Geolocation, or Time of Transaction) that yields a lower weighted error Ο΅m\epsilon_m.
  2. Missing as an Informative Predictive Category (1 Mark):
    • In cyber-fraud analysis, a missing Device ID is rarely random (it is Missing Not At Random, MNAR). Fraudsters deliberately conceal device fingerprints. AdaBoost treats Missing / Null as a separate, dedicated categorical level (Device_ID = Unknown). This category often becomes an exceptionally powerful indicator of fraudulent intent.
  3. Surrogate Split Rule (CART-Specific Mechanism) (1 Mark):
    • If a stump insists on evaluating Device ID, CART constructs a surrogate split using an auxiliary feature (e.g., IP Address or Browser Type) that mimics the Device ID split with maximum mutual correlation, routing missing transactions along the surrogate branch.
  4. Weighted Proportional Assignment (0.5 Marks):
    • When encountering a missing value during split evaluation, the sample's weight can be split proportionally across both branches according to the relative weight distribution of observed transactions in the child nodes.