Unit 6: Machine Learning - Subjective Questions
ECAP792 • Practice Questions with Detailed Answers
20 questions
Define machine learning and explain its main objectives.
Machine learning (ML) is a branch of artificial intelligence that enables computer systems to learn patterns from data and improve their performance without being explicitly programmed for every situation.
Main objectives:
- Pattern discovery: Identify useful relationships and structures in data.
- Prediction: Estimate unknown or future outcomes from available observations.
- Classification: Assign inputs to predefined categories.
- Automation: Perform complex tasks with limited human intervention.
- Adaptation: Improve system performance as more data becomes available.
- Decision support: Provide data-driven recommendations.
An ML system learns from experience with respect to a task and performance measure if its performance on , measured by , improves with .
Explain the three essential components—task, experience, and performance measure—used to define a machine learning problem.
A well-defined machine learning problem contains the following components:
- Task (): The activity the system must learn to perform, such as classifying emails, predicting prices, or recognizing speech.
- Experience (): The data or interactions from which the system learns. For example, a spam filter may learn from previously labeled emails.
- Performance measure (): A quantitative criterion used to evaluate learning, such as accuracy, mean squared error, precision, or recall.
Example: For handwritten digit recognition:
- : Classify an image as a digit from 0 to 9.
- : A collection of labeled digit images.
- : Percentage of test images classified correctly.
Learning has occurred when performance on task improves through experience .
Distinguish between supervised, unsupervised, and reinforcement learning.
Supervised learning:
- Learns from labeled examples .
- Attempts to predict the correct output for a new input.
- Includes classification and regression.
- Examples include spam detection and house-price prediction.
Unsupervised learning:
- Uses data without known output labels.
- Discovers hidden patterns or structures.
- Includes clustering, dimensionality reduction, and association analysis.
- Examples include customer segmentation and anomaly exploration.
Reinforcement learning:
- An agent interacts with an environment.
- Feedback is provided through rewards or penalties.
- The objective is to learn a policy that maximizes cumulative reward.
- Examples include robot navigation and game playing.
Thus, the techniques differ mainly in the type of feedback available: explicit labels, no labels, or evaluative rewards.
Compare classification and regression as supervised learning techniques, giving suitable examples and evaluation measures.
Classification predicts a discrete category, whereas regression predicts a continuous numerical value.
Classification:
- Output: A class label such as spam or not spam.
- Examples: Disease detection, image recognition, and credit-risk category prediction.
- Common algorithms: Logistic regression, decision trees, support vector machines, and neural networks.
- Measures: Accuracy, precision, recall, -score, and area under the ROC curve.
Regression:
- Output: A continuous value such as price or temperature.
- Examples: Sales forecasting and house-price estimation.
- Common algorithms: Linear regression, regression trees, and neural networks.
- Measures: Mean absolute error, root mean squared error, and .
For targets and predictions , mean squared error is
Describe clustering as an unsupervised learning technique and explain its applications.
Clustering is an unsupervised learning technique that groups data objects so that objects within the same group are more similar to one another than to objects in other groups.
General process:
- Select useful features.
- Define a similarity or distance measure.
- Apply a clustering algorithm.
- Evaluate and interpret the resulting clusters.
For numerical data, Euclidean distance between two observations and is
Common methods:
- -means clustering
- Hierarchical clustering
- Density-based clustering
Applications:
- Customer segmentation
- Document organization
- Image segmentation
- Grouping similar biological samples
- Exploratory anomaly detection
Unlike classification, clustering does not begin with predefined class labels.
Explain reinforcement learning using the concepts of agent, environment, state, action, reward, and policy.
In reinforcement learning, a learner improves its behavior by interacting with an environment.
- Agent: The decision-making learner.
- Environment: The external system with which the agent interacts.
- State (): A representation of the current situation.
- Action (): A choice made by the agent.
- Reward (): Numerical feedback received after an action.
- Policy (): A strategy mapping states to actions.
At each step, the agent observes a state, selects an action, receives a reward, and moves to another state. Its goal is to maximize the expected discounted return
where is the discount factor.
The agent must balance exploration, which tests new actions, and exploitation, which uses actions already known to produce high rewards.
What is a learning problem? Explain how it can be formulated before developing a machine learning solution.
A learning problem is a problem in which a system must infer a general rule, model, or behavior from data or interaction rather than follow only fixed instructions.
Problem formulation includes:
- Defining the real-world objective.
- Specifying the task .
- Identifying the available experience .
- Selecting a suitable performance measure .
- Determining input features and target outputs.
- Choosing whether the problem is classification, regression, clustering, or reinforcement learning.
- Identifying constraints such as latency, interpretability, fairness, privacy, and computational cost.
- Establishing a baseline for comparison.
A precise formulation prevents the development of a technically accurate model that fails to solve the actual practical problem.
Describe the major steps involved in designing a machine learning system.
Designing a machine learning system generally involves these steps:
- Define the problem: Specify the task, intended users, constraints, and success criteria.
- Collect data: Obtain representative, relevant, and legally usable data.
- Prepare data: Clean errors, handle missing values, encode variables, and normalize features when needed.
- Split data: Create training, validation, and test sets.
- Select representations: Choose or construct features that capture useful information.
- Select a model: Choose algorithms suited to the task, data size, and constraints.
- Train the model: Estimate model parameters from training data.
- Tune the system: Use validation data to select hyperparameters.
- Evaluate: Measure generalization on unseen test data.
- Deploy and monitor: Integrate the model, observe performance, detect drift, and retrain when necessary.
The process is iterative because evaluation often reveals the need for better data, features, or model choices.
Explain the roles of training, validation, and test datasets in a learning system.
A dataset is commonly divided into three subsets:
- Training set: Used to estimate model parameters. The learning algorithm directly examines these examples while fitting the model.
- Validation set: Used to compare models, select features, tune hyperparameters, and decide when to stop training.
- Test set: Used only after model development to provide an unbiased estimate of final generalization performance.
The test set must not influence model or hyperparameter selection; otherwise, the reported performance may be overly optimistic.
When data is limited, -fold cross-validation can be used. The data is divided into folds, and the model is trained times, with a different fold used for validation each time. The average validation score is
Discuss the importance of data collection and data preprocessing when designing a learning system.
The performance of a learning system depends heavily on the quality and relevance of its data.
Data collection considerations:
- Data should represent the population and conditions in which the system will operate.
- Samples should be sufficiently numerous and diverse.
- Labels should be accurate and consistently defined.
- Collection must account for privacy, consent, ownership, and security.
- Sampling bias and class imbalance should be identified.
Data preprocessing activities:
- Remove duplicates and correct inconsistent records.
- Handle missing values through deletion or imputation.
- Detect and appropriately treat outliers.
- Encode categorical variables.
- Scale numerical variables where required.
- Transform text, images, or other raw inputs into usable features.
Poor-quality or biased data cannot usually be corrected merely by selecting a more sophisticated algorithm.
What is feature engineering? Explain why feature selection and feature transformation are important.
Feature engineering is the process of creating, selecting, or transforming input variables so that a learning algorithm can detect useful patterns more effectively.
Feature selection:
- Retains relevant variables and removes redundant or noisy ones.
- Reduces computational cost.
- Can improve interpretability.
- May reduce overfitting.
Feature transformation:
- Changes the representation or scale of variables.
- Examples include standardization, one-hot encoding, logarithmic transformation, and dimensionality reduction.
A common standardization formula is
where is the mean and is the standard deviation.
Effective features should contain information relevant to the target while avoiding data leakage, in which information unavailable at prediction time is accidentally included.
Define hypothesis space, target function, and learned model. Explain their relationship in concept learning.
In concept learning:
- Target function (): The unknown true mapping that assigns the correct output to every possible input.
- Hypothesis (): A candidate mapping proposed by the learner.
- Hypothesis space (): The set of all hypotheses the learning algorithm is permitted to consider.
- Learned model: The hypothesis selected from using the available training experience.
Given training examples , the learner searches for a hypothesis that minimizes an empirical loss such as
A very limited hypothesis space may fail to represent the target concept, while an excessively flexible space may fit noise. The objective is to select a hypothesis that performs well not only on training data but also on unseen examples.
Explain inductive learning and discuss the role of inductive bias in a machine learning system.
Inductive learning derives a general rule from a finite set of specific observations. Because many hypotheses can agree with the same training examples, a learner requires assumptions for choosing among them.
These assumptions are called inductive bias.
Forms of inductive bias include:
- Preferring simpler models.
- Restricting the hypothesis space.
- Assuming nearby observations have similar outputs.
- Assuming the data is generated by a particular probability distribution.
- Using regularization to discourage excessive complexity.
For example, linear regression assumes that the target can be approximated by a linear relationship. A decision-tree learner may prefer smaller trees.
Inductive bias is necessary for generalization, but an inappropriate bias can cause systematic errors or prevent the learner from representing important patterns.
Distinguish between model parameters and hyperparameters, and explain how each is determined.
Model parameters are internal values learned directly from training data.
Examples include:
- Weights and bias in linear regression
- Split values in a decision tree
- Coefficients in logistic regression
For a linear model
and are parameters estimated during training.
Hyperparameters are configuration choices set before or outside the main training procedure.
Examples include:
- Learning rate
- Number of neighbors in -nearest neighbors
- Maximum tree depth
- Regularization strength
- Number of neural-network layers
Hyperparameters are selected using validation data, cross-validation, grid search, random search, or other optimization methods. Test data should not be used for hyperparameter selection.
Explain underfitting and overfitting. How can each problem be identified and controlled?
Underfitting occurs when a model is too simple to capture important patterns.
- Training error is high.
- Validation or test error is also high.
- It may be reduced by using a richer model, better features, or weaker regularization.
Overfitting occurs when a model learns training-specific noise rather than general patterns.
- Training error is very low.
- Validation or test error is considerably higher.
- It may be reduced through more data, regularization, cross-validation, early stopping, feature selection, pruning, or a simpler model.
If is much smaller than , the model may be overfitting. If both are large, it may be underfitting.
The goal is good generalization, meaning low expected error on previously unseen data.
Discuss the bias–variance trade-off and its significance in selecting a learning model.
Prediction error can be understood through bias and variance:
- Bias: Error caused by overly restrictive assumptions. High-bias models often underfit.
- Variance: Error caused by excessive sensitivity to changes in training data. High-variance models often overfit.
- Irreducible noise: Random variation that cannot be eliminated by the model.
For squared-error regression, expected prediction error can be expressed conceptually as
A simple model usually has higher bias and lower variance, while a highly flexible model tends to have lower bias and higher variance. Model selection, regularization, cross-validation, and ensemble methods help find an appropriate balance that minimizes validation or generalization error.
Describe suitable performance measures for classification and explain why accuracy alone may be inadequate.
Classification evaluation begins with the numbers of true positives (), true negatives (), false positives (), and false negatives ().
Common measures:
- Accuracy:
- Precision:
- Recall:
- Specificity:
- -score:
Accuracy can be misleading for imbalanced data. For example, if only 1% of transactions are fraudulent, a system that always predicts non-fraud achieves 99% accuracy but detects no fraud.
The measure should reflect application costs. Medical screening may prioritize recall, whereas a system in which false alarms are expensive may prioritize precision.
Explain empirical risk minimization and regularization in the training of a learning model.
Empirical risk minimization selects model parameters that minimize average loss on the training data. For parameters ,
Minimizing training loss alone can produce an overly complex model. Regularization adds a penalty that discourages undesirable complexity:
where is a complexity penalty and controls its strength.
Examples:
- regularization penalizes squared parameter values.
- regularization penalizes absolute parameter values and may produce sparse models.
A small permits greater flexibility, while a large imposes stronger constraints. The value is normally selected using validation data.
Design a machine learning system for detecting spam emails, identifying the learning task, experience, representation, model, and evaluation strategy.
A spam-detection system can be designed as follows:
- Task: Perform binary classification by labeling each email as spam or legitimate.
- Experience: Use historical emails labeled by users or trained reviewers.
- Representation: Convert emails into features such as word frequencies, sender properties, embedded links, message length, and text embeddings.
- Data preparation: Remove duplicates, normalize text, protect personal information, and divide data chronologically where appropriate.
- Model: Start with a baseline such as logistic regression or naive Bayes, then compare it with tree-based or neural models.
- Training and validation: Fit models on the training set and tune thresholds and hyperparameters on validation data.
- Evaluation: Measure precision, recall, -score, and false-positive rate on unseen test data.
- Deployment: Assign spam scores and place messages above an approved threshold in the spam folder.
- Monitoring: Track user corrections, changing spam patterns, drift, latency, and subgroup performance.
False positives require particular attention because incorrectly blocking legitimate email can be costly.
Explain how deployment, monitoring, feedback, and model drift form part of a complete machine learning system.
A machine learning project is not complete when model training ends.
- Deployment: Integrates the model into an application, service, device, or business process.
- Monitoring: Tracks prediction quality, input distributions, latency, resource usage, failures, and fairness-related indicators.
- Feedback: Collects actual outcomes or user responses so that errors can be analyzed and future training data can be created.
- Model drift: Refers to deterioration caused by changes after deployment.
Types of drift:
- Data drift: The distribution of input variables changes.
- Concept drift: The relationship between inputs and target outcomes changes.
A robust system should define alerts, logging, human review, retraining criteria, version control, rollback procedures, and periodic evaluation. Continuous monitoring ensures that the deployed system remains accurate, safe, and relevant under changing real-world conditions.
Define machine learning and explain its main objectives.
Machine learning (ML) is a branch of artificial intelligence that enables computer systems to learn patterns from data and improve their performance without being explicitly programmed for every situation.
Main objectives:
- Pattern discovery: Identify useful relationships and structures in data.
- Prediction: Estimate unknown or future outcomes from available observations.
- Classification: Assign inputs to predefined categories.
- Automation: Perform complex tasks with limited human intervention.
- Adaptation: Improve system performance as more data becomes available.
- Decision support: Provide data-driven recommendations.
An ML system learns from experience with respect to a task and performance measure if its performance on , measured by , improves with .
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →