0% found this document useful (0 votes)
11 views3 pages

ML QP

The document outlines key concepts in machine learning, including definitions of machine learning, supervised learning, and reinforcement learning. It also discusses the differences between supervised and unsupervised learning, data preparation issues, and provides a Python code example for handling outliers. Additionally, it details the life cycle of machine learning, data visualization techniques, and common methods for data transformation.

Uploaded by

Kaif Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

ML QP

The document outlines key concepts in machine learning, including definitions of machine learning, supervised learning, and reinforcement learning. It also discusses the differences between supervised and unsupervised learning, data preparation issues, and provides a Python code example for handling outliers. Additionally, it details the life cycle of machine learning, data visualization techniques, and common methods for data transformation.

Uploaded by

Kaif Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Section I:

Answer any Two of the Following Questions (2x2=4)


1. Define Machine Learning
Machine Learning (ML) is a branch of Artificial Intelligence (AI) that focuses on developing
algorithms that enable computers to learn from data and make decisions without explicit
programming. It is widely used across industries for tasks like fraud detection, self-driving cars, and
recommendation systems[1][2].

2. Define Supervised Learning


Supervised learning is a type of machine learning where the algorithm learns from labeled training
data. Each input is paired with a corresponding output, allowing the model to predict outcomes for
new data based on learned patterns[3][2].

3. Define Reinforcement Learning


Reinforcement Learning (RL) is a machine learning paradigm where an agent learns to make
decisions by interacting with an environment and receiving feedback in the form of rewards or
penalties. The goal is to maximize cumulative rewards over time [2].

Section II:

Answer any Two of the Following Questions (2x5=10)

1. Write the Differences Between Supervised Learning and Unsupervised Learning

Feature Supervised Learning Unsupervised Learning

Data Type Requires labeled data Works with unlabeled data

Goal Predict outcomes or classify data Discover hidden patterns or groupings

Algorithms Regression, Classification (e.g., Decision Clustering, Dimensionality Reduction (e.g., K-


Used Trees) Means, PCA)

Applications Fraud detection, recommendation Customer segmentation, anomaly detection


systems

Effort Required High effort to label datasets Less effort as no labeling is needed [3][2]
2. Explain Data Preparation Issues in Machine Learning
Data preparation involves refining raw data into a clean and structured format for machine learning
models. Key issues include:

o Data Quality: Incomplete, noisy, or inconsistent data can lead to inaccurate results.

o Data Cleaning: Removing duplicates, handling missing values, and correcting errors.

o Data Transformation: Converting raw data into usable formats (e.g., scaling numerical
features).

o Feature Engineering: Creating new features or selecting relevant ones for better model
performance.

o Overfitting Risks: Ensuring that models generalize well by avoiding excessive reliance on
training data patterns[4][5].

3. Write a Python Code for Handling Outliers

import numpy as np
import pandas as pd
data = {'Price': [632541, 425618, 356471, 7412512],
'Rooms': [2, 5, 3, 100],
'Square_Feet': [1600, 2850, 1780, 90000]}

df = pd.DataFrame(data)
df_cleaned = df[df['Rooms'] < 20]
df['Outlier'] = np.where(df['Rooms'] < 20, 0, 1)

print("Cleaned Data:")
print(df_cleaned)
print("\nData with Outlier Marking:")
print(df)

Section III: Answer any Two of the Following Questions (2x8=16)

1. Explain in Detail the Life Cycle of Machine Learning


The life cycle of machine learning involves several stages:
o Problem Definition: Identifying the objective and scope of the ML model.

o Data Collection: Gathering relevant datasets from various sources.

o Data Preparation: Cleaning and transforming raw data into usable formats.

o Model Selection: Choosing an appropriate algorithm based on the problem type (e.g.,
regression or clustering).

o Training: Feeding labeled or unlabeled data into the model to learn patterns.

o Evaluation: Assessing model performance using metrics like accuracy or precision.

o Deployment: Integrating the trained model into real-world applications.

o Monitoring and Maintenance: Continuously improving the model by retraining it with new
data[4][2].

2. Explain Data Visualization Techniques


Common techniques include:

o Basic Plots: Line plots, bar charts, pie charts for simple visualizations.

o Advanced Visualizations: Box plots, density plots, heatmaps for deeper insights.

o Interactive Visualizations: Dynamic charts and animations using libraries like Plotly and
Altair.

o Dashboards: Combining multiple visualizations into a cohesive interface for decision-


making[6].

3. Explain Common Methods for Data Transformation


Data transformation methods include:

o Normalization/Scaling: Adjusting numerical values to a common scale (e.g., Min-Max


Scaling).

o Encoding Categorical Variables: Converting categories into numerical values using


techniques like one-hot encoding.

o Log Transformation: Applying logarithmic scaling to reduce skewness in distributions.

o Dimensionality Reduction: Using techniques like Principal Component Analysis (PCA) to


reduce feature count while retaining key
information[5].

You might also like