AL-702-D Machine Learning for Data Science

Machine Learning for Data Science (AL-702-D) Important Questions

RGPV · B.Tech · CSE-AIML · Semester 7 · Current scheme · 2 papers (2023 to 2025)

  1. Read the answers

    Start with the topics that come every year.

  2. Revise unit notes

    Go through each unit once to score more.

Paperwala Imp Topics - Machine Learning for Data Science important questions

Download Paperwala Imp Question & Answer (PDF)

Counted from the questions in the past papers listed on this site. Repeated = how many times the topic came in those papers.

Machine Learning for Data Science important questions with answers

Each answer starts with the short answer. Then come the points to write, a diagram and an exam tip. The questions under each topic are copied from the RGPV papers.

Q1. Algorithms: characteristics, tools to analyze them, divide and conquer, randomization

Asked 2 times in 2023, 2025 · Unit 1

From the papers

  • “Explain how the randomization technique can improve algorithm performance.” (Jun 2025)
  • “Introduce algorithms. Write down characteristics of algorithms.” (Nov 2023)
  • “With clear explanation describe the tools to analyze algorithms.” (Nov 2023)
  • “Describe in detail the concept of Divide and Conquer technique with the help of a related example.” (Nov 2023)

The short answer

An algorithm is a finite, step by step procedure that turns an input into the required output. We analyze it to predict its running time and memory as the input grows. Divide and conquer and randomization are two techniques that make algorithms faster.

Write these points

Characteristics of an algorithm

  • Input: zero or more well defined inputs.
  • Output: at least one output.
  • Definiteness: every step is clear, with one meaning.
  • Finiteness: it stops after a finite number of steps.
  • Effectiveness: each step is simple enough to be carried out.
  • Generality: works for every valid input of the problem.

Tools to analyze algorithms

ToolWhat it gives
Counting basic operationsSteps as a function of n
Asymptotic notation O, Ω, ΘUpper, lower and tight growth bounds
Best, average and worst caseBehaviour on different inputs
Recurrence relations, master theoremTime of recursive algorithms
Amortized analysisAverage cost over a sequence of operations
Profiling and benchmarksReal measured time and memory

Divide and conquer

  1. Divide the problem into smaller sub-problems of the same kind.
  2. Conquer each sub-problem recursively; solve tiny ones directly.
  3. Combine the answers.
  • Examples: merge sort, quick sort, binary search, Strassen's matrix multiplication; in ML, building decision trees and k-d trees.

Randomization

  • A randomized algorithm uses random choices: random pivot in quick sort, random restarts, random sampling.
  • It avoids the worst case on unlucky inputs (sorted data), gives good expected time and is often simpler.
  • Las Vegas: always correct, random time (randomized quick sort). Monte Carlo: fixed time, small chance of error (random sampling estimates).

Gain from a random pivot.

Quick sort on 1,000 already sorted numbers with the first element as pivot: about n²/2 = 500,000 comparisons.

With a random pivot the expected count is about 1.39 n log₂ n = 1.39 × 1,000 × 10 ≈ 13,900.

That is about 36 times fewer comparisons.

Merge sort (divide and conquer) gives T(n) = 2T(n/2) + n = O(n log n) on every input.

Real-life example

Finding a word in a dictionary by opening it in the middle, then in the middle of the correct half, is divide and conquer. Shuffling cards before dealing so no one can plan the order is randomization.

Figure: merge sort by divide and conquer
Figure: merge sort by divide and conquer

Same or opposite: divide and conquer and randomization

PointDivide and conquerRandomizationSame or opposite
IdeaSplit, solve, combineUse random choicesOpposite
Aims to make algorithms fasterYesYesSame
Result each runSameCan differOpposite
ExampleMerge sortRandomized quick sortOpposite

Exam tip. List the six characteristics and the analysis tools with O, Ω and Θ. Write the three steps of divide and conquer with merge sort, then how a random pivot avoids the worst case.

Back to the topic list

Q2. Graphs, maps and map searching, stable marriages, dictionaries and hashing

Asked 2 times in 2023, 2025 · Unit 2

From the papers

  • “What is the role of hash tables in search algorithms?” (Jun 2025)
  • “Discuss use of Machine Learning in the field of Graphs, Maps and Map searching.” (Nov 2023)
  • “Discuss application of Stable marriages algorithms in the field of Machine Learning.” (Nov 2023)

The short answer

