Skip to content
AD-603 (A) · Data Mining and Warehousing/Quick Revision Short Notes

Data Mining and Warehousing (AD-603 (A)) - Unit 4 Short Notes

How unit 4 is examined

This unit covers the general classification approach and five families of classifiers; rule-based classifiers carry the most marks, with the general approach, KNN, decision trees, neural networks and Naive Bayes each asked once for 7 marks.

Statistical-based algorithms

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. <mark>Statistical classifiers use probability theory and the statistics of the training data to predict the class of a tuple, either through a fitted model (regression) or through Bayes' theorem.</mark>

Key points.

  1. Linear regression fits $y = c_0 + c_1x_1 + \dots + c_nx_n$ by least squares and can be used to predict a numeric value.
  2. Logistic regression squeezes that value through the sigmoid $\frac{1}{1+e^{-z}}$ to give a class probability, and it is used for two-class problems.
  3. Bayesian classification uses prior and conditional probabilities and is the main statistical classifier (see Probabilistic Classifiers).
  4. These methods assume the data follow a known distribution, so they are fast but weak when that assumption is wrong.

Distance-based algorithms

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>

Definition. <mark>K-nearest neighbours (KNN) classifies a new tuple by the majority class among the k training tuples closest to it, using a distance measure.</mark>

Formula. Euclidean distance $d(x,y)=\sqrt{\sum_{i=1}^{n}(x_i-y_i)^2}$.

Steps.

Step 1: Store all training tuples (KNN is a lazy learner, it builds no model).
Step 2: Choose k and a distance measure such as Euclidean.
Step 3: Compute the distance from the new tuple to every training tuple.
Step 4: Pick the k nearest tuples and take a majority vote of their classes.

Key points.

  1. Similar tuples lie close together, so the class of the neighbours predicts the class of the new tuple.
  2. A small k is sensitive to noise, while a large k blurs the class boundaries; an odd k avoids ties in two-class problems.
  3. Attributes should be normalised, otherwise a large-range attribute dominates the distance.
  4. Advantages: simple, no training time, works for many classes. Limitations: slow at classification time, needs much memory, and is hurt by irrelevant attributes.

Example. New point $(2,3)$, k = 3, training points A: (1,2), (2,2), (2,1); B: (4,4), (5,4).

Point Class Distance
(2,2) A 1.00
(1,2) A 1.41
(2,1) A 2.00
(4,4) B 2.24

The three nearest are all A, so the class is A.

Answer frame. Open with the KNN principle; list the four steps; show the distance table above; close with advantages and limitations.

Asked: [7 marks] (May 2024) Discuss about K-nearest-neighbors algorithm.

Decision tree-based algorithms

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>

Definition. <mark>A decision tree is a flowchart-like tree in which each internal node tests an attribute, each branch is an outcome of the test and each leaf holds a class label.</mark>

Formula. For $m$ classes with proportions $p_i$, and attribute $A$ splitting $D$ into $D_j$:

$$Info(D) = -\sum_{i=1}^{m} p_i \log_2 p_i \qquad Info_A(D)=\sum_j \frac{|D_j|}{|D|}Info(D_j)$$

$$Gain(A)=Info(D)-Info_A(D) \qquad GainRatio(A)=\frac{Gain(A)}{SplitInfo_A(D)}$$

Steps (induction, ID3/C4.5).

Step 1: Create a node N holding all training tuples.
Step 2: If all tuples have one class, make N a leaf of that class and stop.
Step 3: If no attributes are left, make N a leaf labelled with the majority class.
Step 4: Select the attribute with the highest information gain (or gain ratio) as the test.
Step 5: Make a branch for each outcome and recurse on each subset.
Step 6: Prune the tree to remove branches caused by noise.

Key points.

  1. Entropy $Info(D)$ measures the impurity of a data set: it is 0 when all tuples share a class and highest when classes are evenly mixed.
  2. Information gain is the drop in entropy after splitting on $A$, so the attribute with the largest gain gives the purest partitions.
  3. Gain is biased towards attributes with many values, so C4.5 uses gain ratio, which divides by $SplitInfo_A(D)=-\sum_j \frac{|D_j|}{|D|}\log_2\frac{|D_j|}{|D|}$.
  4. Pruning (pre- or post-) cuts overfitted branches and improves accuracy on new data.

