<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>MachineLearning | Portfolio</title><link>https://ansangah.github.io/en/tags/machinelearning/</link><atom:link href="https://ansangah.github.io/en/tags/machinelearning/index.xml" rel="self" type="application/rss+xml"/><description>MachineLearning</description><generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en</language><lastBuildDate>Mon, 20 Oct 2025 00:00:00 +0000</lastBuildDate><image><url>https://ansangah.github.io/media/sharing.png</url><title>MachineLearning</title><link>https://ansangah.github.io/en/tags/machinelearning/</link></image><item><title>Machine Learning</title><link>https://ansangah.github.io/en/blog/subjects/ml/</link><pubDate>Mon, 20 Oct 2025 00:00:00 +0000</pubDate><guid>https://ansangah.github.io/en/blog/subjects/ml/</guid><description>&lt;h2 id="1-introduction"&gt;1. Introduction&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Machine learning automatically learns patterns from data to make predictions or decisions.&lt;/li&gt;
&lt;li&gt;Main paradigms: supervised (classification/regression), unsupervised (clustering/dimensionality reduction), reinforcement learning.&lt;/li&gt;
&lt;li&gt;Key challenges: generalisation, data quality, computational efficiency, interpretability.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="2-formalising-inductive-machine-learning"&gt;2. Formalising Inductive Machine Learning&lt;/h2&gt;
&lt;h3 id="21-problem-setup"&gt;2.1 Problem Setup&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Assume input space $\mathcal{X}$, output space $\mathcal{Y}$, and an unknown data distribution $\mathcal{D}$.&lt;/li&gt;
&lt;li&gt;Training set $S={(x_i, y_i)}_{i=1}^{n}$ is drawn i.i.d. from $\mathcal{D}$.&lt;/li&gt;
&lt;li&gt;Goal: pick a hypothesis $h \in \mathcal{H}$ that minimises the &lt;strong&gt;risk&lt;/strong&gt;
$$R(h) = \mathbb{E}_{(x,y)\sim\mathcal{D}}[\ell(h(x), y)]$$
Since $\mathcal{D}$ is unknown, we minimise the &lt;strong&gt;empirical risk&lt;/strong&gt;
$$\hat{R}&lt;em&gt;S(h) = \frac{1}{n}\sum&lt;/em&gt;{i=1}^{n} \ell(h(x_i), y_i)$$
possibly with regularisation (RERM).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="22-inductive-bias"&gt;2.2 Inductive Bias&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The No Free Lunch theorem states no learner dominates across all distributions.&lt;/li&gt;
&lt;li&gt;We encode prior knowledge as &lt;strong&gt;bias&lt;/strong&gt; and learn the &lt;strong&gt;weights&lt;/strong&gt; from data.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="3-limits-of-learning-and-generalisation"&gt;3. Limits of Learning and Generalisation&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;VC dimension:&lt;/strong&gt; Measures expressive power of $\mathcal{H}$ and bounds generalisation error.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bias–variance trade-off:&lt;/strong&gt; Complex models have high variance; simple models incur high bias.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Overfitting:&lt;/strong&gt; Low training error but poor unseen performance. Mitigate with regularisation, early stopping, cross-validation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PAC learning:&lt;/strong&gt; Describes when a concept class is learnable—Probably Approximately Correct.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="4-geometry-and-nearest-neighbours"&gt;4. Geometry and Nearest Neighbours&lt;/h2&gt;
&lt;h3 id="41-distance-based-learning"&gt;4.1 Distance-Based Learning&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Represent data points as vectors in high-dimensional space and use a &lt;strong&gt;metric&lt;/strong&gt; to measure similarity.&lt;/li&gt;
&lt;li&gt;$k$-NN classification: majority vote among the $k$ closest labelled neighbours.&lt;/li&gt;
&lt;li&gt;$k$-NN regression: predict the (possibly weighted) average of the neighbours’ targets.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="42-properties"&gt;4.2 Properties&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Virtually zero training cost—just store the data—while inference is heavy.&lt;/li&gt;
&lt;li&gt;Distance metric choice matters: Euclidean, Manhattan, cosine, etc.&lt;/li&gt;
&lt;li&gt;Curse of dimensionality: distances become less informative; use dimensionality reduction or distance weighting.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="43-kernels-and-manifolds"&gt;4.3 Kernels and Manifolds&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Define nonlinear similarities with kernel functions to capture local structure.&lt;/li&gt;
&lt;li&gt;Manifold assumption: high-dimensional data may live on lower-dimensional surfaces—neighbourhood information remains meaningful.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="5-decision-tree-learning"&gt;5. Decision Tree Learning&lt;/h2&gt;
&lt;h3 id="51-structure"&gt;5.1 Structure&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Recursively split the feature space with questions. Leaves output predictions.&lt;/li&gt;
&lt;li&gt;Splitting criteria: information gain, Gini index, chi-squared tests.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="52-training-id3c45cart"&gt;5.2 Training (ID3/C4.5/CART)&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Choose the best attribute to split on.&lt;/li&gt;
&lt;li&gt;Recurse on child nodes.&lt;/li&gt;
&lt;li&gt;Stop when leaves are pure or the sample count hits thresholds.&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;Continuous features use threshold-based binary splits.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="53-pruning"&gt;5.3 Pruning&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Pre-pruning: depth limits, minimum samples per node, etc.&lt;/li&gt;
&lt;li&gt;Post-pruning: build the full tree, then remove branches that raise validation error (e.g., reduced error pruning).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="54-pros-and-cons"&gt;5.4 Pros and Cons&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Interpretable, no need for feature scaling, handles nonlinearity.&lt;/li&gt;
&lt;li&gt;Sensitive to data splits and prone to overfitting → use ensembles (Random Forest, Gradient Boosting) for robustness.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="6-perceptron"&gt;6. Perceptron&lt;/h2&gt;
&lt;h3 id="61-linear-separator"&gt;6.1 Linear Separator&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Learns weights $w$ and bias $b$ to classify via $\text{sign}(w^\top x + b)$.&lt;/li&gt;
&lt;li&gt;Update rule for misclassified sample $(x,y)$:&lt;br&gt;
$w \leftarrow w + \eta y x$, $b \leftarrow b + \eta y$.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Perceptron convergence theorem:&lt;/strong&gt; If data is linearly separable, convergence occurs in finite steps.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="62-limitations"&gt;6.2 Limitations&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Cannot solve nonlinearly separable problems (e.g., XOR) without kernels or multilayer networks.&lt;/li&gt;
&lt;li&gt;Sensitive to learning rate $\eta$ and sample order.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="7-practical-considerations"&gt;7. Practical Considerations&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Preprocessing:&lt;/strong&gt; Handle missing values and outliers, apply scaling, encode categorical features.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Evaluation:&lt;/strong&gt; Maintain train/validation/test splits; use k-fold CV or time-series CV as appropriate.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Regularisation:&lt;/strong&gt; L1 encourages sparsity; L2 stabilises weights. Dropout, batch normalisation, etc., regulate neural nets.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hyperparameter search:&lt;/strong&gt; Grid, random, or Bayesian optimisation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Interpretability:&lt;/strong&gt; SHAP, LIME, and feature importance expose model behaviour.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="8-beyond-binary-classification"&gt;8. Beyond Binary Classification&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Multiclass:&lt;/strong&gt; One-vs-rest, one-vs-one, softmax regression.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multi-label:&lt;/strong&gt; A sample may belong to multiple classes—use binary relevance, classifier chains, sigmoid outputs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Regression:&lt;/strong&gt; Predict continuous targets using linear regression, regression trees, Gaussian processes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Imbalanced data:&lt;/strong&gt; Apply class weighting, SMOTE, or cost-sensitive losses.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Structured outputs:&lt;/strong&gt; Sequence labelling with HMM/CRF, image segmentation with U-Net, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="9-linear-models"&gt;9. Linear Models&lt;/h2&gt;
&lt;h3 id="91-linear-regression"&gt;9.1 Linear Regression&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Fits $y \approx w^\top x + b$ via ordinary least squares.&lt;/li&gt;
&lt;li&gt;Regularisation: Ridge (L2), Lasso (L1), Elastic Net.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="92-logistic-regression"&gt;9.2 Logistic Regression&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Models binary probability with the sigmoid:
$$P(y=1|x) = \sigma(w^\top x + b) = \frac{1}{1 + e^{-(w^\top x + b)}}$$&lt;/li&gt;
&lt;li&gt;Train by maximising log-likelihood or minimising cross-entropy.&lt;/li&gt;
&lt;li&gt;Decision boundary is linear—extend with kernels or polynomial features for nonlinearity.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="93-softmax-regression"&gt;9.3 Softmax Regression&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;For $K$ classes,&lt;br&gt;
$\mathrm{softmax}(z)_k = \frac{e^{z_k}}{\sum_j e^{z_j}}$.&lt;/li&gt;
&lt;li&gt;Optimise with cross-entropy; works well with stochastic gradient descent.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="94-pros-and-cons"&gt;9.4 Pros and Cons&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Pros: explainable, fast to train, strong with high-dimensional sparse data.&lt;/li&gt;
&lt;li&gt;Cons: limited expressiveness for complex nonlinear relationships—upgrade with kernels or deep networks.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="10-suggested-learning-workflow"&gt;10. Suggested Learning Workflow&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Define the problem and capture domain knowledge.&lt;/li&gt;
&lt;li&gt;Clean and explore the data; engineer informative features.&lt;/li&gt;
&lt;li&gt;Establish baselines with simple models (linear, tree, k-NN).&lt;/li&gt;
&lt;li&gt;Decide on validation strategy and tune hyperparameters.&lt;/li&gt;
&lt;li&gt;Compare models on performance, interpretability, and operational cost.&lt;/li&gt;
&lt;li&gt;Deploy, monitor for drift, and retrain periodically.&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>Data Mining</title><link>https://ansangah.github.io/en/blog/subjects/dm/</link><pubDate>Tue, 16 Apr 2024 00:00:00 +0000</pubDate><guid>https://ansangah.github.io/en/blog/subjects/dm/</guid><description>&lt;h2 id="1-overview"&gt;1. Overview&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Data mining extracts &lt;strong&gt;meaningful patterns and knowledge&lt;/strong&gt; from massive datasets.&lt;/li&gt;
&lt;li&gt;Pipeline: data cleaning → feature construction → modelling/pattern discovery → evaluation &amp;amp; visualisation.&lt;/li&gt;
&lt;li&gt;Algorithms must account for the “4 V’s” of big data: volume, variety, velocity, veracity.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="2-frequent-itemset-mining"&gt;2. Frequent Itemset Mining&lt;/h2&gt;
&lt;h3 id="21-concepts"&gt;2.1 Concepts&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Identify sets of items that co-occur in transaction data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Support:&lt;/strong&gt; fraction of transactions containing itemset $X$&lt;br&gt;
$$\mathrm{support}(X) = \frac{#\text{transactions containing }X}{#\text{all transactions}}$$&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Confidence:&lt;/strong&gt; probability that $Y$ appears when $X$ does in rule $X \rightarrow Y$.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lift:&lt;/strong&gt; $ \frac{P(X,Y)}{P(X)P(Y)}$ measures how much more often $X$ and $Y$ appear together than by independence.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="22-apriori-algorithm"&gt;2.2 Apriori Algorithm&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Top-down&lt;/strong&gt; search that grows larger frequent itemsets from smaller ones.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Apriori principle:&lt;/strong&gt; if an itemset is not frequent, none of its supersets can be frequent.&lt;/li&gt;
&lt;li&gt;Steps:
&lt;ol&gt;
&lt;li&gt;Generate candidate 1-itemsets and compute support.&lt;/li&gt;
&lt;li&gt;Keep itemsets above the minimum support threshold.&lt;/li&gt;
&lt;li&gt;Combine survivors to form $(k+1)$-item candidates.&lt;/li&gt;
&lt;li&gt;Repeat until no more frequent sets remain.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Limitation: repeated data scans and huge candidate sets.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="23-fp-growth"&gt;2.3 FP-Growth&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Compress transactions into an &lt;strong&gt;FP-tree&lt;/strong&gt; without candidate generation.&lt;/li&gt;
&lt;li&gt;Process: order items by support → insert transactions into the tree sharing prefixes → build conditional FP-trees recursively.&lt;/li&gt;
&lt;li&gt;Requires less I/O than Apriori and scales well to large datasets.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="24-association-rules"&gt;2.4 Association Rules&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Split each frequent itemset into antecedent/consequent pairs to form rule candidates.&lt;/li&gt;
&lt;li&gt;Filter by support, confidence, lift, etc.&lt;/li&gt;
&lt;li&gt;Applications: recommendation, market-basket analysis, intrusion detection.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="3-similar-item-search-locality-sensitive-hashing-lsh"&gt;3. Similar Item Search: Locality-Sensitive Hashing (LSH)&lt;/h2&gt;
&lt;h3 id="31-problem"&gt;3.1 Problem&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Quickly find &lt;strong&gt;similar objects&lt;/strong&gt; in very large datasets (duplicate documents, image search, record linkage).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="32-core-idea"&gt;3.2 Core Idea&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Design hash families so that &lt;strong&gt;similar items collide with high probability&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Choose hash functions according to similarity metrics:
&lt;ul&gt;
&lt;li&gt;Jaccard → MinHash&lt;/li&gt;
&lt;li&gt;Cosine → Random hyperplane&lt;/li&gt;
&lt;li&gt;$L_p$ distance → $p$-stable hashes&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="33-minhash-with-banding"&gt;3.3 MinHash with Banding&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Represent documents as sets and build MinHash signatures (minimum values of multiple hash functions).&lt;/li&gt;
&lt;li&gt;Split the signature matrix into $b$ bands of $r$ rows; hash each band to buckets.&lt;/li&gt;
&lt;li&gt;If two signatures match in any band, treat them as a candidate pair and compute exact similarity.&lt;/li&gt;
&lt;li&gt;Adjust $(r, b)$ to balance false negatives (more bands) vs. false positives (more rows).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="34-lsh-pipeline"&gt;3.4 LSH Pipeline&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Preprocess data into sets or vectors.&lt;/li&gt;
&lt;li&gt;Generate LSH signatures.&lt;/li&gt;
&lt;li&gt;Extract candidate pairs.&lt;/li&gt;
&lt;li&gt;Compute exact distances and return top-$k$ or threshold matches.&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id="4-clustering"&gt;4. Clustering&lt;/h2&gt;
&lt;h3 id="41-essentials"&gt;4.1 Essentials&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Discover &lt;strong&gt;natural groupings&lt;/strong&gt; in unlabeled data.&lt;/li&gt;
&lt;li&gt;Objectives: maximise intra-cluster similarity and minimise inter-cluster similarity.&lt;/li&gt;
&lt;li&gt;Distance metrics: Euclidean, cosine, Hamming, DTW, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="42-k-means"&gt;4.2 K-means&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Classic algorithm for roughly spherical clusters.&lt;/li&gt;
&lt;li&gt;Procedure: choose $K$ centres (random or k-means++), assign points to nearest centre, recompute centres, repeat until convergence.&lt;/li&gt;
&lt;li&gt;Watch out for $K$ selection (elbow, silhouette), sensitivity to outliers, and initial seeds.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="43-hierarchical-clustering"&gt;4.3 Hierarchical Clustering&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Builds a &lt;strong&gt;dendrogram&lt;/strong&gt; based on pairwise distances.&lt;/li&gt;
&lt;li&gt;Agglomerative (bottom-up): start with singletons and merge clusters using linkage criteria (single, complete, average, Ward).&lt;/li&gt;
&lt;li&gt;Divisive (top-down): start with all points and split recursively.&lt;/li&gt;
&lt;li&gt;Cut the tree at a chosen level to obtain the desired number of clusters.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="44-density-based-clustering"&gt;4.4 Density-Based Clustering&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;DBSCAN/HDBSCAN treat dense regions as clusters and sparse areas as noise.&lt;/li&gt;
&lt;li&gt;Parameters: radius $\varepsilon$ and minimum points MinPts.&lt;/li&gt;
&lt;li&gt;Captures arbitrarily shaped clusters and automatically flags outliers.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="5-community-detection-in-graphs"&gt;5. Community Detection in Graphs&lt;/h2&gt;
&lt;h3 id="51-definition"&gt;5.1 Definition&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Partition a graph into subgraphs with &lt;strong&gt;dense internal connections&lt;/strong&gt; and sparse external ones.&lt;/li&gt;
&lt;li&gt;Use cases: social networks, recommendation engines, biological networks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="52-modularity"&gt;5.2 Modularity&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Measures the difference between intra-cluster and inter-cluster edge density.&lt;/li&gt;
&lt;li&gt;Louvain/Leiden algorithms greedily maximise modularity for large graphs.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="53-spectral-clustering"&gt;5.3 Spectral Clustering&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Uses eigenvectors of the graph Laplacian to embed nodes into a low-dimensional space.&lt;/li&gt;
&lt;li&gt;Workflow: build adjacency matrix $W$, degree matrix $D$, compute normalised Laplacian $L = D^{-1/2}(D-W)D^{-1/2}$, take the smallest $k$ eigenvectors, and run k-means.&lt;/li&gt;
&lt;li&gt;Handles nonlinear structures and non-spherical clusters.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="54-comparison"&gt;5.4 Comparison&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Modularity optimisation is fast but subject to resolution limits.&lt;/li&gt;
&lt;li&gt;Spectral methods are more costly (eigen decomposition) yet yield high-quality partitions.&lt;/li&gt;
&lt;li&gt;Choose based on graph size, sparsity, and runtime constraints.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="6-dimensionality-reduction"&gt;6. Dimensionality Reduction&lt;/h2&gt;
&lt;h3 id="61-motivation"&gt;6.1 Motivation&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;High-dimensional data worsens computation, visualisation, and the curse of dimensionality.&lt;/li&gt;
&lt;li&gt;Dimensionality reduction keeps as much information as possible while compressing representation.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="62-principal-component-analysis-pca"&gt;6.2 Principal Component Analysis (PCA)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Eigen-decompose the covariance matrix to find directions of maximal variance.&lt;/li&gt;
&lt;li&gt;Steps: standardise data → compute covariance → eigenvalues/vectors → project onto top-$k$ components.&lt;/li&gt;
&lt;li&gt;Linear, orthogonal transform that preserves maximum variance; sensitive to nonlinearity/outliers.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="63-linear-discriminant-analysis-lda"&gt;6.3 Linear Discriminant Analysis (LDA)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Maximises between-class variance while minimising within-class variance.&lt;/li&gt;
&lt;li&gt;Supervised dimensionality reduction; boosts classification performance.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="64-nonlinear-techniques"&gt;6.4 Nonlinear Techniques&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;t-SNE: excellent for local structure visualisation, but distorts global layout.&lt;/li&gt;
&lt;li&gt;UMAP: faster than t-SNE with better global preservation.&lt;/li&gt;
&lt;li&gt;Autoencoders: neural networks that learn nonlinear embeddings.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="65-working-with-lshclustering"&gt;6.5 Working with LSH/Clustering&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Reduce dimensionality first to improve LSH efficiency and denoise features.&lt;/li&gt;
&lt;li&gt;Applying PCA before clustering often yields higher silhouette scores.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="7-project-tips"&gt;7. Project Tips&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Prioritise data quality: handle missing values, detect outliers, and scale appropriately.&lt;/li&gt;
&lt;li&gt;Evaluation metrics:
&lt;ul&gt;
&lt;li&gt;Frequent patterns: support, confidence, lift, conviction, Kulczynski, etc.&lt;/li&gt;
&lt;li&gt;Clustering/community detection: silhouette, Davies–Bouldin, modularity.&lt;/li&gt;
&lt;li&gt;Dimensionality reduction: reconstruction error, downstream model accuracy.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Visualise results with heatmaps, correlation matrices, network graphs, and 2D embeddings (PCA, t-SNE).&lt;/li&gt;
&lt;li&gt;In practice, LSH is just a candidate generator—always follow up with precise distance checks.&lt;/li&gt;
&lt;li&gt;Document your pipeline and tuning experiments to ensure reproducibility.&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>