A graph is a set of nodes joined by edges; a road map is a weighted graph (places and road lengths). Map searching finds the best route with algorithms such as Dijkstra or A*. The stable marriage algorithm (Gale-Shapley) pairs two groups so that no two people would both rather be with each other. Hash tables store dictionaries so that search takes about constant time.

Write these points

Machine learning with graphs and maps

  • Route search: Dijkstra (shortest path) and A* (with a heuristic) on road graphs.
  • ML predicts edge weights such as travel time from traffic data.
  • Graph neural networks and link prediction for maps, social networks and recommendations.
  • Clustering of locations and map matching of GPS points.

Stable marriages (Gale-Shapley)

  1. Each free proposer proposes to the highest ranked receiver not yet tried.
  2. A receiver keeps the best offer so far and rejects the rest.
  3. Rejected proposers try their next choice.
  4. Stop when everyone is matched: the matching is always stable, in O(n²) proposals.
  • ML uses: matching students to colleges, doctors to hospitals, users to items, ads to slots, predicted objects to true objects in tracking.

Dictionaries and hashing

  • A hash function h(k) maps a key to a slot of an array.
  • Collisions (two keys, one slot) are handled by chaining or open addressing.
  • Average search, insert and delete: O(1), against O(log n) for a search tree and O(n) for a list.
  • Uses in search: symbol tables, caches, duplicate detection, word counts in text mining, feature hashing in ML.

Shortest route with Dijkstra.

Roads: A to B 4 km, A to C 2 km, C to B 1 km, B to D 5 km, C to D 8 km.

Start at A: C = 2. Through C, B = 2 + 1 = 3 (better than 4).

D through B = 3 + 5 = 8; through C = 2 + 8 = 10.

Shortest route A, C, B, D of length 8 km.

Real-life example

A cab app is all three: the city is a graph, the route comes from map search, riders are matched to drivers like stable marriages and each rider's details are found instantly by hashing.

Figure: stable matching
Figure: stable matching
Figure: hash table with chaining
Figure: hash table with chaining

Same or opposite: hash table and search tree

PointHash tableBalanced search treeSame or opposite
Average searchO(1)O(log n)Opposite
Stores key and value pairsYesYesSame
Keeps keys in orderNoYesOpposite
Range queriesPoorGoodOpposite

Exam tip. Define graph and map, then explain Dijkstra with a small example. Write the Gale-Shapley steps with one ML use. End with hashing, collisions and O(1) search.

Back to the topic list

Q3. Dynamic programming in machine learning and personal genomics

Asked 2 times in 2023, 2025 · Unit 2

From the papers

  • “Discuss the applications of dynamic programming in personal genomics.” (Jun 2025)
  • “Describe the importance of the Dynamic programming algorithm with the help of related example in Machine learning.” (Nov 2023)

The short answer

Dynamic programming (DP) solves a problem by breaking it into overlapping sub-problems, solving each one once and storing the answer in a table. It works when the problem has optimal substructure: the best answer is built from best answers of smaller parts.

Write these points

Steps

  1. Define the sub-problem (a table cell).
  2. Write the recurrence that links a cell to smaller cells.
  3. Fill the table bottom up (or recurse with memoization).
  4. Read the answer from the final cell; trace back for the solution.

Importance in machine learning

  • Viterbi algorithm: best hidden state sequence in a hidden Markov model (speech, part of speech tagging).
  • Value iteration and policy iteration in reinforcement learning (Bellman equation).
  • Dynamic time warping: comparing time series of different speed.
  • Forward-backward algorithm for HMM training.

Applications in personal genomics

  • Sequence alignment: Needleman-Wunsch (global) and Smith-Waterman (local) align a person's DNA reads to the reference genome.
  • Longest common subsequence and edit distance between DNA strings.
  • Finding genes and mutations (SNPs, insertions, deletions) from aligned reads.
  • RNA structure prediction and haplotype phasing.

Longest common subsequence of AGCT and ACT.

Table cell = diagonal + 1 when letters match, else the larger of left and up.

Row C: under C the letters match, so 1 + 1 = 2. Row T: under T they match, so 2 + 1 = 3.

Bottom right cell = 3, so the LCS is ACT.

Only 4 × 3 = 12 cells were filled, against checking all 2⁴ = 16 subsequences of AGCT; for real DNA the saving is enormous.

Real-life example