Example. 14 tuples, 9 Yes and 5 No. $Info(D)=0.940$. Outlook splits them into Sunny (2 Yes, 3 No), Overcast (4, 0), Rain (3, 2).

Step Working Value
$Info_{Outlook}(D)$ $\frac{5}{14}(0.971)+\frac{4}{14}(0)+\frac{5}{14}(0.971)$ 0.694
Gain(Outlook) 0.940 - 0.694 0.247
SplitInfo $-\sum \frac{|D_j|}{14}\log_2\frac{|D_j|}{14}$ 1.577
GainRatio 0.247 / 1.577 0.156

Gain(Outlook) = 0.247 bits; it is chosen as the root when it beats the other attributes.

Answer frame. Open with the definition of a decision tree; write the six induction steps; define entropy, gain and gain ratio with formulas; work the Outlook example; close by saying pruning avoids overfitting.

Asked: [7 marks] (May 2023) Explain Decision tree induction algorithm for classification. Discuss the usage of information gain in this.

Neural network-based algorithms

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>

Definition. <mark>An artificial neural network is a set of connected input, hidden and output units, each connection carrying a weight, that learns to classify by adjusting those weights on training data.</mark>

Diagram. <figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u4-01" viewBox="0 0 424 338" width="424" height="338" role="img" aria-label="Feed-forward network: X1, X2 inputs, H1 to H3 hidden units, O output unit"><style>#dsfig-u4-01 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u4-01 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u4-01 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u4-01 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u4-01 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u4-01 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u4-01 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u4-01 .t{fill:#16181D;font-weight:500}#dsfig-u4-01 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u4-01 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u4-01 .dot{fill:#16181D}#dsfig-u4-01 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u4-01 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u4-01 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u4-01 .ah{fill:#454C5A}#dsfig-u4-01 .ah.hi{fill:#2340B8}#dsfig-u4-01 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u4-01 .wl .t{font-size:12px;font-weight:700}#dsfig-u4-01 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u4-01 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u4-01 .e{stroke:#B1B7C3}html.dark #dsfig-u4-01 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u4-01 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u4-01 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u4-01 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u4-01 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u4-01 .t{fill:#E6E8ED}html.dark #dsfig-u4-01 .t.inv{fill:#0F1115}html.dark #dsfig-u4-01 .kd{stroke:#E6E8ED}html.dark #dsfig-u4-01 .dot{fill:#E6E8ED}html.dark #dsfig-u4-01 .ann{fill:#8FA3FF}html.dark #dsfig-u4-01 .lbl{fill:#858D9C}html.dark #dsfig-u4-01 .ptr{fill:#8FA3FF}html.dark #dsfig-u4-01 .ah{fill:#B1B7C3}html.dark #dsfig-u4-01 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u4-01 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u4-01 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u4-01 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah5" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh5" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><path class="e" d="M58.4,78.4 L191.6,45.1" marker-end="url(#ah5)"/><path class="e" d="M57,91.5 L193.2,159.6" marker-end="url(#ah5)"/><path class="e" d="M51.9,97.8 L198.9,281.6" marker-end="url(#ah5)"/><path class="e" d="M51.9,240.2 L198.9,56.4" marker-end="url(#ah5)"/><path class="e" d="M57,246.5 L193.2,178.4" marker-end="url(#ah5)"/><path class="e" d="M58.4,259.6 L191.6,292.9" marker-end="url(#ah5)"/><path class="e" d="M227.2,51.4 L367.2,156.4" marker-end="url(#ah5)"/><path class="e" d="M231,169 L363,169" marker-end="url(#ah5)"/><path class="e" d="M227.2,286.6 L367.2,181.6" marker-end="url(#ah5)"/><circle class="n" cx="40" cy="83" r="18"/><text class="t" x="40" y="83" dy=".35em" text-anchor="middle">X1</text><circle class="n" cx="40" cy="255" r="18"/><text class="t" x="40" y="255" dy=".35em" text-anchor="middle">X2</text><circle class="n" cx="212" cy="40" r="18"/><text class="t" x="212" y="40" dy=".35em" text-anchor="middle">H1</text><circle class="n" cx="212" cy="169" r="18"/><text class="t" x="212" y="169" dy=".35em" text-anchor="middle">H2</text><circle class="n" cx="212" cy="298" r="18"/><text class="t" x="212" y="298" dy=".35em" text-anchor="middle">H3</text><circle class="n" cx="384" cy="169" r="18"/><text class="t" x="384" y="169" dy=".35em" text-anchor="middle">O</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">Feed-forward network: X1, X2 inputs, H1 to H3 hidden units, O output unit</figcaption></figure>

Key points.

  1. A unit computes the weighted sum $z=\sum w_ix_i+b$ and passes it through an activation such as the sigmoid $\frac{1}{1+e^{-z}}$; for inputs (1, 0), weights (0.5, -0.5) and bias 0.1 the output is 0.646.
  2. In a feed-forward network the inputs move layer by layer from the input layer through the hidden layers to the output layer.
  3. Backpropagation learns by comparing the output with the target, propagating the error backwards and updating each weight by $w \leftarrow w + \eta \cdot err \cdot x$, where $\eta$ is the learning rate.
  4. Training repeats over the tuples until the error is small or a set number of epochs is reached.
  5. Advantages: tolerates noisy data and classifies patterns it was not trained on. Limitations: long training and a result that is hard to interpret.
  6. Applications include handwriting recognition, speech recognition and medical diagnosis.

Answer frame. Open with the definition; draw the network above; explain forward pass then backpropagation; close with advantages and applications.

Asked: [7 marks] (May 2023) Discuss about neural network based Algorithms.

Rule-based algorithms

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>

Definition. <mark>A rule-based classifier classifies a tuple using a set of IF-THEN rules of the form IF condition THEN class.</mark>

Key points.

  1. The IF part is the rule antecedent (a conjunction of attribute tests) and the THEN part is the consequent (the class).
  2. Coverage of a rule is the fraction of tuples it satisfies, $\frac{n_{covers}}{|D|}$, and accuracy is the fraction of those covered tuples it classifies correctly, $\frac{n_{correct}}{n_{covers}}$.
  3. Rules can be read directly from a decision tree, one rule per root-to-leaf path, or learned by sequential covering (rule induction).
  4. Rule ordering decides conflicts when several rules fire: size ordering picks the toughest rule, and class ordering ranks the classes; a default rule covers tuples that no rule fires on.
  5. Pruning removes conditions from a rule when that does not lower its quality, and this avoids overfitting.
  6. Information gain picks the best condition to add, in the FOIL style: $FOIL\_Gain = pos'\left(\log_2\frac{pos'}{pos'+neg'} - \log_2\frac{pos}{pos+neg}\right)$, so a condition is preferred when it keeps many positives and few negatives.
  7. Strengths: rules are easy to read and edit, and the classifier is fast. Limitations: rules may conflict or leave tuples uncovered, and they cope poorly with noise.
  8. Applications include fraud detection, medical diagnosis and expert systems, and future systems are likely to combine rules with learned models for accuracy and explainability.

