NSCT AI, Machine Learning & Data Analytics Revision Notes
These notes condense all 17 official AI, Machine Learning & Data Analytics topics into the formulas, comparisons and traps you need for fast recall. The area carries 10% of the NSCT, according to HEC's Areas of Competencies, and candidates averaged 50.8% accuracy in it in 2026, per the HEC NSCT report and APP.
How to use them: read a topic's bullets, answer that topic's MCQs through the link under it, and log every miss in an error log with the rule you broke. HEC's report shows accuracy falling from 49.5% on Understanding questions to 45.1% on Application and 44.8% on Analysis, so spend most of your time computing metrics and output sizes, not re-reading definitions.
Introduction to AI, ML & Data Analytics
- AI ⊃ ML ⊃ DL. Rule-based expert systems are AI without learning.
- Supervised = labels; unsupervised = no labels; semi-supervised = few labels; reinforcement = rewards; self-supervised = labels made from the data.
- Continuous target = regression; discrete label = classification.
- Analytics: descriptive (what happened), diagnostic (why), predictive (what will), prescriptive (what to do).
- Validation set tunes hyperparameters; the test set is used once at the end.
Trap: calling data "unsupervised" because it is big or messy. Only the presence of labels decides. Practise: Intro to AI & ML MCQs.
Mathematical Foundations
- (m × n)(n × p) = (m × p); AB is usually not BA.
- 2 × 2 determinant = ad − bc; det = 0 means no inverse.
- Bayes: P(A|B) = P(B|A) P(A) / P(B).
- Mutually exclusive events with non-zero probability are dependent, not independent.
- Gradient descent: w = w − learning rate × gradient. Sigmoid derivative peaks at 0.25.
Trap: reading r = 0 as "no relationship". y = x² on symmetric x gives r = 0. Practise: Mathematical Foundations MCQs.
Python for AI & Data Analytics
a * bis element-wise;a @ bornp.dotis the matrix product.- The axis you pass disappears: axis=0 gives one result per column.
locselects by label,ilocby position.- NaN never equals itself; use
isna(). - Basic slices are views;
b = aonly adds a name, so usea.copy().
Trap: fitting a scaler on the full dataset before splitting, which leaks test data. Practise: Python for AI MCQs.
Data Collection & Pre-processing
| Scaling | Formula | Outlier-sensitive? |
|---|---|---|
| Min-max | (x − min) / (max − min) | Yes |
| Standardisation | (x − mean) / sd | Somewhat |
| Robust | (x − median) / IQR | No |
- Missingness: MCAR, MAR, MNAR (depends on the missing value itself).
- One-hot for nominal data; ordinal codes only when order is real. Keep k − 1 dummies with an intercept.
- Stratified splits keep class proportions.
Trap: oversampling (or SMOTE) before splitting, which copies minority rows into the test set. Practise: Pre-processing MCQs.
Exploratory Data Analysis (EDA)
- Right skew: mean > median (income). Left skew: mean < median.
- Empirical rule: about 68%, 95%, 99.7% within 1, 2, 3 sd.
- Sample sd divides by n − 1; population sd by n.
- Pearson measures linear association; Spearman measures any monotonic trend.
Trap: trusting summaries without plots. Anscombe's quartet shares statistics but not shapes. Practise: EDA MCQs.
Supervised Learning
- Logistic regression is a classifier: sigmoid 1 / (1 + e⁻ᶻ).
- KNN distance from (3, 4) to (6, 8): Euclidean 5, Manhattan 7.
- SVM margin = 2 / ‖w‖; larger C narrows the margin.
- Two-class entropy peaks at 1; Gini peaks at 0.5.
- Information gain = parent entropy − weighted child entropy.
Trap: treating 100% training accuracy at k = 1 as a good model; each point is its own neighbour. Practise: Supervised Learning MCQs.
Ensemble Learning
| Bagging / random forest | Boosting | |
|---|---|---|
| Training | Parallel | Sequential |
| Mainly reduces | Variance | Bias |
| More estimators | Error flattens | Can overfit |
- A bootstrap sample holds about 63.2% of distinct rows; 36.8% are out-of-bag.
- AdaBoost alpha = ½ ln((1 − e)/e).
- Soft voting averages probabilities; hard voting counts labels.
Trap: saying bagging reduces bias. It mainly reduces variance. Practise: Ensemble Learning MCQs.
Unsupervised Learning
- K-means: assign to nearest centroid, update centroids; minimises WCSS.
- WCSS always falls as k rises, so pick the elbow or the best silhouette, not the minimum.
- Single linkage = minimum distance (chaining); complete = maximum (compact).
- PCA explained variance ratio = eigenvalue ÷ sum of eigenvalues.
- Association-rule lift below 1 means negative association.
Trap: confusing k-means (k clusters, unsupervised) with k-NN (k neighbours, supervised). Practise: Unsupervised Learning MCQs.
Model Evaluation & Validation
| Metric | Formula | TP 40, FP 10, FN 20, TN 130 |
|---|---|---|
| Precision | TP / (TP + FP) | 0.80 |
| Recall | TP / (TP + FN) | 0.667 |
| Specificity | TN / (TN + FP) | 0.929 |
| F1 | 2PR / (P + R) | 0.727 |
- AUC = probability a random positive outranks a random negative.
- Use stratified k-fold for imbalance, group k-fold for repeated users, time-series split for ordered data.
Trap: swapping precision and recall denominators. Practise: Model Evaluation MCQs and the confusion matrix set.
Feature Engineering & Selection
- Filter (statistics, cheap), wrapper (retrains the model: RFE, forward selection), embedded (Lasso, tree importance).
- Feature selection keeps original columns; extraction (PCA) builds new ones.
- n features give n(n − 1)/2 pairwise interactions.
- Cyclical features (hour) use sin and cos.
Trap: a near-perfect validation score from one feature usually means target leakage. Practise: Feature Engineering MCQs.
Deep Learning Fundamentals
- A single perceptron cannot learn XOR; an MLP can.
- Output layer: sigmoid for binary, softmax for single-label multi-class, linear for regression.
- Loss: MSE or MAE for regression, binary or categorical cross-entropy for classification.
- 10,000 examples at batch size 100 = 100 iterations per epoch.
- Dropout is used only during training.
Trap: forgetting biases in parameter counts. A 784-128-10 network has 101,770 parameters. Practise: Deep Learning MCQs and overfitting and underfitting.
Advanced Deep Learning
- Conv output = (n + 2p − f) / s + 1, rounded down. Output depth = number of filters.
- LSTM gates: forget, input, output. GRU gates: reset, update.
- Attention = softmax(QKᵀ / √d_k) V; cost is O(n²) in sequence length.
- BERT = encoder, masked language modelling; GPT = decoder, next-token prediction.
- Fine-tune with a small learning rate.
Trap: thinking transformers know word order without positional encodings. Practise: Advanced Deep Learning MCQs.
Natural Language Processing (NLP)
- Stemming chops suffixes (studies → studi); lemmatisation gives dictionary forms (better → good).
- TF-IDF = tf × log(N ÷ df); a term in every document has idf 0.
- Skip-gram predicts context from the centre word; CBOW the reverse.
- Static embeddings give "bank" one vector; contextual models give each occurrence its own.
Trap: assuming bag-of-words handles negation. "Not good" still contains "good". Practise: NLP MCQs.
Computer Vision
- Pooling has no weights and changes height and width, never depth.
- IoU = overlap ÷ union.
- Two-stage detectors (Faster R-CNN) are usually more accurate; one-stage (YOLO, SSD) are faster.
- Semantic segmentation labels pixels by class; instance segmentation separates each object.
Trap: dividing the overlap by one box's area instead of the union. Practise: Computer Vision MCQs.
Big Data Analytics (Introductory)
- 5 Vs: volume, velocity, variety, veracity (quality), value.
- HDFS default block is 128 MB in Hadoop 2.x and 3.x, with 3 replicas.
- NameNode holds metadata; DataNodes hold blocks. The Secondary NameNode is not a failover.
- MapReduce: map, shuffle and sort, reduce.
- Spark transformations are lazy; actions (count, collect) trigger execution.
Trap: calling duplicate or wrong values "variety". That is veracity. Practise: Big Data MCQs.
Model Deployment & MLOps Basics
- Online inference is judged on latency; batch on throughput.
- Canary: some users see the new model. Shadow: none do, outputs are only logged.
- Data drift changes P(X); concept drift changes P(y|X).
- A feature store prevents training-serving skew.
Trap: calling a change in P(y|X) "data drift". It is concept drift. Practise: MLOps MCQs.
AI Ethics, Security & Privacy
- Equal opportunity equalises TPR; equalised odds equalises TPR and FPR.
- LIME is local surrogate; SHAP contributions add to the prediction.
- FGSM is a white-box evasion attack; poisoning happens at training time.
- Differential privacy: smaller epsilon = stronger privacy.
Trap: thinking removing names anonymises data. Date of birth, sex and postcode can re-identify people. Practise: AI Ethics MCQs.
Most-tested comparisons
| Pair | Key difference |
|---|---|
| Precision vs recall | Divide by predicted positives vs actual positives |
| Bagging vs boosting | Parallel, cuts variance vs sequential, cuts bias |
| K-means vs k-NN | Unsupervised clustering vs supervised classifier |
| Stemming vs lemmatisation | Rule-based chop vs dictionary form |
| Data drift vs concept drift | P(X) changes vs P(y|X) changes |
| LSTM vs GRU | Three gates plus cell state vs two gates |
| Semantic vs instance segmentation | Class per pixel vs mask per object |
| Filter vs wrapper selection | Statistic only vs retrains the model |
Last-48-hours checklist
- Compute precision, recall, F1 and specificity from one confusion matrix.
- Work out a conv output size with padding and stride.
- Recite the sigmoid, ReLU and softmax ranges.
- Match each output layer to its loss function.
- State what bagging and boosting each reduce.
- Write the k-means loop and the elbow rule.
- Recall the LSTM and GRU gates.
- Explain data leakage and how a Pipeline prevents it.
- Calculate entropy and Gini for a 50/50 node.
- Name the 5 Vs and Hadoop's NameNode and DataNode roles.
- Separate canary, shadow and blue-green deployment.
- Define equal opportunity versus equalised odds.
- Redo every item in your error log, then one timed set in subject-wise mock tests.
For a one-page version, use the AI & ML cheat sheet. Every topic is listed on the AI & ML MCQ hub.
FAQs
Which AI & ML topics should I revise first?
Start with model evaluation and supervised learning, because they need calculation and come up across other topics too. Then cover deep learning output sizes and activations, then ensembles and clustering. If you are unsure where you stand, a diagnostic test shows which topics cost you most marks.
Do I need to code for this area?
You need to read short Python, not write long programs. Expect to predict what NumPy or pandas code returns, spot data leakage in a scikit-learn snippet, or pick the right method call. Knowing views versus copies, loc versus iloc, and the axis rule covers most of it.
How much maths do I need for AI & ML?
Matrix shapes, basic probability including Bayes' theorem, mean, median, standard deviation and the idea of a gradient. You do not need proofs. Most marks come from applying a formula correctly, such as precision, the conv output size or information gain, so practise the calculations rather than memorising derivations.
Why is accuracy a misleading metric?
On imbalanced data, a model that always predicts the majority class scores high accuracy while catching nothing useful. With 99% genuine transactions, "always genuine" scores 99% and finds no fraud. Check precision, recall or F1 for the rare class instead.
How should I fit these notes into my schedule?
Read one or two topics a day, followed immediately by their MCQs. The 30-day plan spreads this area alongside the others; in the final week, switch to the checklist and the 7-day plan.
Next step
Open the confusion matrix practice set now, then test all areas together in an NSCT mock test.