Climbing stairs one or two steps at a time, you count ways for step 10 from the counts for steps 9 and 8, written on a list as you go. That stored list is dynamic programming.

Figure: dynamic programming table for DNA strings
Figure: dynamic programming table for DNA strings

Same or opposite: dynamic programming and divide and conquer

PointDynamic programmingDivide and conquerSame or opposite
Sub-problemsOverlappingIndependentOpposite
Breaks a problem into smaller onesYesYesSame
Stores answersYes, in a tableNoOpposite
ExampleSequence alignmentMerge sortOpposite

Exam tip. Define DP with overlapping sub-problems and optimal substructure. List the steps, three ML uses and the genomics uses. Fill the small LCS table.

Back to the topic list

Q4. Personal genomics: massive raw data, data science on genomes, interconnectedness

Asked 2 times in 2023, 2025 · Unit 3

From the papers

  • “Describe the significance of data science in analyzing massive genomic data.” (Jun 2025)
  • “Explain the concept of Interconnectedness on Personal Genomes in Machine Learning.” (Nov 2023)

The short answer

Personal genomics studies one person's genome (about 3.1 billion DNA letters) to learn about health risks, ancestry and drug response. Sequencing produces massive raw data, so data science and ML are needed to store, align, find variants and link them to traits. Interconnectedness means that genomes are linked: relatives share DNA. Genes also act together in networks.

Write these points

Massive raw data and data science

  • One genome at 30× coverage gives about 100 GB of raw reads.
  • Pipeline: quality control, alignment to a reference, variant calling (about 4 to 5 million variants per person), annotation.
  • ML predicts which variants cause disease, polygenic risk scores, drug response (pharmacogenomics).
  • Data science gives distributed storage, compression and parallel computing (Hadoop, Spark, cloud).

Interconnectedness on personal genomes

  • Relatives: a parent and child share about 50% of DNA, siblings about 50%, first cousins about 12.5%. So one person's test also reveals information about relatives.
  • Gene networks: genes regulate each other; a trait comes from many genes and the environment.
  • Population links: comparing many genomes (GWAS) finds variants linked to a disease.
  • Privacy: anonymous genomes can be re-identified through relatives in public databases.

Size of genome data.

3.1 billion bases × 2 bits per base (A, C, G, T) = 6.2 billion bits ≈ 0.78 GB for one clean sequence.

Raw reads at 30× coverage with quality scores: about 100 GB.

Most of it matches the reference; storing only the 4 to 5 million variants needs a few hundred MB.

For 1 lakh people the raw data reach 10 PB, which is why genomics needs data science.

Real-life example

A family photo album shows that you look like your parents and cousins. Your genome is the same: your test also says something about them.

Figure: personal genome pipeline
Figure: personal genome pipeline

Same or opposite: raw genome data and variant data

PointRaw readsVariant fileSame or opposite
Size per personAbout 100 GBA few hundred MBOpposite
Comes from sequencingYesYesSame
ContentEvery read with qualityOnly differences from the referenceOpposite
Used forAlignment, callingAnalysis, ML modelsOpposite

Exam tip. Give the genome size and data volume numbers. Write the pipeline from reads to variants and the ML uses. Explain interconnectedness with the 50% and 12.5% sharing figures and privacy.

Back to the topic list

Q5. Machine learning basics: types, well-posed learning problems, lazy and eager learning

Asked 2 times in 2023, 2025 · Unit 4

From the papers

  • “Describe the main types of machine learning algorithms and their applications in data science.” (Jun 2025)
  • “What is a "Well-posed Learning" problem? Explain with an example.” (Nov 2023)
  • “Describe in detail about the concept of Lazy and Eager Learning using an example.” (Nov 2023)

The short answer

Machine learning builds programs that improve with experience. A learning problem is well-posed when it names a task T, a performance measure P and the experience E: a program learns if its performance at T, measured by P, improves with E. Lazy learners wait until a query arrives; eager learners build a model in advance.

Write these points

Main types and data science uses

TypeDataData science application
SupervisedLabelledChurn prediction, credit scoring, sales forecast
UnsupervisedUnlabelledCustomer segments, anomaly detection
Semi-supervisedFew labelsMedical image labelling
ReinforcementRewardsDynamic pricing, recommendation

