2024 question paper

Data Mining

26 questions

  1. Q1(a). Which of the following is NOT a component of a data warehouse? (i) Metadata (ii) ETL tools (iii) OLAP (iv) Web server20242m

    Module 1: Data Warehousing and Business Analysis

    Which of the following is NOT a component of a data warehouse?

    (i) Metadata
    (ii) ETL tools
    (iii) OLAP
    (iv) Web server

    View this question on its own page →
    Worked Solution

    Answer: (iv) Web server

    The architecture of a data warehouse is built from a fixed set of components: source data, ETL (Extract, Transform, Load) tools that move and clean the data, the warehouse database itself, metadata (data about the data — schemas, definitions, mappings, lineage), an OLAP/DSS engine for analytical processing, and front-end reporting and analysis tools. A web server is not one of them: it may host an application that uses the warehouse, but it belongs to the web/application tier, not to the warehouse architecture.

    Metadata, ETL tools and OLAP are all standard textbook components of a data warehouse — which is exactly why they are wrong answers in a 'NOT' question. The task is to spot the option that belongs to general web infrastructure rather than to the warehouse itself.

  2. Q1(b). Which schema is most commonly used in a data warehouse? (i) Star schema (ii) Snowflake schema (iii) Network schema (iv) Tree schema20242m

    Module 1: Data Warehousing and Business Analysis

    Which schema is most commonly used in a data warehouse?

    (i) Star schema
    (ii) Snowflake schema
    (iii) Network schema
    (iv) Tree schema

    View this question on its own page →
    Worked Solution

    Answer: (i) Star schema

    The star schema is the most commonly used schema in data warehouse design. It places a single central fact table (measures such as sales amount and quantity) directly beside several dimension tables (time, product, customer, store). Because the dimensions are denormalised, the join graph looks like a star, join paths are short and queries run fast — the reason it is the default choice for dimensional modelling.

    The snowflake schema is a normalised variant of the star schema and is also used, but less commonly, because its extra joins slow queries down. Network schema and tree schema are general data-modelling concepts (network and hierarchical models); they are not data warehouse modelling schemes, since they do not follow the fact–dimension pattern.

  3. Q1(c). Which of the following is NOT a type of OLAP system? (i) MOLAP (ii) DOLAP (iii) ROLAP (iv) HOLAP20242m

    Module 1: Data Warehousing and Business Analysis

    Which of the following is NOT a type of OLAP system?

    (i) MOLAP
    (ii) DOLAP
    (iii) ROLAP
    (iv) HOLAP

    View this question on its own page →
    Worked Solution

    Answer: (ii) DOLAP

    The three standard implementations of OLAP are MOLAP (multidimensional storage — data held in specialised cube structures), ROLAP (relational storage — OLAP operations pushed down to SQL on relational tables) and HOLAP (hybrid — MOLAP for aggregated data plus ROLAP for detail data). 'DOLAP' is not part of this standard classification of OLAP architectures.

    MOLAP, ROLAP and HOLAP are precisely the trio listed in every textbook, so each of them is a genuine OLAP type. In a 'NOT a type' question the odd one out must therefore be DOLAP.

  4. Q1(d). A data warehouse is usually subject-oriented. This means it focuses on: (i) Individual transactions (ii) A specific business area (iii) Real-time data (iv) Day-to-day operations20242m

    Module 1: Data Warehousing and Business Analysis

    A data warehouse is usually subject-oriented. This means it focuses on:

    (i) Individual transactions
    (ii) A specific business area
    (iii) Real-time data
    (iv) Day-to-day operations

    View this question on its own page →
    Worked Solution

    Answer: (ii) A specific business area

    'Subject-oriented' is one of the four defining characteristics of a data warehouse (the others being integrated, non-volatile and time-variant). It means the warehouse is organised around the major subjects of the enterprise — customers, products, sales, orders — i.e. a specific business area, rather than around the applications or day-to-day processes that happen to produce the data. Analysis then runs subject by subject across many years of history.

    Individual transactions and day-to-day operations describe an OLTP system, which is application-oriented and holds current state; real-time data describes operational/real-time systems. A warehouse instead stores integrated, historical, subject-oriented data for decision support, so (i), (iii) and (iv) are incorrect.

  5. Q1(e). Which of the following algorithms is used for mining frequent item sets in a dataset? (i) K-means (ii) Apriori (iii) Decision tree (iv) Naive Bayes20242m

    Module 2: Data Mining Fundamentals and Association Rule Mining

    Which of the following algorithms is used for mining frequent item sets in a dataset?

    (i) K-means
    (ii) Apriori
    (iii) Decision tree
    (iv) Naive Bayes

    View this question on its own page →
    Worked Solution

    Answer: (ii) Apriori

    Apriori is the classic algorithm for mining frequent itemsets. It uses the Apriori property — any subset of a frequent itemset must itself be frequent — to generate candidate itemsets level by level and prune unpromising ones against a minimum support threshold. The frequent itemsets it returns are then used to generate association rules evaluated by support, confidence and lift.

    K-means is a clustering algorithm, a decision tree is a supervised classification/prediction model, and Naive Bayes is a probabilistic classifier. None of them produces frequent itemsets, so (i), (iii) and (iv) are wrong.

  6. Q1(f). Which of the following classifiers uses a probabilistic approach to classification? (i) Decision tree (ii) Support vector machine (iii) Naive Bayes (iv) KNN20242m

    Module 3: Classification and Prediction

    Which of the following classifiers uses a probabilistic approach to classification?

    (i) Decision tree
    (ii) Support vector machine
    (iii) Naive Bayes
    (iv) KNN

    View this question on its own page →
    Worked Solution

    Answer: (iii) Naive Bayes

    Naive Bayes is explicitly probabilistic: it applies Bayes' theorem, P(C∣X)=P(X∣C) P(C)P(X)P(C \mid X) = \dfrac{P(X \mid C)\,P(C)}{P(X)}, assuming naively that features are conditionally independent given the class, and predicts the class with the maximum posterior probability. Its output can be read directly as class probabilities.

    A decision tree chooses splits by information gain or Gini impurity — a deterministic, rule-based model — and an SVM finds a maximum-margin hyperplane by convex optimisation, not by a probability model. KNN does give a rough frequency estimate through neighbour voting, but it has no underlying probabilistic model; the unambiguously probabilistic classifier here is Naive Bayes.

  7. Q1(g). Support vector machines (SVM) are mainly used for which type of tasks? (i) Regression (ii) Classification (iii) Clustering (iv) Association rule mining20242m

    Module 3: Classification and Prediction

    Support vector machines (SVM) are mainly used for which type of tasks?

    (i) Regression
    (ii) Classification
    (iii) Clustering
    (iv) Association rule mining

    View this question on its own page →
    Worked Solution

    Answer: (ii) Classification

    SVM is a supervised learning algorithm used mainly for classification. It finds the hyperplane w⋅x+b=0w \cdot x + b = 0 that separates the two classes with the maximum margin; prediction is then just the sign of w⋅x+bw \cdot x + b. SVM can be extended to regression (SVR) using an ε-insensitive loss, but classification is its primary and standard application.

    Clustering groups unlabelled data (unsupervised) and association rule mining discovers co-occurring items — neither is what SVM does. Since the question asks for the main use, regression (i) is not the best answer even though SVR exists.

  8. Q1(h). The main goal of clustering is to: (i) Classify data into known categories (ii) Find hidden patterns in data (iii) Predict future values (iv) Group data points into clusters with high intra-group similarity and low inter-group similarity20242m

    Module 4: Cluster Analysis

    The main goal of clustering is to:

    (i) Classify data into known categories
    (ii) Find hidden patterns in data
    (iii) Predict future values
    (iv) Group data points into clusters with high intra-group similarity and low inter-group similarity

    View this question on its own page →
    Worked Solution

    Answer: (iv) Group data points into clusters with high intra-group similarity and low inter-group similarity

    Clustering is an unsupervised task: its objective is to partition the data so that objects inside the same cluster are as similar as possible (high intra-cluster similarity) while objects belonging to different clusters are as dissimilar as possible (low inter-cluster similarity). Option (iv) states exactly this criterion, and it is formalised through similarity/distance measures and minimisation of the within-cluster sum of squares.

    'Find hidden patterns in data' (ii) is far too vague — it describes data mining as a whole, not clustering specifically. Classifying data into known categories (i) is classification, and predicting future values (iii) is prediction; both are supervised tasks requiring labelled data, so they are wrong.

  9. Q1(i). Which measure is typically used to assess the quality of clusters in K-means clustering? (i) Silhouette coefficient (ii) Precision (iii) Accuracy (iv) F1 score20242m

    Module 4: Cluster Analysis

    Which measure is typically used to assess the quality of clusters in K-means clustering?

    (i) Silhouette coefficient
    (ii) Precision
    (iii) Accuracy
    (iv) F1 score

    View this question on its own page →
    Worked Solution

    Answer: (i) Silhouette coefficient

    The silhouette coefficient is the standard internal quality measure for clusters. For a point ii, s(i)=b(i)−a(i)max⁡{a(i), b(i)}s(i) = \dfrac{b(i) - a(i)}{\max\{a(i),\,b(i)\}}, where a(i)a(i) is the average distance to points in its own cluster and b(i)b(i) is the average distance to points in the nearest neighbouring cluster. Values lie between −1-1 and 11; a value near 11 means the point is well matched to its own cluster and far from every other cluster. Averaging s(i)s(i) over all points — or repeating this for several values of kk and choosing the best average — is a common way to assess and tune K-means.

    Precision, accuracy and F1 score are label-based classification metrics: they need ground-truth classes to compare against. Clustering is unsupervised and has no ground-truth labels, so (ii), (iii) and (iv) do not apply.

  10. Q1(j). Outlier detection is important in clustering because: (i) Outliers can distort the cluster centroids (ii) Outliers improve the accuracy of clustering (iii) Should be included in all clusters (iv) Outliers do not affect the clustering process20242m

    Module 4: Cluster Analysis

    Outlier detection is important in clustering because:

    (i) Outliers can distort the cluster centroids
    (ii) Outliers improve the accuracy of clustering
    (iii) Should be included in all clusters
    (iv) Outliers do not affect the clustering process

    View this question on its own page →
    Worked Solution

    Answer: (i) Outliers can distort the cluster centroids

    K-means represents each cluster by its centroid, the arithmetic mean of the points assigned to it. The mean is highly sensitive to extreme values, so a single outlier lying far from the data bulk can pull a centroid toward itself, steal points from a genuine cluster, and inflate the within-cluster sum of squares — producing badly shaped or wrongly positioned clusters. Hence outlier detection (removal, or a robust variant such as K-medoids) is performed before and during clustering.

    Outliers do not improve clustering accuracy (ii); they should not automatically be absorbed into clusters (iii); and the claim that they have no effect on clustering (iv) is false, precisely because mean-based centroids are sensitive to them.

  11. Budget App•POCKETLY

    Pocketly on Android

    Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.

    Install Pocketly
  12. Q2(a). Describe the role of metadata in data warehousing and its importance in decision support systems.20247m

    Module 1: Data Warehousing and Business Analysis

    Describe the role of metadata in data warehousing and its importance in decision support systems.

    View this question on its own page →
    Worked Solution

    Role of Metadata in Data Warehousing

    Definition. Metadata is data about data: it describes the structure, origin, meaning, transformation history and usage of the data held in the warehouse. A warehouse without metadata is only a data dump — the numbers exist, but nobody can interpret them reliably.

    1. Types / content of metadata

    1. Technical metadata — table and column definitions, data types, keys and relationships, source-system details, ETL mappings, transformation and cleansing rules, load schedules and logs, indexes and partitions.
    2. Business metadata — business definitions and calculation rules (what exactly counts as 'net sales'?), units of measure, hierarchies, data owners.
    3. Operational metadata — who loaded what and when, job status, data-quality and error reports.
    4. Access / usage metadata — who queries which data, permissions, and usage statistics.

    2. Role of metadata in the warehouse

    1. Drives the ETL process — source-to-target mapping, cleansing rules and load scheduling are all described in metadata.
    2. Populates the metadata repository / system catalogue — the warehouse catalogue stores schemas, business terms and lineage so that data can be discovered and understood.
    3. Enables navigation — analysts use it to locate tables, understand relationships and interpret measures without reading underlying code.
    4. Ensures consistency — each business metric is defined once and reused, so different reports and dashboards cannot disagree.
    5. Provides lineage and auditability — a figure in a report can be traced back through every transformation to its source system.
    6. Supports administration and performance — indexing, aggregation, partitioning and storage decisions are informed by usage metadata.

    3. Importance in decision support systems (DSS)

    • Credibility of decisions — a manager trusts a recommendation only when the provenance and calculation of the numbers are known.
    • Self-service analysis — with a data dictionary and documented OLAP cubes, users can slice, dice and drill down on their own instead of depending on the DBA, which is what makes ad-hoc query and OLAP practical.
    • Data quality and timeliness — load logs and quality statistics show whether the data is fresh and complete before a decision is taken.
    • Change impact analysis — when a source system or a calculation rule changes, metadata reveals which reports and KPIs are affected.
    • Governance and compliance — ownership, retention and access rights are recorded, supporting audit and regulatory requirements.

    Conclusion

    Metadata is often called the backbone (or the nerve centre) of the data warehouse: ETL tools, the warehouse database, the OLAP engine and the front-end tools all consume it. For a DSS it is the layer that converts stored data into understandable, trustworthy information — which is why metadata is treated as a core component of every data warehouse.

  13. Q2(b). Discuss the concept of a star schema and snowflake schema in data warehouse design. Illustrate with an example.20247m

    Module 1: Data Warehousing and Business Analysis

    Discuss the concept of a star schema and snowflake schema in data warehouse design. Illustrate with an example.

    View this question on its own page →
    Worked Solution

    Star Schema and Snowflake Schema in Data Warehouse Design

    Definition. Both are dimensional modelling schemes: a central fact table holding measurable events (foreign keys plus measures) surrounded by dimension tables holding the context (who, what, where, when). They differ only in how the dimensions are normalised.

    1. Star schema

    • One fact table at the centre; each dimension is a single, denormalised table joined directly to the fact table.
    • The join pattern looks like a star; every query needs a fixed, small number of joins.
    • Attributes such as city, state and country repeat inside one store-dimension table — some redundancy, but simple and fast queries.

    2. Snowflake schema

    • The normalised form of the star: each dimension is split into several related tables following its hierarchy (Store → City → State → Country).
    • The join pattern looks like a snowflake; hierarchies are stored once, with no redundancy.
    • Saves storage and prevents update anomalies, but needs more joins, so queries are slower and the model is harder for end users to navigate.

    3. Comparison

    Basis Star schema Snowflake schema
    Normalisation Dimensions denormalised Dimensions normalised
    Structure Fact + one table per dimension Fact + several related dimension tables
    Joins per query Few More
    Query performance Faster Slower
    Storage Redundant, larger Less redundancy, smaller
    Design / maintenance Simple More complex
    Hierarchy integrity Repetition, possible inconsistency Clean, single source of truth
    Popularity Most common default Chosen for large / hierarchical dimensions

    4. Example — star schema for retail sales

    DimDate(dDateKey, day, month, year, quarter)        -----+
    DimProduct(prodKey, name, category, brand)          -----+---- FactSales(salesKey, dDateKey, prodKey,
    DimStore(storeKey, name, city, state, country)      -----+     storeKey, custKey, qty, amount)
    DimCustomer(custKey, name, segment)                 -----+
    

    FactSales carries the foreign keys plus the measures qty and amount; the dimensions supply the attributes used in filters, group-by and drill-down. For the snowflake version, DimStore is normalised into Store → City → State → Country and DimProduct into Product → Category, giving the flaked extension of the star.

    Conclusion

    Star = speed and simplicity; snowflake = storage efficiency and hierarchy integrity. Most warehouses begin with a star schema and snowflake a dimension only when it is very large or deeply hierarchical.

  14. Q3(a). Describe the various data preprocessing techniques involved in data mining.20247m

    Module 2: Data Mining Fundamentals and Association Rule Mining

    Describe the various data preprocessing techniques involved in data mining.

    View this question on its own page →
    Worked Solution

    Data Preprocessing Techniques in Data Mining

    Definition. Data preprocessing is the set of operations applied to raw data before mining, in order to improve data quality. Real-world data is typically incomplete, noisy, inconsistent and heterogeneous; mining on dirty data produces misleading results.

    1. Data cleaning

    1. Missing values — ignore the record, fill in manually, or infer automatically: a global constant, the attribute mean/mode, the most probable value (estimated via regression or a decision tree), or KNN imputation.
    2. Noise reduction — binning (equal-width / equal-depth), regression (fit a smooth curve to the data), clustering (points far from every cluster are treated as outliers and removed), or sorting followed by smoothing.
    3. Inconsistency and duplicates — resolve naming and code conflicts (CS vs Computer Sci), enforce domain and integrity checks, and remove duplicate records.

    2. Data integration

    • Combines data from several databases, flat files or cubes into a single store.
    • Schema integration — match entity and attribute names (cust-id with customer-id) and resolve structural conflicts.
    • Redundancy detection — correlation analysis, χ2\chi^2 tests and covariance identify duplicate or closely related attributes; highly correlated features can otherwise create spurious patterns.
    • Conflict resolution — reconcile different units, scales and encoding conventions (e.g. kilograms vs pounds) using metadata.

    3. Data reduction

    Obtain a smaller representation of the data while keeping the mined results essentially the same.

    • Dimensionality reduction — feature selection (relief, χ2\chi^2) and feature extraction (PCA, SVD, wavelets) to combat the curse of dimensionality.
    • Numerosity reduction — parametric methods (regression, log-linear models) or non-parametric methods (histograms, sampling, clustering).
    • Compression — lossless vs lossy compression (wavelets, principal components).
    • Generalisation — replace low-level values by higher-level concepts through a concept hierarchy (street → city → country).

    4. Data transformation

    • Normalisation — scale attributes to a common range, essential for distance-based methods such as KNN, K-means and SVM:
      • min–max: v′=v−min⁡max⁡−min⁡v' = \dfrac{v - \min}{\max - \min}
      • z-score: v′=v−vˉσv' = \dfrac{v - \bar{v}}{\sigma}
      • decimal scaling by a power of 10.
    • Encoding — binarisation / one-hot encoding of nominal attributes.
    • Aggregation — summarise daily sales into monthly or yearly totals.
    • Discretisation — equal-width or equal-depth (quantile) binning, or generalisation into intervals via concept hierarchies.
    • Feature construction — derive new meaningful attributes (e.g. BMI=weight/height2\text{BMI} = \text{weight} / \text{height}^2) to expose patterns that are hidden in the raw fields.

    Conclusion

    Preprocessing is iterative and typically occupies the majority of a project's effort (commonly quoted as 60–80%), but it is decisive: no classifier can rescue poorly prepared data, so cleaning, integration, reduction and transformation must be completed before any mining algorithm is run.

  15. Q3(b). What is support vector machine (SVM)? How does it differ from other classification methods?20247m

    Module 3: Classification and Prediction

    What is support vector machine (SVM)? How does it differ from other classification methods?

    View this question on its own page →
    Worked Solution

    Support Vector Machine (SVM)

    Definition. An SVM is a supervised (mainly binary) classification algorithm that learns the hyperplane

    w⋅x+b=0w \cdot x + b = 0

    which separates the two classes with the maximum margin.

    1. Maximum-margin idea

    • Many hyperplanes may separate two classes; SVM chooses the one farthest from the nearest point of each class — the margin, of width 2/∥w∥2/\|w\| for the canonical hyperplanes w⋅x+b=±1w \cdot x + b = \pm 1.
    • Hard-margin optimisation: min⁡w,b  12∥w∥2\min_{w,b} \; \tfrac{1}{2}\|w\|^2 subject to yi(w⋅xi+b)≥1y_i (w \cdot x_i + b) \ge 1 for every training point. Minimising ∥w∥2\|w\|^2 is the same as maximising the margin.
    • Soft margin — when the classes overlap, slack variables ξi≥0\xi_i \ge 0 are permitted with a penalty C∑iξiC \sum_i \xi_i; the parameter CC trades margin width against training error.
    • This is structural risk minimisation: a wider margin gives a better bound on generalisation error, so the model is not merely fitting the training set.

    2. Support vectors

    • The training points that lie on the margin (or violate it) are called support vectors.
    • Only the support vectors determine the hyperplane — deleting any other training point changes nothing, so the model is sparse and robust.
    • All other points can be discarded after training; prediction depends only on the support vectors, which keeps the stored model small.

    3. Kernel trick

    • If the data is not linearly separable, it is mapped by ϕ\phi into a higher-dimensional space in which a linear separator exists.
    • The kernel function K(xi,xj)=ϕ(xi)⋅ϕ(xj)K(x_i, x_j) = \phi(x_i) \cdot \phi(x_j) evaluates that inner product directly, without ever constructing ϕ\phi explicitly.
    • Common kernels: linear x⋅yx \cdot y, polynomial (x⋅y+c)d(x \cdot y + c)^d, RBF / Gaussian exp⁡(−γ ∥x−y∥2)\exp(-\gamma \, \|x - y\|^2), and sigmoid.
    • Kernels let SVM model complex non-linear decision boundaries at modest computational cost.

    4. Comparison with other classifiers

    Aspect SVM Decision tree Naive Bayes KNN
    Core idea Max-margin hyperplane Recursive attribute splits Bayes' rule + independence Vote of k nearest points
    Non-linearity Kernel trick Inherent (axis-parallel splits) Limited Inherent
    High-dimensional data Very good Overfits easily Good Suffers from distance concentration
    Training cost High (quadratic programming) Low Very low None (lazy learner)
    Prediction cost Low (only support vectors) Low Low High (scans training set)
    Robustness to noise Soft margin absorbs it Sensitive Moderate Very sensitive
    Interpretability Low (black box) High (readable rules) Medium Low

    5. Merits and limitations

    • Advantages — performs well in high dimensions, memory-efficient (stores only support vectors), solves a convex problem with a unique global optimum, and has strong theoretical generalisation guarantees.
    • Limitations — training is slow on very large datasets, results are sensitive to the choice of kernel and CC, the formulation is inherently binary (multiclass handled by one-vs-one or one-vs-rest), and it does not naturally output calibrated probabilities.

    Conclusion

    SVM recasts classification as a convex quadratic optimisation problem with a unique global solution, maximises the separating margin, and extends to non-linear boundaries through the kernel trick — the reasons it became one of the most reliable classifiers for medium-sized, high-dimensional datasets.

  16. Q4(a). What is the importance of model-based clustering methods? Provide examples of commonly used models.20247m

    Module 4: Cluster Analysis

    What is the importance of model-based clustering methods? Provide examples of commonly used models.

    View this question on its own page →
    Worked Solution

    Model-Based Clustering: Importance and Commonly Used Models

    Definition. Model-based clustering assumes that the observed data is generated by a finite mixture of underlying probability distributions. It estimates the number of clusters together with the parameters of each component, so clustering becomes a problem of statistical model fitting rather than purely geometric partitioning.

    1. Importance of model-based clustering

    1. Probabilistic, not just geometric. Every object receives a posterior membership probability P(zi=k∣xi)P(z_i = k \mid x_i), which quantifies clustering uncertainty — something hard-partition methods such as k-means cannot provide.
    2. Flexible cluster shapes. Giving each component its own covariance matrix lets the model represent elliptical, elongated and differently oriented clusters, whereas k-means implicitly assumes spherical clusters of equal size.
    3. Automatic choice of K. Criteria such as BIC, AIC or ICL select the number of clusters from the data instead of trial-and-error runs with different values of kk.
    4. Statistical rigour. Parameters are estimated by maximum likelihood (usually the EM algorithm), giving a well-defined objective function, convergence behaviour and a basis for comparing competing models.
    5. Extra capabilities. The same framework supports imputation of missing values, soft classification, outlier detection and discriminant analysis.
    6. Interpretability. The fitted means, covariances and mixing proportions directly describe every cluster.

    2. Commonly used models

    Model family Component distribution Typical data / use
    Gaussian (normal) mixture model N(μk,Σk)\mathcal{N}(\mu_k, \Sigma_k) Continuous data with elliptical clusters — the most common choice
    Multinomial mixture Multinomial Text/document clustering over word-count vectors
    Bernoulli mixture Bernoulli Binary data: market-basket and click indicators
    Poisson mixture Poisson Count data such as arrivals or call volumes
    Student-t mixture tt-distribution Robust clustering when outliers are present
    Latent class model Categorical Survey responses and categorical attributes
    Hidden Markov model States plus emissions Temporal data: speech, video, biosequences

    3. Fitting the models (EM outline)

    1. Initialise means mu_k, covariances Sigma_k and weights pi_k
    2. E-step: responsibility r_ik = P(z_i = k | x_i, theta)
    3. M-step: update mu_k, Sigma_k, pi_k as weighted averages
    4. Repeat until the log-likelihood stops increasing
    5. Select K by maximising BIC = 2*logL - p*log(n)
    

    4. Typical applications

    Customer segmentation with soft memberships, image segmentation, fraud detection, gene-expression analysis and topic modelling.

    Conclusion: model-based clustering turns clustering into a principled statistical inference problem — flexible shapes, honest uncertainty and an objective way to choose the number of clusters.

  17. Q4(b). Apply the K-means algorithm to a small dataset and demonstrate how clusters are formed.20247m

    Module 4: Cluster Analysis

    Apply the K-means algorithm to a small dataset and demonstrate how clusters are formed.

    View this question on its own page →
    Worked Solution

    Applying the K-Means Algorithm to a Small Dataset

    Definition. K-means is a partitioning (centroid-based) algorithm that splits nn objects into kk clusters by minimising the within-cluster sum of squares

    J=∑c=1k∑xi∈Cc∥xi−μc∥2J = \sum_{c=1}^{k}\sum_{x_i \in C_c} \lVert x_i - \mu_c \rVert^2

    where μc\mu_c is the centroid of cluster CcC_c.

    1. The dataset

    The question leaves the data open, so we take k=2k = 2 and these six 2-D points:

    Point Coordinates
    P1 (1, 1)
    P2 (2, 1)
    P3 (1, 2)
    P4 (8, 8)
    P5 (9, 8)
    P6 (8, 9)

    2. Algorithm steps

    1. Choose the number of clusters kk and pick kk initial centres.
    2. Assign every point to the centre with the smallest Euclidean distance d=(x2−x1)2+(y2−y1)2d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}.
    3. Recompute each centre as the mean of the points assigned to it.
    4. Repeat steps 2-3 until no point changes its cluster.

    3. Initialisation

    Initial centres: C1=P1=(1,1)C_1 = P1 = (1, 1) and C2=P4=(8,8)C_2 = P4 = (8, 8).

    4. Iteration 1 - assignment

    Point d(⋅,C1)d(\cdot, C_1) d(⋅,C2)d(\cdot, C_2) Nearest centre
    P1 (1,1) 0.00 9.90 C1C_1
    P2 (2,1) 1.00 9.22 C1C_1
    P3 (1,2) 1.00 9.22 C1C_1
    P4 (8,8) 9.90 0.00 C2C_2
    P5 (9,8) 10.63 1.00 C2C_2
    P6 (8,9) 10.63 1.00 C2C_2

    Check: d(P2,C2)=(8−2)2+(8−1)2=36+49=85≈9.22d(P2, C_2) = \sqrt{(8-2)^2 + (8-1)^2} = \sqrt{36+49} = \sqrt{85} \approx 9.22.

    Recomputed centres:

    μ1=(1+2+13, 1+1+23)=(1.33, 1.33)\mu_1 = \left(\frac{1+2+1}{3},\ \frac{1+1+2}{3}\right) = (1.33,\ 1.33)

    μ2=(8+9+83, 8+8+93)=(8.33, 8.33)\mu_2 = \left(\frac{8+9+8}{3},\ \frac{8+8+9}{3}\right) = (8.33,\ 8.33)

    5. Iteration 2 - assignment with the new centres

    Point d(⋅,C1)d(\cdot, C_1) d(⋅,C2)d(\cdot, C_2) Nearest centre
    P1 (1,1) 0.47 10.37 C1C_1
    P2 (2,1) 0.75 9.69 C1C_1
    P3 (1,2) 0.75 9.69 C1C_1
    P4 (8,8) 9.43 0.47 C2C_2
    P5 (9,8) 10.16 0.75 C2C_2
    P6 (8,9) 10.16 0.75 C2C_2

    Check: d(P1,C1)=(1−1.33)2+(1−1.33)2=0.109+0.109≈0.47d(P1, C_1) = \sqrt{(1-1.33)^2 + (1-1.33)^2} = \sqrt{0.109 + 0.109} \approx 0.47.

    Membership is identical to iteration 1, the recomputed centres do not move, so the algorithm converges after 2 iterations.

    6. Final result

    K-means result (k = 2)
    ----------------------
    Cluster 1 : centre (1.33, 1.33) -> P1(1,1), P2(2,1), P3(1,2)
    Cluster 2 : centre (8.33, 8.33) -> P4(8,8), P5(9,8), P6(8,9)
    Iterations : 2  (no membership change after iteration 2)
    

    7. Points an examiner rewards

    • The result is only a local optimum of JJ; k-means++ initialises centres that are well spread out.
    • It produces spherical, similarly sized clusters only — non-convex shapes are not found and outliers get no label.
    • Empty clusters must be repaired, e.g. re-seeded from the farthest point.
    • Choose kk with the elbow method or the silhouette coefficient; cost is O(n⋅k⋅i)O(n \cdot k \cdot i) for ii iterations.
  18. Q5(a). What are the challenges of mining multimedia data? Discuss some techniques used for multimedia data mining.20247m

    Module 5: Mining Object, Spatial, Multimedia, Text and Web Data

    What are the challenges of mining multimedia data? Discuss some techniques used for multimedia data mining.

    View this question on its own page →
    Worked Solution

    Challenges and Techniques of Multimedia Data Mining

    Definition. Multimedia data mining is the process of discovering interesting patterns, structures and knowledge from multimodal, largely unstructured data such as images, audio, video, graphics and text.

    1. Challenges

    1. Heterogeneity. Different media have completely different formats, structures and feature spaces, so neither a single schema nor a single distance measure fits all of them.
    2. Unstructured nature. Multimedia objects carry no predefined schema or attributes; standard relational mining techniques do not apply directly.
    3. The semantic gap. Low-level feature values (pixel intensities, colour histograms, MFCC coefficients) do not map directly onto the high-level meaning a user has in mind, such as a dog, a goal or a mood.
    4. High dimensionality. Descriptors such as SIFT, HOG or deep CNN embeddings produce hundreds or thousands of dimensions per object, triggering the curse of dimensionality.
    5. Volume. Video and audio streams generate data at very high rates, so storage, indexing and bandwidth become bottlenecks.
    6. Temporal and spatial correlation. Successive video frames are highly redundant and audio samples are correlated, so the effective sample size is far smaller than the raw record count suggests.
    7. Variability and noise. Changes in viewpoint, lighting, scale and background, plus compression artefacts, degrade feature stability.
    8. Scarce labelled data. Manual annotation is expensive, so supervised learners often lack enough ground truth.

    2. Techniques used

    Technique Idea / representative methods
    Content-based image retrieval (CBIR) Match images by colour histograms, texture (Gabor, GLCM), shape descriptors and keypoints such as SIFT/SURF/ORB
    Feature extraction and descriptors Standardised descriptors such as MPEG-7 visual and aural features
    Audio mining MFCCs, spectrograms, pitch and energy features; speech-to-text followed by text mining
    Video mining Shot and scene detection, keyframe extraction, temporal segmentation, activity recognition
    Text and metadata mining Mine captions, tags and OCR-extracted text; NLP for semantic annotation
    Deep learning CNNs for images, RNNs/transformers for sequences, autoencoders and transfer learning to obtain embeddings
    Similarity search and indexing KD-trees, locality-sensitive hashing for fast approximate nearest-neighbour retrieval
    Multimodal fusion Combine visual, audio and textual features by early or late fusion for joint analysis
    Clustering and classification Group visually or semantically similar objects; supervised models on annotated examples

    3. Typical workflow

    1. Ingest the media and extract features or learned embeddings.
    2. Reduce dimensionality (e.g. PCA) and index the feature vectors.
    3. Run the mining tasks: clustering, classification, similarity retrieval, summarisation.
    4. Narrow the semantic gap using user feedback and domain knowledge.

    Conclusion: the central difficulty is the semantic gap compounded by scale and dimensionality; modern practice answers it with robust descriptors, deep embeddings and multimodal fusion.

  19. Q5(b). Discuss the challenges involved in mining web data and the techniques used to address them.20247m

    Module 5: Mining Object, Spatial, Multimedia, Text and Web Data

    Discuss the challenges involved in mining web data and the techniques used to address them.

    View this question on its own page →
    Worked Solution

    Challenges in Mining Web Data and the Techniques that Address Them

    Definition. Web data mining is the discovery of useful patterns and knowledge from web content, web structure (hyperlinks) and web usage (clickstreams), covering the three sub-areas content mining, structure mining and usage mining.

    1. Challenges

    1. Heterogeneity. Web sources differ in format, language, schema and encoding, so data arriving from many sites has to be reconciled before it can be mined.
    2. Unstructured and semi-structured content. HTML pages have no fixed schema; useful facts are mixed with navigation, ads and layout markup.
    3. Sheer volume and rapid growth. The Web is huge and its content changes constantly, so crawlers and indexes must scale and stay fresh.
    4. Noise, irrelevance and spam. Keyword stuffing, link farms and irrelevant blocks pollute both the text and the link graph.
    5. Redundancy. The same fact or near-identical documents appear on many sites, inflating counts and distorting associations.
    6. Graph nature of data. Pages are connected by hyperlinks, so the independence assumptions of classical mining do not hold.
    7. Diversity of users and context. The same page serves many audiences, so results must be personalised and context aware.
    8. Privacy, security and access limits. Login walls, robots rules and sensitive personal data restrict what may be collected and stored.

    2. Techniques used to address them

    Challenge Technique
    Scale and growth Focused/declarative crawling, distributed crawlers, incremental and update-aware indexing
    Unstructured text Information extraction, NLP, DOM-aware parsing, wrappers that lift structured records out of HTML
    Redundancy and quality Near-duplicate detection (shingling, MinHash), deduplication, spam and boilerplate filtering
    Finding important pages Link analysis: PageRank and HITS, using hyperlink structure as a popularity vote
    Organisation of pages Web page classification and clustering with TF-IDF features plus link-based refinements
    User behaviour Web usage mining: sessionisation of clickstreams, Markov models, sequential pattern mining
    Integration of sources Record linkage, schema matching and data fusion across heterogeneous sites
    Retrieval at scale Inverted indexes, TF-IDF/BM25 ranking and search-engine query processing

    3. Example workflow

    1. Crawl a focused set of pages under the robots rules.
    2. Clean each page: strip boilerplate, extract the main text and any structured records.
    3. Filter duplicates and spam; build a link graph and compute PageRank.
    4. Classify pages by topic, cluster similar ones, then mine usage sessions for behaviour patterns.

    Conclusion: web mining is hard mainly because the data is heterogeneous, huge, noisy and interconnected; crawling control, text and link analysis, deduplication and usage mining are the standard answers to those four difficulties.

  20. Q6(a). Discuss density-based clustering methods with a focus on DBSCAN.20247m

    Module 4: Cluster Analysis

    Discuss density-based clustering methods with a focus on DBSCAN.

    View this question on its own page →
    Worked Solution

    Density-Based Clustering with a Focus on DBSCAN

    Definition. Density-based clustering groups objects that are connected by regions of high point density, separated by regions of low density. DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is the classic algorithm of this family.

    1. Key definitions

    • ε\varepsilon-neighbourhood: Nε(p)={q∣d(p,q)≤ε}N_\varepsilon(p) = \{q \mid d(p,q) \le \varepsilon\}, the set of all points within radius ε\varepsilon of pp (the point pp itself is counted).
    • Core point: pp is a core point if ∣Nε(p)∣≥minPts|N_\varepsilon(p)| \ge \text{minPts}.
    • Border point: pp lies inside the ε\varepsilon-neighbourhood of at least one core point but is not itself a core point.
    • Noise (outlier): pp is neither core nor border, so it is not assigned to any cluster.
    • Reachability: qq is directly density-reachable from pp if q∈Nε(p)q \in N_\varepsilon(p) and pp is core; density-reachability is the transitive chain of such steps, and two points are density-connected when both are reachable from a common core point.

    2. Parameters

    • ε\varepsilon (eps): the neighbourhood radius. Too small leaves everything as noise; too large merges distinct clusters. It is often chosen from the elbow of a k-distance plot.
    • minPts: the minimum number of points required to form a dense region. A common rule of thumb is minPts≥d+1\text{minPts} \ge d + 1 for dimensionality dd; values of 4 or 2d2d are typical.

    3. Algorithm steps

    DBSCAN(D, eps, minPts)
      for each point p in D:
        if p is already labelled: continue
        N = region_query(p, eps)            # all points within eps of p
        if |N| < minPts: label p as NOISE
        else:
          create new cluster C; move p from noise into C
          seeds = N minus p
          for each q in seeds:
            if q is labelled NOISE: relabel q as a border point of C
            if q is labelled UNVISITED: label q as a member of C
            Nq = region_query(q, eps)
            if |Nq| >= minPts:              # q is core, grow the cluster
              add Nq to seeds
    

    4. Worked illustration

    Points on a line, ε=1.5\varepsilon = 1.5, minPts=3\text{minPts} = 3:

    Point Co-ordinate Neighbourhood size Type Final cluster
    p1 0 2 (p1, p2) border C1
    p2 1 3 (p1, p2, p3) core C1
    p3 2 3 (p2, p3, p4) core C1
    p4 3 2 (p3, p4) border C1
    p5 10 2 (p5, p6) border C2
    p6 11 3 (p5, p6, p7) core C2
    p7 12 2 (p6, p7) border C2
    p8 20 1 (p8) noise none

    Processing: p1 alone is too sparse and is first marked as noise; then p2 is found to be a core point, opens cluster C1 and pulls in p1, p3 and p4 (p1 is relabelled as a border point and p3, being core, brings in its neighbour p4). p5 is likewise first flagged as noise and only absorbed when core point p6 opens C2. p8 has no neighbours within ε\varepsilon and remains noise.

    Result: C1={p1,p2,p3,p4}C1 = \{p1, p2, p3, p4\}, C2={p5,p6,p7}C2 = \{p5, p6, p7\}, noise ={p8}= \{p8\}.

    5. DBSCAN vs k-means

    Criterion DBSCAN k-means
    Cluster shape Arbitrary, non-convex shapes Spherical only
    Number of clusters Discovered automatically from density Must be supplied as kk
    Outliers Explicitly detected as noise Forced into some cluster
    Varying densities Fails when cluster densities differ greatly Copes better with unequal sizes
    Parameters ε\varepsilon, minPts kk, initialisation
    Complexity O(nlog⁡n)O(n \log n) with a spatial index, O(n2)O(n^2) naively O(nkt)O(nkt)
    Main sensitivity To ε\varepsilon and minPts To the choice of seeds

    Extensions: OPTICS produces an ordering that removes the need to fix ε\varepsilon in advance, and HDBSCAN handles clusters of differing density.

  21. Q6(b). Define lazy learners and discuss how K-nearest neighbors (KNN) is used for classification.20247m

    Module 3: Classification and Prediction

    Define lazy learners and discuss how K-nearest neighbors (KNN) is used for classification.

    View this question on its own page →
    Worked Solution

    Lazy Learners and K-Nearest Neighbour Classification

    Definition. A lazy learner (instance-based learner) performs no, or almost no, generalisation during training: training only stores the labelled instances, and all computation is deferred until a prediction is requested. KNN is the standard example.

    1. Lazy vs eager learners

    Aspect Lazy learner (KNN) Eager learner (decision tree, neural net)
    Training phase Stores the data only; very fast Builds an explicit model; slower
    Prediction phase Expensive: queries the whole training set Cheap: one traversal of the model
    Model built None, the data is the model Explicit rules, nodes or weights
    Incremental data Added instantly, no retraining Usually requires rebuilding
    Interpretability Low unless KK is tiny Generally higher
    Main weakness Irrelevant features and feature scale Rigid model assumptions

    Lazy learners adapt naturally to the local shape of the decision boundary but pay for it at query time; eager learners summarise the data, which is faster to use but may miss local detail.

    2. KNN algorithm for classification

    1. Choose the number of neighbours KK (an odd value avoids ties in two-class problems) and a distance metric, Euclidean by default.
    2. Standardise or normalise the features so that one attribute does not dominate the distance.
    3. For a new instance xx, compute the distance d(x,xi)d(x, x_i) to every training instance.
    4. Select the KK instances with the smallest distances.
    5. Vote: assign the majority class; in weighted voting each neighbour contributes 1/d1/d or 1/d21/d^2.

    y^=arg⁡max⁡c∑i∈NK(x)wi 1[yi=c],wi=1d(x,xi)\hat{y} = \arg\max_c \sum_{i \in N_K(x)} w_i \, \mathbb{1}[y_i = c], \qquad w_i = \frac{1}{d(x, x_i)}

    3. Worked mini-example

    Training point x1x_1 x2x_2 Class
    A 1 2 +
    B 2 3 +
    C 3 1 -
    D 6 5 -
    E 7 6 -

    Classify T=(5,4)T = (5, 4) with K=3K = 3:

    Point Distance to T
    D 12+12=1.41\sqrt{1^2+1^2} = 1.41
    E 22+22=2.83\sqrt{2^2+2^2} = 2.83
    B 32+12=3.16\sqrt{3^2+1^2} = 3.16
    C 22+32=3.61\sqrt{2^2+3^2} = 3.61
    A 42+22=4.47\sqrt{4^2+2^2} = 4.47

    The nearest three are D (-), E (-) and B (+); the majority class is -, so TT is classified as -.

    4. Practical remarks

    • Small KK gives a jagged, high-variance boundary (with K=1K = 1 there is zero training error but overfitting); large KK smooths the boundary and can wash out small clusters.
    • KNN is non-parametric, handles multiple classes naturally and needs essentially no training time.
    • Its weaknesses: prediction costs O(nd)O(nd), the whole data set must be kept in memory, and accuracy degrades as dimensionality grows (curse of dimensionality).
    • Acceleration structures include KD-trees, ball trees and approximate nearest-neighbour search; distance-weighted voting limits the damage done by distant neighbours.
  22. Budget App•POCKETLY

    Pocketly on Android

    Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.

    Install Pocketly
  23. Q7(a). Explain the difference between partitioning methods and hierarchical methods in cluster analysis.20247m

    Module 4: Cluster Analysis

    Explain the difference between partitioning methods and hierarchical methods in cluster analysis.

    View this question on its own page →
    Worked Solution

    Partitioning Methods vs Hierarchical Methods in Cluster Analysis

    Definition. Partitioning methods decompose the data set directly into a fixed number of non-overlapping clusters, while hierarchical methods build a nested hierarchy of clusters, usually displayed as a dendrogram, and reach a partition by cutting that tree.

    1. Partitioning methods

    • Idea: one flat partition of nn objects into kk clusters, kk specified in advance.
    • Representative algorithms: k-means (centroid), k-medoids/PAM (representative object), CLARA and CLARANS for large data, k-modes for categorical data.
    • Typical criterion: minimise the within-cluster sum of squares J=∑c=1k∑xi∈Cc∥xi−μc∥2J = \sum_{c=1}^{k}\sum_{x_i \in C_c} \lVert x_i - \mu_c \rVert^2 by iterative relocation: assign, recompute, repeat until no change.
    • Properties: fast (O(nkt)O(nkt) for k-means), simple, but produces only one flat solution, is sensitive to initialisation and to outliers, and tends to find spherical clusters of similar size.

    2. Hierarchical methods

    • Idea: produce a sequence of nested partitions rather than one; no kk needed up front.
    • Agglomerative (bottom-up): start with nn singletons, repeatedly merge the two closest clusters until one remains.
    • Divisive (top-down): start with all data in one cluster and recursively split it.
    • Linkage criteria: single (minimum distance between clusters, chaining effect), complete (maximum distance), average (UPGMA), Ward (minimum increase in within-cluster variance).
    • Properties: yields a dendrogram, reveals structure at every granularity, is deterministic, but costs O(n2log⁡n)O(n^2 \log n) or O(n3)O(n^3) time and O(n2)O(n^2) memory, and merges once made are irreversible.
    Dendrogram (agglomerative)
    
    |                  +---- P6
    |             +----+---- P5
    |        +----+----+---- P4
    |   +----+----+---- P3
    +---+----+----+---- P2
        +----+----+---- P1
        |         |         |\    height -> distance at which clusters merge
    

    3. Comparison

    Criterion Partitioning (k-means) Hierarchical (agglomerative)
    Output One flat partition Nested hierarchy / dendrogram
    Number of clusters kk Must be fixed in advance Chosen afterwards by cutting the tree
    Approach Iterative relocation of assignments Greedy merging or splitting
    Reversibility Reassignments allowed, non-monotonic Merges are permanent and monotonic
    Repeatability Depends on random seeds Deterministic for a fixed linkage
    Scalability O(nkt)O(nkt), good for large nn O(n2log⁡n)O(n^2 \log n), poor for very large nn
    Cluster shape Spherical, similar sizes Any shape, depends on linkage
    Outliers Absorbed into clusters Can be isolated early as singleton branches
    Interpretability Centroids only Full dendrogram of relationships

    4. When to use which

    Use partitioning when the data is large, kk is known (e.g. kk customer segments) and a single flat answer is enough. Use hierarchical methods when the nesting itself is the insight — taxonomy building, gene-family trees, or when kk is unknown and the analyst will decide by cutting the dendrogram. Bisecting k-means and BIRCH combine the two ideas: BIRCH builds a compact summary tree first and then partitions it.

  24. Q7(b). Describe the role of dimensionality reduction in data mining. Why is it important, and what are some common methods for dimensionality reduction?20247m

    Module 2: Data Mining Fundamentals and Association Rule Mining

    Describe the role of dimensionality reduction in data mining. Why is it important, and what are some common methods for dimensionality reduction?

    View this question on its own page →
    Worked Solution

    Dimensionality Reduction: Role, Importance and Common Methods

    Definition. Dimensionality reduction is the transformation of data from a high-dimensional feature space Rd\mathbb{R}^d into a lower-dimensional space Rd′\mathbb{R}^{d'} with d′≪dd' \ll d, while preserving as much of the relevant information as possible.

    1. Role and importance

    1. Combats the curse of dimensionality. As dd grows, points become sparse, distances lose contrast and density estimates become unreliable; reducing dd restores meaningful geometry.
    2. Removes noise and redundancy. Correlated or irrelevant attributes add variance without signal; dropping them often improves accuracy.
    3. Reduces overfitting. Fewer parameters mean a simpler model with better generalisation (bias-variance trade-off).
    4. Cuts cost. Storage, distance computation and model training all scale with dd; O(nd)O(nd) becomes O(nd′)O(nd').
    5. Enables visualisation. Projecting to 2-D or 3-D lets analysts see clusters and outliers directly.
    6. Improves interpretability. A handful of components or selected features is easier to explain than thousands of raw variables.

    2. Common methods

    Method Type One-line description
    PCA Linear, unsupervised extraction Projects onto eigenvectors (principal components) of the covariance matrix that capture the most variance
    SVD Linear, unsupervised extraction Factorises X=UΣVTX = U\Sigma V^T; the leading singular vectors give a low-rank approximation of the data
    Factor analysis Linear, probabilistic Explains observed variables through a few uncorrelated latent factors plus noise
    ICA Linear, unsupervised Finds statistically independent, non-Gaussian source signals (e.g. separating mixed audio)
    LDA Linear, supervised extraction Maximises class separability by maximising between-class over within-class scatter
    Multidimensional scaling (MDS) Distance preserving Places points in low dimensions so pairwise distances are kept as intact as possible
    t-SNE / UMAP Non-linear Preserve local neighbourhood structure for cluster visualisation in 2-D/3-D
    Autoencoders Non-linear, neural A bottleneck network learns a compressed code by reconstructing its input
    Random projection Linear, random Projects with a random matrix; the Johnson-Lindenstrauss lemma guarantees distances are roughly preserved
    Filter feature selection Selection Rank attributes by correlation, mutual information or chi-square and keep the top ones
    Wrapper feature selection Selection Search attribute subsets by evaluating a learner (forward, backward, recursive feature elimination)
    Embedded feature selection Selection Selection happens inside training, e.g. L1 (lasso) regularisation
    Wavelet transform Signal/multi-resolution Decomposes a signal into scaled and shifted wavelets, keeping only the significant coefficients

    3. Two families: extraction vs selection

    • Feature extraction creates new, compact attributes (PCA, SVD, LDA, autoencoders): maximum compression, but the new features are combinations and lose direct meaning.
    • Feature selection keeps a subset of the original attributes (filters, wrappers, embedded): retains interpretability but may discard correlated information.

    4. PCA in four steps

    1. Standardise each feature to zero mean and unit variance.
    2. Compute the covariance matrix Σ=1n−1XTX\Sigma = \frac{1}{n-1}X^TX.
    3. Take eigenvectors of Σ\Sigma and sort by eigenvalue; eigenvalue λj\lambda_j is the variance explained by component jj.
    4. Keep the top d′d' components and project X′=XWX' = XW, choosing d′d' so that ∑j=1d′λj/∑jλj\sum_{j=1}^{d'}\lambda_j / \sum_j \lambda_j exceeds a chosen threshold such as 95%.

    Conclusion: dimensionality reduction is essential preprocessing — it makes mining faster, cleaner and often more accurate, and the right choice depends on whether the goal is compression, visualisation, interpretability or supervised discrimination.

  25. Q8(a). Explain the difference between classification and clustering. Provide examples where each technique would be more appropriate.20247m

    Module 3: Classification and Prediction

    Explain the difference between classification and clustering. Provide examples where each technique would be more appropriate.

    View this question on its own page →
    Worked Solution

    Classification vs Clustering

    Definitions. Classification is supervised learning: given a set of records already labelled with predefined classes, it builds a model that predicts the class of unseen records. Clustering is unsupervised learning: it groups records into clusters so that objects within a cluster are similar to each other and dissimilar to those in other clusters, with no labels available.

    1. Key differences

    Criterion Classification Clustering
    Learning type Supervised Unsupervised
    Input data Training set with class labels Unlabelled data
    Goal Predict the class of new objects Discover natural groupings in the data
    Output A classifier (decision tree, rules, network) A partition, hierarchy or density-based groups
    Evaluation Accuracy, precision, recall, F1, ROC Internal: silhouette, purity, within-cluster SSE; external: Rand index
    Predefined classes? Yes, fixed in advance No, number and meaning of clusters emerge from data
    Feedback Errors correct the model (backpropagation, pruning) No notion of error, only an objective to optimise
    Typical algorithms Decision trees, Naive Bayes, KNN, SVM, neural networks k-means, hierarchical, DBSCAN, Gaussian mixtures
    Cost of labelling Requires expensive labelled examples Needs no labels

    2. Where each is more appropriate

    Classification suits problems where the categories are already known and the objective is prediction:

    • Spam detection: classify email as spam or not spam from labelled messages.
    • Credit approval: predict good/bad payers from historical applications.
    • Disease diagnosis: assign a patient to a diagnosis from symptoms and test results.
    • Customer churn: predict which subscriber will cancel, so the model must generalise to future customers.

    Clustering suits problems where the categories are unknown or must be discovered:

    • Customer segmentation: group buyers by purchase behaviour before designing targeted campaigns.
    • Document grouping: organise news articles or research papers into topics with no prior taxonomy.
    • Image segmentation: partition an image into homogeneous regions by pixel colour and texture.
    • Anomaly/fraud detection: points that do not belong to any dense cluster are flagged as outliers.
    • Exploratory analysis: first-pass structure discovery when labels do not exist at all.

    3. How they relate

    Clustering can feed classification: clusters may be labelled after inspection and used as classes, or cluster indices added as new features. Conversely, classification with labelled data can validate clusters (external validation). Between the two lie semi-supervised methods that exploit a small number of labels together with unlabelled data.

    Conclusion: the deciding question is do the class labels already exist? If yes and prediction on new cases matters, classify; if no and the aim is to uncover structure, cluster.

  26. Q8(b). What is OLAP and how does it support decision-making in organizations? Provide real-world examples of OLAP applications.20247m

    Module 1: Data Warehousing and Business Analysis

    What is OLAP and how does it support decision-making in organizations? Provide real-world examples of OLAP applications.

    View this question on its own page →
    Worked Solution

    OLAP and Its Role in Organisational Decision-Making

    Definition. OLAP (Online Analytical Processing) is a technology for fast, interactive, multidimensional analysis of summarised data held in a data warehouse. It presents data as an OLAP cube whose dimensions are business perspectives (time, product, region, customer), whose cells hold measures (sales, revenue, quantity) and whose dimensions are organised into hierarchies (day →\to month →\to quarter →\to year).

    1. Core operations

    Operation Meaning Example
    Roll-up (aggregation) Climb up a hierarchy, summarise Store sales →\to regional sales
    Drill-down Descend a hierarchy, refine Year →\to quarter →\to month sales
    Slice Fix one dimension Sales for the year 2024 only
    Dice Fix a sub-cube on several dimensions Sales of electronics in the north region
    Pivot (rotate) Reorient the cube Swap product and time axes

    2. How OLAP supports decision-making

    1. Multidimensional view. Managers see the same measure from any angle — region by product by month — instead of flat reports.
    2. Speed. Pre-aggregated summaries (materialised cubes) give sub-second responses, so what-if questions can be asked interactively.
    3. Drill-through detail. A KPI anomaly at the summary level can be traced down to the underlying transaction.
    4. Trend and comparison analysis. Time hierarchies expose seasonality, growth and year-on-year comparison.
    5. Consistency. All departments read the same governed numbers, so reports agree.
    6. Integration with dashboards and data mining. OLAP supplies clean aggregated features for forecasting, association rules and reporting tools.

    3. Real-world examples

    • Retail: a supermarket chains analyses sales by store →\to region, product category →\to SKU and week; roll-up identifies underperforming regions, drill-down finds the specific SKUs responsible, informing stocking and pricing.
    • Banking: a bank rolls up portfolio value by branch and product, slices by risk class and drills into delinquent loans for credit decisions.
    • Telecom: call-volume cubes by plan, region and hour support capacity planning and churn campaigns.
    • Healthcare / insurance: claim costs by hospital, treatment and patient group support cost control and fraud review.
    • Manufacturing / supply chain: inventory by warehouse, part and day supports reorder and supplier decisions.

    4. Types of OLAP servers

    Type Storage Trade-off
    Multidimensional (MOLAP) Native cube array Fastest queries, data duplicated
    Relational (ROLAP) Star/snowflake schema in the RDBMS Scales to large detail data, slower aggregates
    Hybrid (HOLAP) Aggregates in MOLAP, detail in ROLAP Balances both

    Conclusion: OLAP turns raw warehouse data into an interactive multidimensional model, so managers can summarise, compare and trace figures quickly — which is why it remains a core tool for analytical decision support alongside OLTP, which only handles day-to-day transactions.

  27. Q9(a). What is the curse of dimensionality in the context of clustering high-dimensional data? How do model-based clustering methods help address this issue?20247m

    Module 4: Cluster Analysis

    What is the curse of dimensionality in the context of clustering high-dimensional data? How do model-based clustering methods help address this issue?

    View this question on its own page →
    Worked Solution

    Curse of Dimensionality in Clustering and How Model-Based Methods Cope

    Definition. The curse of dimensionality refers to the phenomena that appear when the number of attributes dd becomes large: statistical, geometric and computational techniques that work in low dimensions break down.

    1. What goes wrong in high dimensions

    1. Distance concentration. For random points, the difference between the nearest and farthest neighbour shrinks relative to the distances themselves. If dmaxd_{max} and dmind_{min} are the farthest and nearest distances from a query point, then the relative contrast R=(dmax−dmin)/dminR = (d_{max} - d_{min})/d_{min} tends to 0 as d→∞d \to \infty: all points become almost equidistant, so nearest-neighbour, k-means and density-based rules lose their discriminating power.
    2. Sparsity of the space. The volume of a unit hypercube grows as 1d1^d exponentially, while data samples grow only linearly. To keep the same occupancy one would need exponentially many points, so observed data occupies a vanishing fraction of the space — clusters that look dense in 2-D become empty regions in high dd.
    3. Concentration at the boundary. In high dimensions almost all the volume of a hypercube lies in its corners and near its surface, so intuition built from 2-D/3-D pictures no longer applies.
    4. Density estimation fails. Histograms and kernel estimates need samples exponential in dd; DBSCAN's eps neighbourhoods become empty or contain all points at once.
    5. Spurious correlations and overfitting. With many attributes, chance patterns look like structure, and models fit noise.
    6. Cost. Every distance or similarity computation is O(d)O(d), making mining slow as well as unreliable.

    2. How model-based clustering helps

    Aspect Effect
    Parametric assumption A mixture of KK Gaussians in dd dimensions is described by only O(Kd2)O(K d^2) parameters, whereas a non-parametric density estimate would need exponentially many samples — the model imposes structure that the data cannot supply
    Joint distribution Covariance matrices model correlations between attributes, so redundant dimensions do not each add independent noise to the comparison
    Latent structure Extensions such as factor analysis and probabilistic PCA assume data lies near a low-dimensional subspace, explicitly reducing the effective dimension before clustering
    Regularised estimation Covariance shrinkage and tied/diagonal covariance options stop the d(d+1)/2d(d+1)/2 covariance terms from being estimated from too little data
    Model selection BIC penalises the parameter count, discouraging over-complex models that would simply memorise noise in high dimensions
    Probabilistic output Membership probabilities degrade gracefully, instead of forcing a meaningless nearest-centre assignment when all distances are nearly equal
    Outlier handling Heavy-tailed components (Student-tt mixtures) absorb anomalous points instead of pulling centroids around

    3. Limitations to mention

    Even mixture models struggle when dd is large relative to nn; in practice they are combined with dimensionality reduction (PCA), feature selection or subspace clustering (e.g. PROCLUS, CLIQUE) before fitting.

    Conclusion: dimensionality destroys clustering mainly through distance concentration and exponential sparsity; model-based methods respond by imposing a compact probabilistic form, exploiting attribute correlations and selecting complexity through BIC.

  28. Q9(b). Discuss the role of association rule mining in market basket analysis. How can businesses use this to improve their sales strategies?20247m

    Module 2: Data Mining Fundamentals and Association Rule Mining

    Discuss the role of association rule mining in market basket analysis. How can businesses use this to improve their sales strategies?

    View this question on its own page →
    Worked Solution

    Association Rule Mining in Market Basket Analysis

    Definition. Market basket analysis discovers associations among sets of items that frequently occur together in customer transactions. An association rule has the form X→YX \to Y, where XX (antecedent) and YY (consequent) are disjoint itemsets.

    1. Key measures

    • Support: sup(X→Y)=transactions containing X∪Ytotal transactions\text{sup}(X \to Y) = \frac{\text{transactions containing } X \cup Y}{\text{total transactions}} — how often the combination occurs.
    • Confidence: conf(X→Y)=sup(X∪Y)sup(X)\text{conf}(X \to Y) = \frac{\text{sup}(X \cup Y)}{\text{sup}(X)} — how often the rule is correct when XX appears.
    • Lift: lift=conf(X→Y)sup(Y)\text{lift} = \frac{\text{conf}(X \to Y)}{\text{sup}(Y)} — lift above 1 means the items are positively correlated, 1 means independence, below 1 negative correlation.

    A rule is interesting when support, confidence and lift all exceed the thresholds min-sup\text{min-sup}, min-conf\text{min-conf}.

    2. How rules are found: Apriori and FP-growth

    1. Scan transactions and keep items with sup≥min-sup\text{sup} \ge \text{min-sup} (frequent 1-itemsets).
    2. Join frequent kk-itemsets to form candidate (k+1)(k{+}1)-itemsets.
    3. Apriori principle (anti-monotone support): any superset of an infrequent itemset is also infrequent, so candidates can be pruned safely.
    4. Rescan, repeat until no more frequent itemsets.
    5. Generate rules from frequent itemsets and keep those with conf≥min-conf\text{conf} \ge \text{min-conf}.

    FP-growth avoids repeated scans by compressing the database into an FP-tree and mining it recursively.

    3. Worked mini-example

    Six supermarket transactions, min-sup=0.4\text{min-sup} = 0.4, min-conf=0.6\text{min-conf} = 0.6:

    Transaction Items
    T1 bread, butter
    T2 bread, butter
    T3 bread, milk
    T4 butter, jam
    T5 bread, butter, milk
    T6 jam, milk
    • sup({bread})=4/6=0.67\text{sup}(\{\text{bread}\}) = 4/6 = 0.67, sup({butter})=4/6=0.67\text{sup}(\{\text{butter}\}) = 4/6 = 0.67, sup({bread,butter})=3/6=0.50\text{sup}(\{\text{bread}, \text{butter}\}) = 3/6 = 0.50.
    • conf(bread→butter)=0.50/0.67=0.75≥0.60\text{conf}(\text{bread} \to \text{butter}) = 0.50 / 0.67 = 0.75 \ge 0.60 ⇒\Rightarrow rule accepted.
    • lift=0.75/0.67=1.125>1\text{lift} = 0.75 / 0.67 = 1.125 > 1, so bread and butter are positively associated.
    • By contrast conf(milk→butter)=(1/6)/(3/6)=0.33<0.60\text{conf}(\text{milk} \to \text{butter}) = (1/6)/(3/6) = 0.33 < 0.60, so that rule is rejected.

    4. How businesses use this for sales strategy

    1. Cross-selling and up-selling: recommendations such as customers who bought X also bought Y on product pages and in emails.
    2. Store layout and shelf placement: complementary items (bread and butter, chips and beer) placed near each other to raise basket size.
    3. Bundling and pricing: itemsets with high lift become combo offers and discount coupons.
    4. Promotion planning: discount the antecedent to drive sales of the profitable consequent.
    5. Catalogue and website design: group associated products in the same section or recommendation carousel.
    6. Personalisation: rules feed recommendation engines and targeted campaigns, improving conversion and customer retention.
    7. Inventory and shelf stocking: high-support bundles inform reorder quantities and planogram decisions.

    Conclusion: association rule mining turns raw transaction logs into actionable if-then knowledge; by filtering on support, confidence and lift, businesses identify genuinely complementary products and use them to lift cross-sales, basket value and stock efficiency.

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.