🇮🇳 Data Science & Machine Learning · subject
Data Science & Machine Learning Unsupervised Learning and Feature Engineering Syllabus
The Unsupervised Learning and Feature Engineering syllabus for Data Science & Machine Learning in full: 3 chapters, 10 topics and 18 sub-topics, every one listed below, plus 51 Unsupervised Learning and Feature Engineering flashcards with answers.
Unsupervised Learning and Feature Engineering syllabus: all 3 chapters
Expand any chapter to see its topics and sub-topics.
-
Clustering Techniques
3 topics- K-Means Clustering
- Centroid initialization
- Elbow method and silhouette score
- Hierarchical Clustering
- Agglomerative approach
- Dendrograms
- Density-Based Clustering
- DBSCAN
- K-Means Clustering
-
Dimensionality Reduction
3 topics- Principal Component Analysis
- Explained variance
- Components selection
- t-SNE and UMAP
- Nonlinear embedding for visualization
- Association Rule Mining
- Apriori algorithm
- Support, confidence and lift
- Principal Component Analysis
-
Feature Engineering
4 topics- Feature Scaling
- Standardization and normalization
- MinMax and Robust scalers
- Encoding Categorical Variables
- One-hot encoding
- Label and target encoding
- Feature Creation and Selection
- Binning and interaction features
- Filter, wrapper and embedded methods
- Handling Imbalanced Data
- SMOTE and oversampling
- Class weights
- Feature Scaling
Data Science & Machine Learning Unsupervised Learning and Feature Engineering flashcards — 51 questions with answers
What is the objective function that K-Means clustering minimizes?
The within-cluster sum of squares (WCSS), also called inertia: the sum of squared Euclidean distances between each point and its assigned cluster centroid, summed over all clusters.
Describe the two iterative steps of the K-Means (Lloyd's) algorithm.
1) Assignment step: assign each point to the nearest centroid. 2) Update step: recompute each centroid as the mean of the points assigned to it. Repeat until assignments no longer change (convergence).
What is the 'elbow method' used for in K-Means?
It selects the optimal number of clusters K by plotting WCSS (inertia) against K and choosing the K at the 'elbow' point, where adding more clusters yields diminishing reductions in WCSS.
What problem does K-Means++ solve, and how?
It improves centroid initialization to avoid poor local optima. It picks the first centroid randomly, then chooses each subsequent centroid with probability proportional to its squared distance from the nearest existing centroid, spreading initial centers apart.
Name three key assumptions/limitations of K-Means clustering.
It assumes clusters are spherical and roughly equal in size, requires K to be specified in advance, is sensitive to outliers and feature scaling, and only finds convex (linearly separable) clusters.
What does the silhouette score measure and what is its range?
It measures how well a point fits its own cluster versus the nearest neighboring cluster. It ranges from -1 to +1; values near +1 indicate well-clustered points, near 0 indicate overlapping clusters, and negative values indicate likely misassignment.
What is the silhouette coefficient formula for a single point?
s = (b - a) / max(a, b), where a is the mean distance to other points in the same cluster (intra-cluster) and b is the mean distance to points in the nearest other cluster (inter-cluster).
What is the difference between agglomerative and divisive hierarchical clustering?
Agglomerative is bottom-up: each point starts as its own cluster and pairs are merged successively. Divisive is top-down: all points start in one cluster that is recursively split.
What is a dendrogram in hierarchical clustering?
A tree diagram that records the sequence of merges (or splits) and the distance at which they occur. Cutting it at a chosen height yields a particular number of clusters.
List the four common linkage criteria in agglomerative clustering.
Single linkage (minimum pairwise distance), complete linkage (maximum pairwise distance), average linkage (mean pairwise distance), and Ward's linkage (minimizes increase in within-cluster variance).
What is the 'chaining effect' and which linkage causes it?
Chaining is the tendency to form long, straggly clusters where points are linked through a chain of close neighbors. It is caused by single linkage, which uses the minimum distance between clusters.
What is the typical time complexity of standard agglomerative hierarchical clustering?
O(n^3) time (or O(n^2 log n) with optimized implementations) and O(n^2) space, which makes it impractical for very large datasets.
What do the two core parameters epsilon (eps) and minPts mean in DBSCAN?
eps is the radius of the neighborhood around a point; minPts is the minimum number of points (including the point itself) required within that radius for a point to be a core point.
Define core point, border point, and noise point in DBSCAN.
A core point has at least minPts neighbors within eps. A border point has fewer than minPts neighbors but lies within eps of a core point. A noise point is neither core nor border and is treated as an outlier.
Name two major advantages of DBSCAN over K-Means.
DBSCAN does not require specifying the number of clusters in advance, can find arbitrarily shaped (non-convex) clusters, and identifies outliers as noise rather than forcing them into clusters.
What is a key weakness of DBSCAN regarding cluster density?
DBSCAN uses a single global eps/minPts, so it struggles with clusters of widely varying densities; HDBSCAN was developed to address this by handling variable density.
What is the main goal of Principal Component Analysis (PCA)?
To reduce dimensionality by projecting data onto a smaller set of orthogonal axes (principal components) that capture the maximum possible variance in the data.
How are principal components mathematically derived?
They are the eigenvectors of the data's covariance matrix (or via SVD of the centered data matrix); the corresponding eigenvalues give the variance explained by each component, ordered from largest to smallest.
Why must data be standardized (scaled) before applying PCA?
PCA is variance-based, so features with larger scales/units would dominate the principal components. Standardizing to zero mean and unit variance ensures each feature contributes fairly.
What does 'explained variance ratio' tell you in PCA?
It is the proportion of total variance captured by each principal component (eigenvalue divided by the sum of all eigenvalues), used to decide how many components to retain.
Show the other 31 Unsupervised Learning and Feature Engineering flashcards
Is PCA a linear or non-linear technique, and what does that imply?
PCA is linear: it finds linear combinations of features. It cannot capture non-linear structure, so manifold methods like t-SNE, UMAP, or kernel PCA are needed for non-linear relationships.
What does the acronym t-SNE stand for?
t-distributed Stochastic Neighbor Embedding.
What is the role of the 'perplexity' parameter in t-SNE?
Perplexity roughly controls the effective number of nearest neighbors considered for each point, balancing attention between local and global structure; typical values range from about 5 to 50.
Why is t-SNE generally used only for visualization, not as preprocessing for other models?
t-SNE preserves local neighborhoods but distorts global distances and densities, is computationally expensive, is non-deterministic, and lacks a stable transform for new (out-of-sample) data.
What does UMAP stand for and what mathematical foundation does it use?
Uniform Manifold Approximation and Projection. It is based on manifold learning and topological data analysis (fuzzy simplicial sets / Riemannian geometry).
Name two practical advantages of UMAP over t-SNE.
UMAP is significantly faster and scales better to large datasets, and it better preserves global structure; it can also transform new data points after fitting.
In t-SNE, why is a Student's t-distribution used in the low-dimensional space?
Its heavier tails alleviate the 'crowding problem' by allowing moderately distant points to be placed farther apart in the embedding, preventing clusters from collapsing together.
What are the three key metrics in association rule mining: support, confidence, and lift?
Support = fraction of transactions containing the itemset. Confidence = P(B|A), the fraction of transactions with A that also contain B. Lift = confidence / support(B), measuring how much more likely B is given A versus independence.
How is lift interpreted in association rule mining?
Lift > 1 means A and B occur together more than expected (positive correlation); lift = 1 means independence; lift < 1 means they occur together less than expected (negative correlation).
What is the Apriori principle (downward closure property)?
If an itemset is frequent, all of its subsets are also frequent; equivalently, if an itemset is infrequent, all its supersets are infrequent. This lets Apriori prune the search space.
How does the FP-Growth algorithm differ from Apriori?
FP-Growth avoids candidate generation by compressing the dataset into an FP-tree and mining frequent patterns recursively, making it generally faster than Apriori, which repeatedly scans the database to generate and test candidates.
What is the formula for standardization (Z-score scaling)?
z = (x - mu) / sigma, where mu is the feature mean and sigma is its standard deviation. The result has mean 0 and standard deviation 1.
What is the formula for Min-Max normalization to the range [0, 1]?
x' = (x - x_min) / (x_max - x_min). It rescales features to a fixed range but is sensitive to outliers.
When should you prefer RobustScaler over StandardScaler?
When the data contains significant outliers. RobustScaler centers using the median and scales using the IQR (interquartile range), making it robust to extreme values.
Name three machine learning algorithms that require feature scaling and one that does not.
Require scaling: K-Means, KNN, SVM, PCA, gradient-descent-based models (logistic/linear regression, neural networks). Do not require it: tree-based models like decision trees, Random Forest, and gradient-boosted trees.
What is one-hot encoding and what is its main drawback?
It converts each category of a nominal variable into a separate binary (0/1) column. Its main drawback is the curse of dimensionality: high-cardinality features create many sparse columns.
What is the difference between label encoding and one-hot encoding?
Label encoding maps each category to an integer (suitable for ordinal data); one-hot creates binary columns per category (suitable for nominal data). Label encoding on nominal data can falsely imply an ordering.
What is target (mean) encoding and what risk does it introduce?
It replaces each category with the mean of the target variable for that category. The main risk is target leakage and overfitting, mitigated by cross-validation folds, smoothing, or adding noise.
What is the 'dummy variable trap' and how is it avoided?
It is perfect multicollinearity arising when one-hot columns are linearly dependent (they sum to 1). It is avoided by dropping one category (drop_first=True), leaving k-1 columns for k categories.
What encoding is appropriate for ordinal categorical variables, and why?
Ordinal encoding, which maps categories to integers that preserve their inherent order (e.g., low=1, medium=2, high=3), because the order carries meaningful information for the model.
What is the difference between feature selection and feature extraction?
Feature selection chooses a subset of the original features (keeping them interpretable); feature extraction creates new features by transforming/combining originals (e.g., PCA), changing the feature space.
Name the three categories of feature selection methods.
Filter methods (use statistical scores like correlation or chi-square, independent of any model), wrapper methods (use a model to evaluate subsets, e.g., recursive feature elimination), and embedded methods (selection built into training, e.g., Lasso, tree importances).
How does Lasso (L1) regularization perform feature selection?
The L1 penalty shrinks some coefficients exactly to zero, effectively removing those features from the model, producing a sparse and automatically feature-selected solution.
What is recursive feature elimination (RFE)?
A wrapper method that fits a model, ranks features by importance, removes the least important feature(s), and repeats the process recursively until the desired number of features remains.
Give two examples of feature creation (feature engineering) techniques.
Examples: creating interaction or polynomial terms, extracting date components (day, month, weekday) from timestamps, binning continuous variables, and computing ratios or aggregations of existing features.
What is the curse of dimensionality?
As the number of features grows, data becomes sparse in the high-dimensional space, distances between points become less meaningful, and models require exponentially more data to generalize, harming performance.
What does SMOTE do to handle imbalanced data?
SMOTE (Synthetic Minority Over-sampling Technique) generates synthetic minority-class examples by interpolating between a minority sample and its k nearest minority-class neighbors, rather than simply duplicating samples.
Why is accuracy a poor metric for imbalanced classification?
With a highly skewed class distribution, a model can achieve high accuracy by predicting only the majority class while completely failing on the minority class. Precision, recall, F1, and AUC-PR are more informative.
Contrast random oversampling and random undersampling for class imbalance.
Random oversampling duplicates minority-class samples (risking overfitting and larger datasets); random undersampling removes majority-class samples (risking loss of useful information and smaller datasets).
What is class weighting as a strategy for imbalanced data?
Assigning higher misclassification cost (weight) to the minority class in the loss function so the model penalizes minority-class errors more heavily, without resampling the data; supported via parameters like class_weight='balanced'.
Which evaluation curve is preferred over ROC for highly imbalanced datasets, and why?
The Precision-Recall curve (and its area, AUC-PR), because it focuses on the positive (minority) class performance and is not misleadingly optimistic when true negatives dominate, unlike the ROC curve.
Data Science & Machine Learning Unsupervised Learning and Feature Engineering FAQ
What is in the Data Science & Machine Learning Unsupervised Learning and Feature Engineering syllabus?
Data Science & Machine Learning Unsupervised Learning and Feature Engineering is split into 3 chapters: Clustering Techniques, Dimensionality Reduction and Feature Engineering. Together they contain 10 topics and 18 sub-topics.
How many chapters are in Data Science & Machine Learning Unsupervised Learning and Feature Engineering?
3 chapters, containing 10 topics and 18 sub-topics. The largest chapter is Feature Engineering, with 4 topics.
Are there flashcards for Data Science & Machine Learning Unsupervised Learning and Feature Engineering?
Yes — a 51-card Unsupervised Learning and Feature Engineering deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.