Well-posed learning problem

  • Checkers: T = playing checkers; P = percent of games won; E = games played against itself.
  • Spam filter: T = classify e-mails; P = accuracy; E = e-mails labelled by users.
  • A badly posed problem (no clear P) cannot be judged or improved.
  • Before building a model, write T, P and E down: they fix the data to collect and the metric to report.

Lazy and eager learning

PointLazy (KNN, case based)Eager (decision tree, SVM, neural network)
TrainingJust stores data, fastBuilds a model, slow
PredictionSlow: compares with stored dataFast
MemoryKeeps all dataKeeps only the model
Adapts to new dataAt onceNeeds retraining

Lazy and eager on the same task.

Task: predict whether a loan will be repaid; 10,000 past loans.

Eager: a decision tree trains once (a few seconds) and answers each new loan in microseconds.

Lazy: KNN stores the 10,000 loans and computes 10,000 distances for every new application.

For 1,000 applications a day the tree is far faster; KNN fits better when data change daily.

Real-life example

A student who solves the practice book before the exam is an eager learner. One who looks up a similar solved question only when the exam question appears is a lazy learner.

Figure: types of machine learning
Figure: types of machine learning

Same or opposite: lazy and eager learning

PointLazy learningEager learningSame or opposite
Work doneAt query timeAt training timeOpposite
Learns from labelled examplesYesYesSame
Prediction speedSlowFastOpposite
ExampleKNNDecision treeOpposite

Exam tip. Define ML, then the well-posed problem with T, P and E and the checkers example. Give the types table with data science uses and the lazy versus eager table.

Back to the topic list

Q6. Linear classification: gradient descent delta rule and the least squared error hypothesis

Asked 2 times in 2023, 2025 · Unit 4

From the papers

  • “Define linear classification and probabilistic modeling in machine learning.” (Jun 2025)
  • “What is Gradient descent delta rule? Explain using an example.” (Nov 2023)
  • “Discuss in detail about the Least Squared Error Hypothesis in Machine Learning.” (Nov 2023)

The short answer

Linear classification separates classes with a straight line or plane, w·x + b = 0. The gradient descent delta rule (LMS or Widrow-Hoff rule) trains a linear unit by moving each weight against the gradient of the squared error. The least squared error hypothesis is the hypothesis that makes Σ(t − o)² smallest; under Gaussian noise it is also the most likely (maximum likelihood) hypothesis.

Write these points

Delta rule

  • Error E(w) = ½ Σ (t − o)², where t is the target and o = w·x the output.
  • Update: Δwᵢ = η (t − o) xᵢ, so wᵢ = wᵢ + Δwᵢ.
  • η is the learning rate. E is bowl shaped for a linear unit, so the rule reaches the minimum even when classes are not separable.
  • Batch version sums over all examples; stochastic version updates after each example.

Least squared error hypothesis

  • If targets are true values plus Gaussian noise, maximizing the likelihood P(D | h) gives the h with the least Σ(t − h(x))².
  • So minimizing squared error is not just a habit: it is the maximum likelihood choice under that noise model.
  • Used in linear regression, the delta rule and neural network training.

Linear classification and probabilistic modelling

  • Linear classifiers: perceptron, logistic regression, linear SVM. Predict class from the sign of w·x + b.
  • Probabilistic modelling describes data with probability distributions and learns their parameters (for example logistic regression gives P(class | x)).

One delta rule step.

x = (1, 2), w = (0.5, −0.2), target t = 1, η = 0.1.

Output o = 0.5 × 1 + (−0.2) × 2 = 0.1. Error t − o = 0.9.

Δw = 0.1 × 0.9 × (1, 2) = (0.09, 0.18). New w = (0.59, −0.02).

New output = 0.59 − 0.04 = 0.55, closer to 1. Repeating the step keeps shrinking the error.

Real-life example

Adjusting the shower knob a little at a time, by how far the water is from the temperature you want, is the delta rule.

Figure: gradient descent delta rule
Figure: gradient descent delta rule

Same or opposite: delta rule and perceptron rule

PointDelta rulePerceptron ruleSame or opposite
Output usedLinear output w·xThresholded outputOpposite
Updates weights by error times inputYesYesSame
Converges on non-separable dataYes, to least errorNoOpposite
BasisGradient descentMisclassificationOpposite

Exam tip. Write E(w), the update Δw = η (t − o) x and one numeric step. State why the least squared error hypothesis is the maximum likelihood one. Define linear classification.

Back to the topic list

Q7. Model selection, cross-validation and holdout

