4 Classification Techniques

Data Warehousing and Data Mining · Unit 4

Classification Techniques

Exam-focused notes for Classification Techniques (Data Warehousing and Data Mining, BIT454): what the TU syllabus asks and how it has actually been tested, with 3 solved past questions from this unit.

Classification Techniques in short

Classification assigns a record to one of several known classes using a model learned from labeled examples. This chapter covers the main classifiers and how they pick and test attributes.

Classification Techniques: notes

Classification by back propagation

Back propagation trains a multilayer feed-forward neural network. The network has an input layer, one or more hidden layers and an output layer. Each connection has a weight. Each unit adds up its weighted inputs and passes the sum through an activation function, usually the sigmoid:

$$O_j = \frac{1}{1 + e^{-I_j}}, \qquad I_j = \sum_i w_{ij} O_i + \theta_j$$

Training repeats these actions for each training record:

  • Forward pass: feed the inputs through the network to get the output.
  • Error calculation: compare the output with the true target value.
  • Backward pass: send the error back from the output layer to the hidden layers.
  • Weight update: change each weight and bias a little to reduce the error.

For an output unit $j$ with target $T_j$, the error is $Err_j = O_j(1 - O_j)(T_j - O_j)$. For a hidden unit it is $Err_j = O_j(1 - O_j)\sum_k Err_k w_{jk}$. The weight update is $w_{ij} = w_{ij} + l \cdot Err_j \cdot O_i$, where $l$ is the learning rate. Training stops when the error is small or after a fixed number of rounds.

Backpropagation vs Bayesian classification:

BasisBack propagationBayesian classification
BasisNeural network with weightsProbability and Bayes theorem
TrainingSlow, many passesFast, counts only
ModelHard to interpret (black box)Easy to interpret
OutputClass from output unitClass with highest posterior probability
Noise toleranceHighGood

Bayesian classification methods

A Bayesian classifier predicts the class with the highest probability. It uses Bayes theorem:

$$P(C|X) = \frac{P(X|C),P(C)}{P(X)}$$

Naive Bayes assumes attributes are independent given the class, so $P(X|C) = \prod_k P(x_k|C)$. Since $P(X)$ is the same for all classes, we only compare $P(X|C)P(C)$.

Worked example. Training data has 14 records: 9 "Yes" and 5 "No" for playing tennis. Classify $X$ = (Outlook = Sunny, Temp = Cool, Humidity = High, Wind = Strong). The counts give:

  • $P(Yes) = 9/14$, $P(No) = 5/14$.
  • For Yes: Sunny $2/9$, Cool $3/9$, High $3/9$, Strong $3/9$.
  • For No: Sunny $3/5$, Cool $1/5$, High $4/5$, Strong $3/5$.

$$\begin{aligned} P(X|Yes)P(Yes) &= \frac{9}{14}\cdot\frac{2}{9}\cdot\frac{3}{9}\cdot\frac{3}{9}\cdot\frac{3}{9} \approx 0.0053 \ P(X|No)P(No) &= \frac{5}{14}\cdot\frac{3}{5}\cdot\frac{1}{5}\cdot\frac{4}{5}\cdot\frac{3}{5} \approx 0.0206 \end{aligned}$$

The score for No is larger, so the answer is No. Normalized, $P(No|X) \approx 0.795$.

If an attribute value never occurs with a class, its probability is 0 and the whole product becomes 0. The fix is Laplace smoothing: add 1 to each count. For example, "Overcast" with class No has count 0 out of 5, with 3 possible outlook values. The smoothed probability is $(0+1)/(5+3) = 0.125$.

What this unit covers

  • Classification by back propagation
  • Bayesian classification methods
  • Decision tree induction
  • Gini index for attribute selection
  • Support vector machines
  • Lazy learners and instance-based learning
  • Ensemble methods

Classification by back propagation

2081 · 10 marks

What do you understand by classification by back propagation? How is it different from Bayesian classification? Explain.[10]

Show solved answer

Classification by Back Propagation vs Bayesian Classification

Classification by Back Propagation

Back Propagation is a supervised learning algorithm used to train artificial neural networks for classification tasks.

Key Characteristics:

  1. Network Structure: Uses a multi-layer feedforward neural network with an input layer, one or more hidden layers, and an output layer.

  2. Learning Mechanism:

    • Forward pass: Input data propagates through the network, producing an output
    • Error calculation: Compares predicted output with actual (target) output
    • Backward pass: Error is propagated backward through the network
    • Weight adjustment: Weights are updated using gradient descent to minimize error
  3. Training Process:

    • Iterative refinement of weights and biases
    • Continues until convergence (error becomes acceptably small)
    • Uses activation functions (sigmoid, ReLU, etc.) for non-linearity
  4. Advantages:

    • Can learn complex, non-linear decision boundaries
    • Handles multi-class classification naturally
    • No assumptions about data distribution required

Bayesian Classification

Bayesian Classification is based on Bayes' theorem and probabilistic reasoning.

Key Characteristics:

  1. Theoretical Foundation: Uses conditional probability and Bayes' theorem:

    P(Class|Features) = P(Features|Class) × P(Class) / P(Features)
    
  2. Approach:

    • Assumes independence between features (in Naive Bayes)
    • Calculates posterior probability for each class
    • Assigns instance to class with highest posterior probability
  3. Training: Learns probability distributions from training data (not iterative weight adjustment)

  4. Advantages:

    • Theoretically sound probabilistic framework
    • Computationally efficient
    • Works well with small datasets

Key Differences

AspectBack PropagationBayesian Classification
Learning TypeSupervised (iterative)Probabilistic inference
Decision BoundaryNon-linear (learned)Linear (probability-based)
AssumptionsNone about data distributionAssumes feature independence (Naive Bayes)
Computational CostHigher (iterative training)Lower (direct calculation)
InterpretabilityBlack box (weights hard to interpret)Transparent (probability-based)
Data RequirementsNeeds large datasetsWorks with smaller datasets
ConvergenceMay get stuck in local minimaGuaranteed solution

Conclusion

Back propagation is a connectionist, non-probabilistic approach that learns complex patterns through iterative weight adjustment, while Bayesian classification is a statistical, probabilistic approach based on explicit probability calculations. Back propagation is more powerful for complex patterns but requires more data and computation; Bayesian methods are simpler, faster, and more interpretable but assume feature independence.

Open this answer on its own page →

Gini index for attribute selection

2082.1 · 10 marks

How can you use Gini index as attribute selection algorithm? Illustrate with an example.Describe the working mechanism of support vector machine.[5+5]

(a) Gini Index as Attribute Selection Algorithm The Gini index (or Gini impurity) measures the probability of incorrectly classifying a randomly chosen element if it were randomly labeled according to the class distribution in a dataset. It is used in decision tree construction to select the best...

Open this answer on its own page →

Lazy learners and instance-based learning

2082.1 · 5 marks

Discuss about lazy learners and ensemble method. [5]

Definition: Lazy learners are machine learning algorithms that defer the learning process until a query (prediction request) is made. They store the entire training dataset and perform minimal processing during the training phase. Characteristics: - Minimal training phase: Little to no model buil...

Open this answer on its own page →