Steps (sequential covering).

Step 1: Start with an empty rule set and all tuples.
Step 2: Learn one rule for class C by adding the condition with the best information gain until accuracy is high enough.
Step 3: Prune the rule.
Step 4: Remove the tuples the rule covers and repeat for the remaining tuples.
Step 5: Stop when no tuples remain or rule quality falls too low.

Example. IF age = youth AND student = yes THEN buys_computer = yes; IF age = senior AND credit = fair THEN buys_computer = no; default: buys_computer = yes.

Answer frame. Open with the IF-THEN definition; give the example rule set; develop points 1-2, then sequential covering with information gain, then ordering and pruning; close with strengths, limitations and applications.

Asked: [7 marks] (May 2024, Jun 2025) Explain Rule based algorithm for classification. Discuss the usage of information gain in this. Explain the rule-based classifier with example. Explain the structure, working and real-world applications of Rule-Based Algorithms, with strengths, limitations and how they might evolve.

Probabilistic Classifiers

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>

Definition. <mark>Naive Bayes is a probabilistic classifier that uses Bayes' theorem to give the probability of each class for a tuple and predicts the class with the highest posterior.</mark>

Formula.

$$P(C_i\mid X)=\frac{P(X\mid C_i)\,P(C_i)}{P(X)} \qquad P(X\mid C_i)=\prod_{k=1}^{n}P(x_k\mid C_i)$$