Asked 2 times in 2023, 2025 · Unit 4

From the papers

  • “Describe the steps involved in cross-validation and its role in model accuracy.” (Jun 2025)
  • “Explain how model selection is essential for machine learning performance.” (Jun 2025)
  • “Write a detailed note on Holdout in Machine Learning.” (Nov 2023)

The short answer

Model selection is choosing the best model and its hyperparameters for a task. It must be judged on data the model has not seen. The holdout method keeps aside one test part of the data; cross-validation rotates the test part so every record is tested once and the estimate is steadier.

Write these points

Holdout

  • Split data, for example 70% training and 30% testing (or train, validation and test).
  • Train on the training part, measure on the test part.
  • Fast and simple, but the score depends on one lucky or unlucky split and uses less data for training.

k-fold cross-validation steps

  1. Shuffle the data and split it into k equal folds (k = 5 or 10).
  2. For each fold: train on the other k − 1 folds and test on this fold.
  3. Record the score of each round.
  4. Report the mean (and spread) of the k scores.
  5. Stratified folds keep class ratios; leave-one-out uses k = n.

Why model selection matters

  • Too simple a model underfits; too complex a model overfits.
  • Comparing models by cross-validation picks the one that generalizes best.
  • Tunes hyperparameters (k in KNN, depth of a tree, C in SVM) with grid or random search.
  • Keeps the final test set untouched for an honest final score.

5-fold cross-validation.

1,000 records, 5 folds of 200.

Round accuracies: 82%, 85%, 80%, 84%, 79%.

Mean = 410 ÷ 5 = 82%.

A single holdout split could have reported anything from 79% to 85%; the mean of five is far more reliable.

Real-life example

A teacher who tests a student on five different question sets and takes the average judges the student more fairly than one surprise test.

Figure: 5-fold cross-validation
Figure: 5-fold cross-validation

Same or opposite: holdout and k-fold cross-validation

PointHoldoutk-fold cross-validationSame or opposite
SplitsOnek rotating splitsOpposite
Estimates performance on unseen dataYesYesSame
Variance of estimateHighLowOpposite
CostOne training runk training runsOpposite

Exam tip. Define model selection and holdout. Write the k-fold steps with a 5-fold numeric example. Say why the right model avoids under and overfitting.

Back to the topic list

Q8. Probabilistic modelling and probabilistic inference

Asked 2 times in 2023, 2025 · Unit 5

From the papers

  • “Discuss the concept of probabilistic inference in data science.” (Jun 2025)
  • “Explain Probabilistic modelling using an example under the Machine Learning applications.” (Nov 2023)
  • “Discuss about the need and usage of Probabilistic Inference in Machine Learning.” (Nov 2023)

The short answer

Probabilistic modelling describes data and uncertainty with random variables and probability distributions, such as Gaussian, Bernoulli or a Bayesian network. Probabilistic inference uses the model to answer questions: the probability of an unknown given what is observed, P(query | evidence), usually by Bayes' rule.

Write these points

Need and usage

  • Real data are noisy and incomplete; probabilities express how sure a prediction is.
  • Combine prior knowledge with new evidence (Bayesian updating).
  • Handle missing values and hidden variables (EM, HMM).
  • Uses: spam filtering, medical diagnosis, recommendation, fraud detection, forecasting with error bars.

Kinds of inference

KindQuestionExample
PosteriorP(cause | effect)Disease given a positive test
PredictionP(future | past)Rain tomorrow given today
Most likely explanationBest hidden sequenceViterbi in speech
Parameter learningBest parameters for dataMaximum likelihood, MAP
  • Exact methods: Bayes' rule, variable elimination. Approximate methods: sampling (Monte Carlo, MCMC), variational inference.

Inference in a spam model.

P(spam) = 0.3. The word "free" appears in 60% of spam and 5% of normal mail.

P(free) = 0.6 × 0.3 + 0.05 × 0.7 = 0.18 + 0.035 = 0.215.

P(spam | free) = 0.18 ÷ 0.215 = 0.84.

One word raised the spam belief from 30% to 84%; more words update it further.

Real-life example

A weather forecast that says "70% chance of rain" is probabilistic modelling. Deciding to carry an umbrella after seeing dark clouds is inference.

Figure: probabilistic modelling and inference
Figure: probabilistic modelling and inference

Same or opposite: probabilistic modelling and probabilistic inference

