

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Finding structure in data without fooling yourself Computer Science | Undergraduate (Level 6) | December 2026
WHAT IS INSIDE
Data preparation dominates effort: cleaning, missing-value handling, encoding, scaling and feature construction. Leakage is the classic error - including a variable that is only available after the outcome, or scaling before splitting - and it produces excellent validation scores that collapse in production. Every preprocessing step must be fitted on training data only.
Classification predicts a label; regression predicts a value. Decision trees split on impurity reduction and are interpretable but unstable; random forests and gradient boosting average many trees and dominate tabular prediction, at the cost of interpretability that must then be recovered with importance measures or SHAP values. k-nearest neighbours is simple and sensitive to scaling; naive Bayes is fast and makes a strong independence assumption; support vector machines find maximum-margin boundaries and need kernel choice.
Model choice is a bias-variance decision. A model too simple underfits ; too flexible and it overfits the training sample. Regularisation , pruning, early stopping and ensembling control the variance. The reported performance must come from data the model has not seen, and the split must respect the data's structure - by time for temporal data, by group for repeated measures - or the estimate is optimistic.
3. Unsupervised methods and association
Clustering groups objects by similarity. k-means minimises within-cluster variance, requires k and assumes roughly spherical clusters; hierarchical clustering produces a dendrogram and needs a linkage choice; DBSCAN finds arbitrary shapes and labels noise but is sensitive to its parameters. Cluster validity is genuinely difficult: silhouette, Davies-Bouldin and gap statistics disagree, and a cluster solution is a hypothesis, not a fact.
Dimensionality reduction - PCA, t-SNE, UMAP - serves visualisation and preprocessing, but t-SNE and UMAP distort global distances, so distances between clusters should not be interpreted. Association rules use support, confidence and lift; lift is the one that says whether a rule is interesting, because a high-confidence rule for a common item is trivial. Anomaly detection is unsupervised by nature and evaluated mostly by inspection, which makes precision at a fixed alert budget the practical metric.
Accuracy is misleading under class imbalance : a 99 per cent negative class gives 99 per cent accuracy to a model that predicts nothing. Use the confusion matrix , precision , recall , F1 and the ROC or precision-recall curve; for ranking and probability, use AUC and log loss or Brier score. The metric must be chosen from the cost of each error type, not from habit.
Cross-validation estimates generalisation, with stratified folds for imbalance and nested folds when hyperparameters are tuned, otherwise the tuning leaks into the estimate. Feature selection must also sit inside the cross-validation loop. After deployment, drift in the input distribution or in the relationship to the outcome degrades performance silently, so monitoring, retraining policy and a fallback are part of the model, not of the operations team's goodwill. Fairness audits belong here too: a model can be accurate and discriminatory at once.
Strong tabular accuracy Leakage and imbalance
Regression Linear, regularised, tree ensembles
Interpretable baselines Non-linearity and outliers
Clustering k-means, hierarchical, DBSCAN
Exploratory structure k choice and validity
Association Apriori, FP-growth Readable rules Trivial rules without lift Anomaly detection Isolation forest, density methods
Finds the unusual Alert budget and precision
For each method, know the assumption it makes and the diagnostic that reveals a violation. Data mining exams reward the assumption, not the algorithm name.