Key points.

  1. It is called naive because it assumes class conditional independence: given the class, the attributes are taken as independent of each other, which is rarely exactly true.
  2. That assumption turns $P(X\mid C_i)$ into a product of single-attribute probabilities, which is cheap to compute.
  3. $P(X)$ is the same for every class, so only $P(X\mid C_i)P(C_i)$ is compared.
  4. If a probability is zero, the Laplace correction adds 1 to each count so the product does not collapse to zero.

Steps.

Step 1: Compute the prior P(Ci) of each class from the training data.
Step 2: Compute P(xk|Ci) for every attribute value of the tuple.
Step 3: Multiply them to get P(X|Ci), then multiply by P(Ci).
Step 4: Predict the class with the largest value.

Example. Tennis data, 9 Yes and 5 No; classify X = (Outlook = Sunny, Temp = Cool). Yes: $\frac{9}{14}\cdot\frac{2}{9}\cdot\frac{3}{9}=0.0476$. No: $\frac{5}{14}\cdot\frac{3}{5}\cdot\frac{1}{5}=0.0429$.

Yes has the larger value (0.0476 against 0.0429), so X is classified Yes.

Answer frame. Open with Bayes' theorem and the independence assumption; explain why it is naive; list the four steps; work the example; close by naming its strengths (fast, works with little data).

Asked: [7 marks] (May 2023) Why is Naive Bayesian classification called "Naive"? Briefly outline the major ideas of Naive Bayesian classification. Explain Naive-Bayes classification.

Other questions from this unit

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>

Definition. <mark>Classification is a two-step process that builds a model from training tuples with known class labels and then uses the model to predict the class label of new tuples.</mark>