PointModellingInferenceSame or opposite
StepBuild the model of variablesUse the model to answer questionsOpposite
Works with probabilitiesYesYesSame
OutputDistributions, parametersProbability of a queryOpposite
ExampleSpam model with word probabilitiesChance of spam given the word freeOpposite

Exam tip. Define both terms and say why uncertainty needs them. Give the kinds of inference table and solve one Bayes' rule example.

Back to the topic list

Q9. Data description and preparation, cleaning and transformation; prediction of preterm birth

Asked 2 times in 2023, 2025 · Unit 5

From the papers

  • “Explain the importance of data cleaning in data preprocessing.” (Jun 2025)
  • “Discuss how data transformation affects model building in machine learning.” (Jun 2025)
  • “Discuss the concept of Data description and preparation under the Machine Learning applications.” (Nov 2023)

The short answer

Data description summarizes a data set: its variables, types, ranges, missing values and distributions. Data preparation then cleans and transforms it so a model can learn: most of a data scientist's time goes here. Prediction of preterm birth (birth before 37 weeks) is the syllabus case study that uses these steps on medical records.

Write these points

Data cleaning

  • Fill or drop missing values (mean, median, model based).
  • Remove duplicates; fix typing errors and inconsistent units.
  • Treat outliers (check, cap or remove).
  • Why it matters: "garbage in, garbage out": dirty data give wrong patterns and lower accuracy.

Data transformation

  • Scaling: min-max to 0 to 1, or z-score; needed for KNN, SVM, gradient descent.
  • Encoding: one-hot for categories.
  • Log transform for skewed values; binning; new features from old ones.
  • Effect: faster convergence, fair distances, better accuracy, models that can use every feature.

Preterm birth prediction

  1. Collect records: mother's age, previous preterm birth, blood pressure, diabetes, cervical length, number of babies, lifestyle.
  2. Describe and clean: missing lab values, wrong dates, outliers.
  3. Handle imbalance: only about 10% of births are preterm (oversampling, class weights).
  4. Train models: logistic regression, random forest, gradient boosting.
  5. Evaluate with recall and AUC, since missing a preterm case is costly; doctors use the risk score for early care.

Cleaning and scaling one record.

Mother's age range in the data 18 to 45; this mother is 30.

Min-max scaled age = (30 − 18) ÷ (45 − 18) = 12 ÷ 27 = 0.44.

Her blood pressure is missing; the median of all mothers, 118, is filled in.

"Previous preterm" = Yes becomes 1 by encoding. The record is now ready for the model.

Real-life example

Before cooking, vegetables are washed, peeled and cut to the same size. Data preparation does the same so the model can cook evenly.

Figure: data preparation
Figure: data preparation

Same or opposite: data cleaning and data transformation

PointCleaningTransformationSame or opposite
PurposeFix errors and gapsChange form and scaleOpposite
Part of preprocessingYesYesSame
ExamplesMissing values, duplicatesScaling, encoding, logOpposite
EffectCorrect patternsFaster, fairer learningOpposite

Exam tip. Define data description and preparation. List cleaning and transformation steps with their effect on the model. Write the preterm birth steps and one scaled record.

Back to the topic list

Q10. NP completeness

Asked 1 time in 2025 · Unit 3

From the papers

  • “Explain the concept of NP completeness in the context of algorithms.” (Jun 2025)

The short answer

P is the class of problems solvable in polynomial time. NP is the class whose solutions can be checked in polynomial time. A problem is NP-complete when it is in NP and every NP problem can be reduced to it in polynomial time. No fast algorithm is known for any NP-complete problem; finding one would prove P = NP.

Write these points

Key terms

ClassMeaningExample
PSolved in polynomial timeSorting, shortest path
NPAnswer checked in polynomial timeSudoku, subset sum
NP-hardAt least as hard as every NP problemTravelling salesman (optimization)
NP-completeIn NP and NP-hardSAT, 3-SAT, vertex cover, subset sum

Proving a problem NP-complete

  1. Show it is in NP: a proposed answer can be checked quickly.
  2. Pick a known NP-complete problem (3-SAT).
  3. Reduce it to the new problem in polynomial time.
  4. Then the new problem is NP-complete.
  • In ML and data science: training optimal decision trees, best feature subset selection and many clustering objectives are NP-hard, so we use greedy methods, heuristics and approximations.

Subset sum: easy to check, hard to find.

