Assignment-2 ML Solution by Loknath Regmi
Assignment-2 ML Solution by Loknath Regmi
What is Regression?
Definition: Regression is a supervised learning technique used to predict a continuous
numerical value based on input features.
Goal: To estimate a function that maps input variables to a continuous output.
Real-world Examples:
Predicting house prices based on size, location, and number of rooms.
Forecasting temperature for the next day.
Estimating the amount of rainfall.
Predicting sales revenue for a company.
What is Classification?
Definition: Classification is a supervised learning technique used to predict discrete
class labels or categories.
Goal: To assign input data points to one of several predefined classes.
Real-world Examples:
Email spam detection (spam or not spam).
Medical diagnosis (cancerous or non-cancerous).
Handwriting recognition (digits 0-9).
Sentiment analysis (positive, negative, neutral).
Detailed Comparison Table between Regression and Classification:
Example Task Predicting house prices, temperature Email spam detection, image recognition
Nature of Output Real numbers (e.g., 250,000 dollars) Classes or labels (e.g., Spam or Not Spam)
Evaluation Metrics Mean Squared Error (MSE), R-squared Accuracy, Precision, Recall, F1-score
Output
Interpretation Exact numerical prediction Probability or direct class label prediction
Use Case Examples Stock price prediction, weather forecasting Disease diagnosis, customer segmentation
Summary
Regression is used when the target variable is continuous and numeric.
Classification is used when the target variable is categorical.
Both are supervised learning methods but solve fundamentally different types of
problems.
The choice depends on the problem statement and the nature of the output variable.
2. Explain the Workflow of a Supervised Learning Model. What Are the Main
Components?
=> Supervised learning is a core approach in machine learning where a model learns to map
inputs to outputs using labeled data. The workflow involves several structured steps, each crucial
for building an effective predictive model.
Step/Component Description
Model Evaluation Assess model performance using test data and suitable metrics
Main Components Features, Labels, Model, Loss Function, Optimizer, Evaluation Metric