Unit 13: Machine learning - Subjective Questions
ECAP776 • Practice Questions with Detailed Answers
20 questions
Define machine learning and explain its primary objective.
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.
Its primary objectives are to:
- Learn relationships and patterns from historical data.
- Make predictions or decisions for new data.
- Improve performance as more relevant data becomes available.
- Automate tasks that are difficult to define using fixed rules.
For example, an email spam filter learns from previously labeled emails and predicts whether a new email is spam.
Explain how machine learning differs from traditional rule-based programming.
In traditional programming, a programmer supplies data and explicitly written rules to produce an output. In machine learning, the system receives data and expected outputs during training and discovers the rules or patterns by itself.
- Traditional approach: Data + Rules → Output
- Machine-learning approach: Data + Expected Outputs → Learned Model
- The learned model can then process new data and generate predictions.
Traditional programming is suitable when rules are clear and stable. Machine learning is more useful when rules are complex, numerous, or difficult to specify, such as in image recognition or speech processing.
Describe the major stages involved in developing a machine-learning solution.
A typical machine-learning workflow contains the following stages:
- Problem definition: Identify the task and desired outcome.
- Data collection: Gather relevant and representative data.
- Data preparation: Clean missing, incorrect, or duplicate values and transform the data.
- Feature selection or engineering: Choose or create useful input variables.
- Model selection: Select a suitable learning algorithm.
- Training: Allow the algorithm to learn patterns from training data.
- Evaluation: Measure performance using unseen validation or test data.
- Deployment: Integrate the model into an application.
- Monitoring: Track performance and retrain the model when data patterns change.
Each stage affects the reliability and usefulness of the final model.
What are features, labels, instances, and models in machine learning? Explain with an example.
The basic terms are:
- Instance: One individual data record or observation.
- Feature: An input attribute used to make a prediction.
- Label or target: The correct output that a supervised model is expected to predict.
- Model: The learned representation that maps input features to an output.
For a house-price prediction system, one house is an instance; its area, number of rooms, and location are features; its selling price is the label; and the learned function that estimates prices is the model.
Classify the major types of machine learning and briefly explain each type.
The major types of machine learning are:
- Supervised learning: Learns from labeled examples containing both inputs and correct outputs. It is commonly used for classification and regression.
- Unsupervised learning: Works with unlabeled data and discovers hidden structures, groups, or relationships. Clustering is a common task.
- Semi-supervised learning: Uses a small amount of labeled data together with a larger amount of unlabeled data.
- Reinforcement learning: An agent learns by interacting with an environment and receiving rewards or penalties.
The appropriate type depends on the available data, the required output, and the nature of feedback.
Explain supervised learning, including its training process and common applications.
Supervised learning trains a model using labeled data. Every training instance contains input features and a known target value.
During training:
- The model receives an input.
- It produces a predicted output.
- The prediction is compared with the correct label.
- The learning algorithm adjusts the model to reduce prediction error.
- The process is repeated across many examples.
Common applications include:
- Email spam detection
- Disease classification
- Credit-risk assessment
- Sales and price prediction
- Handwritten digit recognition
After training, the model should generalize to new examples that were not part of the training data.
Distinguish between classification and regression in supervised learning.
Both classification and regression use labeled training data, but they predict different kinds of outputs.
- Classification predicts a discrete category or class. Examples include predicting whether an email is spam or not spam and identifying an image as a cat, dog, or bird.
- Regression predicts a continuous numerical value. Examples include estimating house prices, rainfall, temperature, or future sales.
A classification model may output class probabilities before selecting a category, whereas a regression model directly estimates a quantity. Thus, the nature of the target variable determines which task is appropriate.
Describe unsupervised learning and explain why it is useful.
Unsupervised learning analyzes data that has no predefined labels or correct outputs. Its purpose is to discover hidden patterns, structures, similarities, or unusual observations.
It is useful because:
- Labeling large datasets can be costly and time-consuming.
- Unknown groups may exist in the data.
- It can support exploratory data analysis.
- It can reveal relationships that were not specified beforehand.
Typical tasks include clustering, dimensionality reduction, association discovery, and anomaly detection. For example, a retailer can group customers according to similar purchasing behavior without having predefined customer categories.
What is clustering? Describe its purpose and provide suitable real-world examples.
Clustering is an unsupervised-learning task that divides data instances into groups called clusters. Instances in the same cluster should be more similar to one another than to instances in different clusters.
Its purposes include:
- Discovering natural groups in data
- Summarizing large datasets
- Supporting customer or document segmentation
- Identifying unusual observations
Examples include:
- Grouping customers by purchasing behavior
- Organizing news articles by topic
- Grouping patients with similar symptoms
- Segmenting an image into related regions
Because the data is unlabeled, the resulting clusters must be interpreted after the algorithm creates them.
Compare supervised learning and unsupervised learning in terms of data, objectives, tasks, and examples.
Supervised learning and unsupervised learning differ as follows:
- Data: Supervised learning requires labeled data, while unsupervised learning uses unlabeled data.
- Objective: Supervised learning predicts known targets; unsupervised learning discovers unknown structures.
- Feedback: Supervised models compare predictions with correct answers during training. Unsupervised models have no explicit correct answers.
- Typical tasks: Supervised learning includes classification and regression; unsupervised learning includes clustering, dimensionality reduction, and association discovery.
- Examples: Spam detection is supervised because emails have labels. Customer segmentation is unsupervised when customer groups are not predefined.
Supervised results are usually easier to evaluate objectively, whereas unsupervised results often require interpretation and domain knowledge.
Explain semi-supervised learning. Why might it be preferred over purely supervised learning?
Semi-supervised learning combines a small labeled dataset with a much larger unlabeled dataset. The labeled examples provide direct guidance, while the unlabeled examples help the model understand the broader structure of the data.
It may be preferred because:
- Obtaining raw data is often easy.
- Producing accurate labels may require significant time or expert knowledge.
- A limited labeled dataset may not represent all possible variations.
- Unlabeled data can sometimes improve generalization.
For example, thousands of medical images may be available, but only a small number may have diagnoses assigned by specialists. Semi-supervised learning can use both groups of images.
Describe the main components and learning cycle of reinforcement learning.
In reinforcement learning, an agent learns to make a sequence of decisions through interaction with an environment.
Its main components are:
- Agent: The learner or decision-maker.
- Environment: The world in which the agent operates.
- State: The current situation observed by the agent.
- Action: A decision taken by the agent.
- Reward: Feedback indicating the immediate value of an action.
- Policy: The strategy used to choose actions.
The cycle is: the agent observes a state, selects an action, receives a reward, enters a new state, and updates its policy. Its goal is to maximize the total long-term reward rather than only the immediate reward.
Differentiate reinforcement learning from supervised learning.
The two approaches differ in several ways:
- Feedback: Supervised learning receives the correct answer for each training example. Reinforcement learning receives rewards or penalties rather than explicit correct actions.
- Interaction: Supervised learning usually learns from a fixed dataset, while a reinforcement-learning agent interacts with an environment.
- Decision structure: Supervised predictions are often independent; reinforcement-learning actions can affect future states and rewards.
- Objective: Supervised learning minimizes prediction error. Reinforcement learning attempts to maximize cumulative reward.
- Exploration: A reinforcement-learning agent must balance trying new actions with using actions already known to work well.
Image classification is typically supervised, while training a game-playing agent is commonly a reinforcement-learning task.
Explain the exploration–exploitation trade-off in reinforcement learning.
The exploration–exploitation trade-off concerns how an agent selects actions:
- Exploration means trying unfamiliar actions to gain information about their possible rewards.
- Exploitation means selecting actions that currently appear to produce the highest reward.
Too much exploration can waste time on poor actions, while too much exploitation can cause the agent to miss a better strategy. A successful agent balances both behaviors: it explores enough to improve its knowledge and increasingly exploits effective actions as learning progresses. This balance is essential when the environment is uncertain or when the consequences of actions are not initially known.
What is the purpose of dividing a dataset into training, validation, and test sets?
The dataset is divided to measure whether a model can perform well on unseen data.
- Training set: Used by the learning algorithm to estimate model parameters and learn patterns.
- Validation set: Used during development to compare models, tune settings, and make design decisions.
- Test set: Used only after development to provide a final, unbiased estimate of model performance.
Using the same data for both training and final evaluation can produce misleadingly high results because the model may memorize those examples. The test set must remain separate to evaluate generalization fairly.
Define overfitting and underfitting. Explain their causes and possible remedies.
Overfitting occurs when a model learns training details and noise too closely. It performs very well on training data but poorly on unseen data. Causes include excessive model complexity, insufficient data, and data leakage. Remedies include simplifying the model, obtaining more data, applying regularization, and using proper validation.
Underfitting occurs when a model is too simple to capture important patterns. It performs poorly on both training and test data. Causes include an unsuitable algorithm, weak features, inadequate training, or excessive simplification. Remedies include using a more capable model, improving features, or training appropriately.
The goal is to achieve a balance that generalizes well.
Discuss the importance of data quality in machine learning.
A machine-learning model learns directly from its data, so poor-quality data usually produces unreliable predictions. Important data-quality considerations include:
- Accuracy: Values should represent reality correctly.
- Completeness: Important values and relevant cases should not be missing.
- Consistency: Data should follow compatible formats and definitions.
- Representativeness: The dataset should reflect the population on which the model will be used.
- Balance: Important classes should have sufficient examples.
- Freedom from leakage: Inputs must not contain information that would be unavailable during real prediction.
Data cleaning, preprocessing, and careful collection are therefore as important as selecting the learning algorithm.
Explain generalization in machine learning and state why it is more important than memorizing training data.
Generalization is a model's ability to make accurate predictions for new data that was not used during training. It is the central goal of machine learning because a deployed model normally encounters previously unseen instances.
Memorizing training data may produce a low training error without learning meaningful relationships. Such a model can fail when inputs vary slightly or contain new combinations of features. Generalization is assessed using separate validation and test data. Representative training examples, appropriate model complexity, suitable features, and proper evaluation all help produce a model that generalizes effectively.
Given a collection of customer records, explain how you would decide whether to use classification, regression, clustering, or reinforcement learning.
The choice depends on the required outcome and available feedback:
- Use classification when labeled records are available and the required output is a category, such as predicting whether a customer will cancel a subscription.
- Use regression when labeled records are available and the target is numerical, such as predicting a customer's future spending.
- Use clustering when labels are unavailable and the objective is to discover groups of customers with similar behavior.
- Use reinforcement learning when a system must repeatedly choose actions, observe customer responses, and maximize a long-term reward, such as selecting a sequence of personalized offers.
Thus, target type, label availability, interaction, and long-term consequences determine the appropriate approach.
Discuss the benefits, limitations, and responsible-use considerations of machine learning.
Benefits of machine learning include automation, rapid analysis of large datasets, detection of complex patterns, personalization, and improvement through additional data.
Limitations include dependence on data quality, computational cost, possible overfitting, difficulty explaining some models, and reduced reliability when real-world data changes.
Responsible use requires attention to:
- Bias and fairness: Training data may produce unequal outcomes.
- Privacy: Personal data must be collected and processed appropriately.
- Transparency: Users should understand when automated decisions are being made.
- Security: Models and data should be protected from manipulation.
- Accountability: Humans and organizations remain responsible for deployed systems.
- Monitoring: Performance should be checked after deployment.
Machine learning should be used only when its benefits justify its risks and its outputs can be evaluated appropriately.
Define machine learning and explain its primary objective.
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.
Its primary objectives are to:
- Learn relationships and patterns from historical data.
- Make predictions or decisions for new data.
- Improve performance as more relevant data becomes available.
- Automate tasks that are difficult to define using fixed rules.
For example, an email spam filter learns from previously labeled emails and predicts whether a new email is spam.
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 →