Diagram. <figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u4-02" viewBox="0 0 499.8 252" width="499.8" height="252" role="img" aria-label="General approach: Tr training set, Alg learning algorithm, Mod classifier model, Te test set, Pred predicted class"><style>#dsfig-u4-02 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u4-02 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u4-02 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u4-02 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u4-02 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u4-02 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u4-02 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u4-02 .t{fill:#16181D;font-weight:500}#dsfig-u4-02 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u4-02 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u4-02 .dot{fill:#16181D}#dsfig-u4-02 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u4-02 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u4-02 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u4-02 .ah{fill:#454C5A}#dsfig-u4-02 .ah.hi{fill:#2340B8}#dsfig-u4-02 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u4-02 .wl .t{font-size:12px;font-weight:700}#dsfig-u4-02 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u4-02 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u4-02 .e{stroke:#B1B7C3}html.dark #dsfig-u4-02 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u4-02 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u4-02 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u4-02 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u4-02 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u4-02 .t{fill:#E6E8ED}html.dark #dsfig-u4-02 .t.inv{fill:#0F1115}html.dark #dsfig-u4-02 .kd{stroke:#E6E8ED}html.dark #dsfig-u4-02 .dot{fill:#E6E8ED}html.dark #dsfig-u4-02 .ann{fill:#8FA3FF}html.dark #dsfig-u4-02 .lbl{fill:#858D9C}html.dark #dsfig-u4-02 .ptr{fill:#8FA3FF}html.dark #dsfig-u4-02 .ah{fill:#B1B7C3}html.dark #dsfig-u4-02 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u4-02 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u4-02 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u4-02 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah6" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh6" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><path class="e" d="M59,40 L156.6,40" marker-end="url(#ah6)"/><path class="e" d="M196.6,40 L294.2,40" marker-end="url(#ah6)"/><path class="e" d="M334.2,40 L424.8,40" marker-end="url(#ah6)"/><path class="e" d="M315.2,193 L315.2,61" marker-end="url(#ah6)"/><circle class="n" cx="40" cy="40" r="18"/><text class="t" x="40" y="40" dy=".35em" text-anchor="middle">Tr</text><circle class="n" cx="177.6" cy="40" r="18"/><text class="t" x="177.6" y="40" dy=".35em" text-anchor="middle">Alg</text><circle class="n" cx="315.2" cy="40" r="18"/><text class="t" x="315.2" y="40" dy=".35em" text-anchor="middle">Mod</text><circle class="n" cx="315.2" cy="212" r="18"/><text class="t" x="315.2" y="212" dy=".35em" text-anchor="middle">Te</text><rect class="n" x="427.8" y="25" width="50" height="30" rx="15"/><text class="t" x="452.8" y="40" dy=".35em" text-anchor="middle">Pred</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">General approach: Tr training set, Alg learning algorithm, Mod classifier model, Te test set, Pred predicted class</figcaption></figure>

Key points.

  1. In the learning step the algorithm builds the model from the training set; in the classification step the model labels the test set and its accuracy is measured.
  2. Classification is supervised because the class labels are given; clustering is unsupervised because no labels exist and groups are found from similarity.
  3. The question's claim that clustering is supervised is wrong, so justify it by contrast: clustering only becomes supervised if labels are supplied, and then it is classification.
  4. Holdout splits the data, usually two-thirds for training and one-third for testing, and cross-validation splits it into k folds and tests on each fold in turn.
  5. The confusion matrix gives $Accuracy=\frac{TP+TN}{TP+TN+FP+FN}$, plus precision $\frac{TP}{TP+FP}$ and recall $\frac{TP}{TP+FN}$.
  6. Types of classifiers are decision trees, Bayesian, rule-based, neural networks and KNN.
  7. Example applications are spam filtering, loan approval and disease diagnosis.

Answer frame. For the block diagram, open with the two phases, draw the figure, and explain training, model construction, then evaluation. For the mixed question, define classification, contrast supervised with unsupervised, then accuracy measures, then classifier types.

Asked: [7 marks] (May 2024) What is meant by classification? Justify why clustering is said to be supervised learning. How the classifier accuracy determined and also explains its various types. Asked: [7 marks] (Jun 2025) With a neat block diagram, explain the general approach to solve a classification problem.

Last-minute revision

  • Classification builds a model from labelled training data and predicts the class of new tuples.
  • KNN is a lazy learner using Euclidean distance $\sqrt{\sum(x_i-y_i)^2}$ and majority vote of k neighbours.
  • $Info(D)=-\sum p_i\log_2p_i$; $Gain(A)=Info(D)-Info_A(D)$; GainRatio = Gain / SplitInfo.
  • Tennis data: $Info(D)=0.940$, Gain(Outlook) = 0.247.
  • Decision tree: pick the highest-gain attribute, split, recurse, then prune.
  • Backpropagation propagates the error backwards and updates weights with learning rate $\eta$.
  • Rule coverage = covered / all tuples; accuracy = correct / covered.
  • Sequential covering learns one rule, removes covered tuples and repeats.
  • Naive Bayes: $P(C_i\mid X)\propto P(C_i)\prod P(x_k\mid C_i)$; naive means class conditional independence.
  • Accuracy = (TP + TN) / total; holdout is 2/3 and 1/3.

Memory hooks

  • KNN: "Neighbours vote", so K near, majority wins.
  • Gain = entropy before minus entropy after.
  • Naive = every attribute independent given the class.
  • Rules: IF-THEN, cover, prune, cover again.
  • Backprop: forward to guess, backward to fix.

Coverage checklist

  • Statistical-based algorithms: definition, regression and logistic key points (no past question).
  • Distance-based algorithms: KNN steps, distance table (May 2024 KNN).
  • Decision tree-based algorithms: induction steps, entropy, gain, gain ratio, example (May 2023 decision tree).
  • Neural network-based algorithms: structure, backpropagation, advantages (May 2023 neural network).
  • Rule-based algorithms: IF-THEN, coverage, accuracy, induction, information gain, pruning, example (May 2024, Jun 2025 rule-based).
  • Probabilistic Classifiers: Bayes theorem, naive assumption, steps, example (May 2023 Naive Bayes).
Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in