Set {3, 34, 4, 12, 5, 2}; target 9.

Checking a proposed answer {4, 5}: 4 + 5 = 9. One addition.

Finding it by brute force: 2⁶ = 64 subsets.

With 60 numbers there are 2⁶⁰ ≈ 10¹⁸ subsets: years of computing, though checking stays instant.

Real-life example

Checking a finished jigsaw puzzle takes a glance; solving it from a heap of pieces takes hours. NP-complete problems behave the same way.

Figure: complexity classes
Figure: complexity classes

Same or opposite: P and NP-complete problems

PointPNP-completeSame or opposite
Known fast algorithmYesNoOpposite
Solutions checked quicklyYesYesSame
ExampleSortingSubset sum, SATOpposite
Practical approachExact algorithmHeuristics, approximationOpposite

Exam tip. Define P, NP, NP-hard and NP-complete in a table. Write the reduction steps and give the subset sum example of quick checking against slow finding.

Back to the topic list

Q11. Ensemble classifiers

Asked 1 time in 2025 · Unit 4

From the papers

  • “What is ensemble learning? Explain its advantages in predictive modeling.” (Jun 2025)

The short answer

Ensemble learning combines several models (an ensemble classifier) so that their errors cancel and the combined prediction is more accurate and more stable than any single model. Main methods are voting, bagging, boosting and stacking.

Write these points

Methods

MethodHowExample
Voting or averagingMajority class or mean of predictionsThree classifiers vote
BaggingSame model on bootstrap samples, in parallelRandom forest
BoostingModels in sequence, each fixes earlier errorsAdaBoost, XGBoost
StackingA meta-model learns to combine base modelsLogistic regression over tree, SVM, KNN

Advantages in predictive modelling

  • Higher accuracy than single models.
  • Lower variance (bagging) and lower bias (boosting).
  • Less overfitting; more stable on new data.
  • Handles complex patterns; winning entries in most data science competitions are ensembles.
  • Drawbacks: slower, harder to explain.

Why voting helps.

Three independent classifiers, each right 70% of the time.

Majority is right when at least two are right: 3 × 0.7² × 0.3 + 0.7³ = 0.441 + 0.343 = 0.784.

The ensemble is right 78.4% of the time against 70% for one.

With more independent models the gain grows; correlated models gain less.

Real-life example

A cricket selection panel of five selectors makes fewer wrong picks than one selector alone. That panel is an ensemble.

Figure: bagging and boosting
Figure: bagging and boosting

Same or opposite: bagging and boosting

PointBaggingBoostingSame or opposite
TrainingParallelSequentialOpposite
Combines many modelsYesYesSame
Mainly reducesVarianceBiasOpposite
ExampleRandom forestAdaBoostOpposite

Exam tip. Define ensemble learning, give the methods table and list the advantages. Show the 70% to 78.4% voting calculation.

Back to the topic list

Q12. Topic modelling

Asked 1 time in 2025 · Unit 5

From the papers

  • “What are topic models and how are they applied in data analysis?” (Jun 2025)

The short answer

A topic model finds the hidden themes (topics) in a collection of documents. Each topic is a probability distribution over words. Each document is a mixture of topics. The most used model is latent Dirichlet allocation (LDA); older ones are LSA and pLSA.

Write these points

How LDA works

  1. Choose the number of topics K.
  2. Clean text: lower case, remove stop words, stem; build a document-word matrix.
  3. Randomly assign each word to a topic.
  4. Repeatedly reassign each word using P(topic | document) × P(word | topic) (Gibbs sampling or variational inference).
  5. Output: top words per topic and the topic mix of each document.

Applications in data analysis

  • Organizing and searching large news or research archives.
  • Customer review and survey analysis: what people talk about.
  • Recommendation of articles with similar topic mixes.
  • Trend detection over time; social media monitoring.
  • In bioinformatics: finding patterns in gene data.

Topic mix of one article.

K = 2 topics. Topic 1 top words: match, team, wicket. Topic 2 top words: election, minister, vote.

An article has 100 words: 70 assigned to topic 1, 30 to topic 2.

Topic mix = 70% sports, 30% politics (perhaps a sports minister at a match).

Searching for "sports" ranks this article high; a politics search also finds it.

Real-life example

A librarian who sorts a heap of unlabelled newspapers into sports, politics and business piles by the words they use is doing topic modelling by hand.

