You are on page 1of 6

ASSIGNMENT - 1

OF
Machine Learning

SUBMITTED TO SUBMITTED BY
Dr Varun Malik Anubhav Monga
1955991509
Btech It 7A

DEPARTMENT OF COMPUTER APPLICATIONS


CHITKARA UNIVERSITY, PUNJAB
Q1 Differentiate between Supervised and Unsupervised Learning
Ans:
Sr.No Supervised Learning Unsupervised Learning
1 Supervised learning algorithms Unsupervised learning algorithms are trained
are trained using labeled data. using unlabeled data.
2 Supervised learning model takes Unsupervised learning model does not take
direct feedback to check if it is any feedback.
predicting correct output or not.
3 Supervised learning model Unsupervised learning model finds the hidden
predicts the output. patterns in data.
4 In supervised learning, input data In unsupervised learning, only input data is
is provided to the model along provided to the model.
with the output.
5 The goal of supervised learning The goal of unsupervised learning is to find
is to train the model so that it can the hidden patterns and useful insights from
predict the output when it is the unknown dataset.
given new data.
6 Supervised learning needs Unsupervised learning does not need any
supervision to train the model. supervision to train the model.
7 Supervised learning can be Unsupervised Learning can be classified in
categorized in Classification and Clustering and Associations problems.
Regression problems.
8 Supervised learning can be used Unsupervised learning can be used for those
for those cases where we know cases where we have only input data and no
the input as well as corresponding output data.
corresponding outputs.
9 Supervised learning model Unsupervised learning model may give less
produces an accurate result. accurate result as compared to supervised
learning.
Q2 Define following terms
1. Over-fitting
2. Under fitting
Ans:
Over-fitting:
Ø Overfitting occurs when our machine learning model tries to cover all the data
points or more than the required data points present in the given dataset.
Because of this, the model starts caching noise and inaccurate values present
in the dataset, and all these factors reduce the efficiency and accuracy of the
model. The overfitted model has low bias and high variance.
Ø The chances of occurrence of overfitting increase as much we provide training
to our model. It means the more we train our model, the more chances of
occurring the overfitted model.
Ø Overfitting is the main problem that occurs in supervised learning.

How to avoid the Overfitting in Model


Both overfitting and underfitting cause the degraded performance of the machine
learning model. But the main cause is overfitting, so there are some ways by which
we can reduce the occurrence of overfitting in our model.

• Cross-Validation
• Training with more data
• Removing features
• Early stopping the training
• Regularization
• Ensembling

Underfitting
Ø Underfitting occurs when our machine learning model is not able to capture
the underlying trend of the data. To avoid the overfitting in the model, the fed
of training data can be stopped at an early stage, due to which the model may
not learn enough from the training data. As a result, it may fail to find the best
fit of the dominant trend in the data.
Ø In the case of underfitting, the model is not able to learn enough from the
training data, and hence it reduces the accuracy and produces unreliable
predictions.
Ø An underfitted model has high bias and low variance.
How to avoid underfitting:
• By increasing the training time of the model.
• By increasing the number of features.

Q3 Discuss reinforcement learning


Ans:
Ø Reinforcement Learning is a feedback-based Machine learning technique in
which an agent learns to behave in an environment by performing the actions
and seeing the results of actions. For each good action, the agent gets
positive feedback, and for each bad action, the agent gets negative feedback
or penalty.
Ø In Reinforcement Learning, the agent learns automatically using feedbacks
without any labeled data, unlike supervised learning.
Ø Since there is no labeled data, so the agent is bound to learn by its
experience only.
Ø RL solves a specific type of problem where decision making is sequential, and
the goal is long-term, such as game-playing, robotics, etc.
Ø The agent interacts with the environment and explores it by itself. The primary
goal of an agent in reinforcement learning is to improve the performance by
getting the maximum positive rewards.
Ø The agent learns with the process of hit and trial, and based on the
experience, it learns to perform the task in a better way. Hence, we can say
that "Reinforcement learning is a type of machine learning method where an
intelligent agent (computer program) interacts with the environment and
learns to act within that." How a Robotic dog learns the movement of his arms
is an example of Reinforcement learning.
Ø Example: Suppose there is an AI agent present within a maze environment,
and his goal is to find the diamond. The agent interacts with the environment
by performing some actions, and based on those actions, the state of the
agent gets changed, and it also receives a reward or penalty as feedback.
Q4 Draw a neat diagram for decision tree classifier and explain its
working in detail with suitable example
Ans:
Ø Decision Tree is a Supervised learning technique that can be used for both
classification and Regression problems, but mostly it is preferred for solving
Classification problems. It is a tree-structured classifier, where internal nodes
represent the features of a dataset, branches represent the decision rules and
each leaf node represents the outcome.
Ø In a Decision tree, there are two nodes, which are the Decision Node and
Leaf Node. Decision nodes are used to make any decision and have multiple
branches, whereas Leaf nodes are the output of those decisions and do not
contain any further branches.
Ø The decisions or the test are performed on the basis of features of the given
dataset.
Ø It is a graphical representation for getting all the possible solutions to a
problem/decision based on given conditions.
Ø It is called a decision tree because, similar to a tree, it starts with the root
node, which expands on further branches and constructs a tree-like structure.
Ø In order to build a tree, we use the CART algorithm, which stands for
Classification and Regression Tree algorithm.
Ø A decision tree simply asks a question, and based on the answer (Yes/No), it
further split the tree into subtrees.

Below diagram explains the general structure of a decision tree:


Decision Tree Steps:
• Step-1: Begin the tree with the root node, says S, which contains the
complete dataset.
• Step-2: Find the best attribute in the dataset using Attribute Selection
Measure (ASM).
• Step-3: Divide the S into subsets that contains possible values for the best
attributes.
• Step-4: Generate the decision tree node, which contains the best attribute.
• Step-5: Recursively make new decision trees using the subsets of the dataset
created in step -3. Continue this process until a stage is reached where you
cannot further classify the nodes and called the final node as a leaf node.

You might also like