Figure: topic modelling with LDA
Figure: topic modelling with LDA

Same or opposite: topic modelling and text classification

PointTopic modellingText classificationSame or opposite
Labels neededNo (unsupervised)Yes (supervised)Opposite
Works on text dataYesYesSame
OutputTopics and mixturesOne class per documentOpposite
ExampleLDANaive Bayes spam filterOpposite

Exam tip. Define topic, topic model and LDA. Write the LDA steps and five applications. Show one document's topic mix.

Back to the topic list

Q13. OLAP, OLTP, data warehousing and data mining

Asked 1 time in 2025 · Unit 5

From the papers

  • “Define OLAP and OLTP and their applications in data warehousing.” (Jun 2025)
  • “Explain the connection between data warehousing and data mining in data science.” (Jun 2025)

The short answer

OLTP (online transaction processing) systems run daily operations: many short inserts and updates on current data. OLAP (online analytical processing) systems answer complex analysis queries on large historical data. A data warehouse stores integrated, cleaned historical data for OLAP. Data mining then finds patterns in that warehouse data.

Write these points

PointOLTPOLAP
PurposeRun the businessAnalyze the business
DataCurrent, detailedHistorical, summarized
QueriesShort reads and writesComplex, read mostly
DesignNormalized tablesStar or snowflake schema, data cube
UsersClerks, customersManagers, analysts
ExampleATM, ticket bookingSales trend by region and year

OLAP operations

  • Roll-up: summarize (city to state).
  • Drill-down: more detail (year to month).
  • Slice and dice: fix one or more dimensions.
  • Pivot: rotate the view.

Data warehousing and data mining

  1. OLTP systems and other sources feed the warehouse through ETL (extract, transform, load).
  2. The warehouse gives clean, integrated, time stamped data.
  3. OLAP explores it with cubes; data mining finds hidden patterns: associations, clusters, classifiers.
  4. Results go back to decisions and to the OLTP systems (for example offers at checkout).

Roll-up on a sales cube.

Sales in lakh: Indore 40, Bhopal 35, Jabalpur 25 (all in Madhya Pradesh); Pune 50, Mumbai 70 (Maharashtra).

Roll-up from city to state: Madhya Pradesh 40 + 35 + 25 = 100; Maharashtra 50 + 70 = 120.

Drill-down on Mumbai by month would show which month was best.

Mining the same warehouse might then find that tea and biscuits sell together in every city.

Real-life example

A bank's ATM recording each withdrawal is OLTP. The head office studying which branches withdraw most during festivals is OLAP on the warehouse.

Figure: from transactions to knowledge
Figure: from transactions to knowledge

Same or opposite: data warehousing and data mining

PointData warehousingData miningSame or opposite
RoleStore and organize dataFind patterns in dataOpposite
Supports decisionsYesYesSame
Main toolsETL, schemas, OLAP cubesClustering, classification, association rulesOpposite
OutputClean historical dataKnowledge and modelsOpposite

Exam tip. Give the OLTP versus OLAP table with examples. List the four OLAP operations. Draw the flow from OLTP through ETL and the warehouse to OLAP and mining.

Back to the topic list

Start with the latest papers

Machine Learning for Data Science - Jun 2025

Machine Learning for Data Science - Nov 2023

See all 2 papers →

Machine Learning for Data Science (AL-702-D) FAQs

What are the most important topics in Machine Learning for Data Science?

By how often they were asked in the papers on this site: Algorithms: characteristics, tools to analyze them, divide and conquer, randomization (2 times); Graphs, maps and map searching, stable marriages, dictionaries and hashing (2 times); Dynamic programming in machine learning and personal genomics (2 times); Personal genomics: massive raw data, data science on genomes, interconnectedness (2 times); Machine learning basics: types, well-posed learning problems, lazy and eager learning (2 times).

How were these Machine Learning for Data Science important questions chosen?

Each topic was counted from the questions in the past papers listed on this site (2023-2025). Repeated is the number of times the topic came. The counts come from keyword matching and the answers are not teacher-reviewed, so use them together with your syllabus.

Is there a PDF of Machine Learning for Data Science important questions with answers?

Yes. The Paperwala Imp Question & Answer PDF for Machine Learning for Data Science is free to download from this page.

The 13 most repeated topics of Machine Learning for Data Science (AL-702-D) for RGPV B.Tech CSE-AIML semester 7, counted from the previous year papers on this site.