0% found this document useful (0 votes)
4 views

ml_unit_1

The document provides an introduction to machine learning, explaining its definition, working mechanisms, and applications across various fields. It differentiates machine learning from traditional programming, outlines types of machine learning methods, and delves into supervised learning with examples of classification and regression. Additionally, it covers reinforcement learning, case-based reasoning, artificial neural networks, and various activation functions used in neural networks.

Uploaded by

Ganesh Pandey
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)
4 views

ml_unit_1

The document provides an introduction to machine learning, explaining its definition, working mechanisms, and applications across various fields. It differentiates machine learning from traditional programming, outlines types of machine learning methods, and delves into supervised learning with examples of classification and regression. Additionally, it covers reinforcement learning, case-based reasoning, artificial neural networks, and various activation functions used in neural networks.

Uploaded by

Ganesh Pandey
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/ 19

UNIT-1

Chapter-01(Introduction to Machine Learning)


1. What is machine learning? Explain working of Machine Learning?
• Machine Learning is a system that can learn from example through self-improvement and without
being explicitly coded by programmer.
• The breakthrough comes with the idea that a machine can singularly learn from the data (i.e.,
example) to produce accurate results.
• Machine learning combines data with statistical tools to predict an output.
• This output is then used by corporate to makes actionable insights.
• Machine learning is closely related to data mining and Bayesian predictive modeling.
• The machine receives data as input, use an algorithm to formulate answers.
• Machine learning is also used for a variety of task like fraud detection, predictive maintenance,
portfolio optimization, automatize task and so on.

Working Of Machine Learning:


• Machine learning is the brain where all the learning takes place. The way the machine learns is
similar to the human being. Humans learn from experience. The more we know, the more easily we
can predict.
• By analogy, when we face an unknown situation, the likelihood of success is lower than the known
situation.
• Machines are trained the same. To make an accurate prediction, the machine sees an example.
When we give the machine a similar example, it can figure out the outcome. However, like a
human, if its feed a previously unseen example, the machine has difficulties to predict.
• The core objective of machine learning is the learning and inference.
• First of all, the machine learns through the discovery of patterns. This discovery is made thanks to
the data. One crucial part of the data scientist is to choose carefully which data to provide to the
machine.
• The list of attributes used to solve a problem is called a feature vector. You can think of a feature
vector as a subset of data that is used to tackle a problem.
• Inferring
When the model is built, it is possible to test how powerful it is on never-seen-before data. The new
data are transformed into a features vector, go through the model and give a prediction. This is all
the beautiful part of machine learning. There is no need to update the rules or train again the model.
You can use the model previously trained to make inference on new data.

2. Differentiate between machine learning and traditional learning?

Traditional programming differs significantly from machine learning.


• In traditional programming, a programmer code all the rules in consultation with an expert in the
industry for which software is being developed. Each rule is based on a logical foundation; the
machine will execute an output following the logical statement. When the system grows complex,
more rules need to be written. It can quickly become unsustainable to maintain.

• Machine learning is supposed to overcome this issue. The machine learns how the input and output
data are correlated and it writes a rule. The programmers do not need to write new rules each time
there is new data. The algorithms adapt in response to new data and experiences to improve
efficacy over time.
3. List and explain applications of Machine Learning?

• Virtual Personal Assistants: Siri, Alexa, Google Assistant help with tasks, from scheduling to setting
alarms, using machine learning and voice interaction.
• Traffic Predictions: Google Maps uses machine learning for real-time traffic updates and estimated arrival
times.
• Online Transportation Networks: Apps like Uber and Ola employ ML to estimate ride prices and predict
demand surge.
• Video Surveillance: ML-based systems monitor CCTV footage, detecting unusual behavior and potential
crime.
• Social Media Services: Facebook uses ML to personalize news feeds, suggest friends, and enable face
recognition. Pinterest uses ML for image recognition.
• Email Spam and Malware Filtering: ML aids in identifying spam and detecting malware patterns,
enhancing security.
• Online Customer Support: Chatbots on websites extract data and offer assistance using machine learning.
• Search Engine Result Refining: Google refines search results using ML, learning from user behavior to
improve accuracy.
• Product Recommendations: Amazon, Flipkart use ML to suggest items based on user behavior and
preferences.
• Online Fraud Detection: PayPal employs ML to distinguish legitimate transactions from fraudulent ones.
• Medicine: ML analyzes medical records, aiding doctors in understanding diseases and treatments better.
• Computational Biology: ML helps biologists in understanding relationships between genes and human
features.
• Handwriting Recognition: ML recognizes and reads handwriting for various applications, like routing
postal mail.
• Machine Translation: Google Translate uses ML to instantly translate text between different languages.
• Driverless Cars and Autonomous Vehicles: ML enables programs to learn and drive cars or helicopters
intuitively, bypassing the need for defining strict rules.

4. List all the types of machine learning methods and explain supervised learning
in details?
Type of Machine Learning methods:
• Supervised Learning.
• Unsupervised Learning.
• Reinforcement Learning.

Supervised Learning Method:


• Supervised learning as the name indicates the presence of a supervisor as a teacher.
• Basically supervised learning is a learning in which we teach or train the machine using data
which is well labeled that means some data is already tagged with the correct answer.
• After that, the machine is provided with a new set of examples(data) so that supervised
learning algorithm analyses the training data(set of training examples) and produces a correct
outcome from labeled data.
• For instance, suppose you are given an basket filled with different kinds of fruits. Now the
first step is to train the machine with all different fruits one by one like this:

• If shape of object is rounded and depression at top having color Red then it will be labelled as –
Apple.
• If shape of object is long curving cylinder having color Green-Yellow then it will be labelled as –
Banana.
• Now suppose after training the data, you have given a new separate fruit say Banana from basket and
asked to identify it.

• Since the machine has already learned the things from previous data and this time have to use it
wisely.
• It will first classify the fruit with its shape and color and would confirm the fruit name as BANANA
and put it in Banana category.
• Thus the machine learns the things from training data(basket containing fruits) and then apply the
knowledge to test data(new fruit).

• There are two categories of supervised learning:


• Classification task
• Regression task
5. Write a short note on classification and regression with example?

Classification
• In machine learning, classification refers to a predictive modeling problem where a class label is
predicted for a given example of input data.
• Classification in machine learning and statistics is a supervised learning approach in which the
computer program learns from the data given to it and make new observations or classifications.
• Classification is a process of categorizing a given set of data into classes, It can be performed on
both structured or unstructured data. The process starts with predicting the class of given data points.
The classes are often referred to as target, label or categories.
• The classification predictive modeling is the task of approximating the mapping function from input
variables to discrete output variables. The main goal is to identify which class/category the new data
will fall into.

Regression
• Regression analysis consists of a set of machine learning methods that allow us to predict a
continuous outcome variable (y) based on the value of one or multiple predictor variables (x).
Briefly, the goal of regression model is to build a mathematical equation that defines y as a function
of the x variables.
• Regression models are used to predict a continuous value. Predicting prices of a house given the
features of house like size, price etc is one of the common examples of Regression. It is a supervised
technique.

• Types of Regression
1. Simple Linear Regression
2. Polynomial Regression
3. Support Vector Regression
4. Decision Tree Regression
5. Random Forest Regression
6. Explain reinforcement learning with example?
• 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.
• 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.
7. Differentiate between Inductive and deductive learning?

Basis of Deductive Reasoning Inductive Reasoning


Comparison

Definition Deductive reasoning is the form of valid Inductive Reasoning arries at a


reasoning, to deduce new information or conclusion by the process of
conclusion from knowledge related facts and generalization using specific facts or
information. data.

Approach Deductive reasoning follows a top-down Inductive reasoning follows a


approach. bottom-up approach.

Starts from Deductive reasoning starts from Premises. Inductive reasoning starts from
Conclusion.

Validity In Deductive reasoning, the conclusion must In Inductive reasoning, the truth of
be true if the premises are true. premises does not guarantee the
truth of conclusions.

Usage Use of Deductive reasoning is difficult, as we Use of inductive reasoning is fast


need facts which must be true. and easy, as we need evidence
instead of true facts.
We often use it in our daily life.

Process Theory → Hypothesis → Observation → Patterns →


Patterns → Confirmation. Hypothesis → Theory.

Arguments In Deductive reasoning, arguments may be In Inductive reasoning, arguments


valid or invalid. may be weak or strong.

Structure Deductive reasoning reaches from general Inductive reasoning ranges from
facts to specific facts. specific facts to general facts.
8. With diagram Explain Case based learning?
• Case-based reasoning (CBR), broadly construed, is the process of solving new problems based on the
solutions of similar past problems.
• An auto mechanic who fixes an engine by recalling another car that exhibited similar symptoms is
using case-based reasoning.
• Case-based reasoning has been formalized for purposes of computer reasoning as a four-step process:
1. Retrieve:
Given a target problem, retrieve from memory cases relevant to solving it. A case consists of a
problem, its solution, and, typically, annotations about how the solution was derived.
2. Reuse:
Map the solution from the previous case to the target problem. This may involve adapting the
solution as needed to fit the new situation.
3. Revise:
Having mapped the previous solution to the target situation, test the new solution in the real world
(or a simulation) and, if necessary, revise.
4. Retain:
After the solution has been successfully adapted to the target problem, store the resulting
experience as a new case in memory.
Chapter-02(Artificial Neural Networks)
1. Draw and explain artificial neural network model?
• A neural network is a processing device, either an algorithm or an actual hardware,
whose design was inspired by the design and functioning of animal brains and
components.
• An artificial neural network (ANN) may be defined as an information processing
model that is inspired by the way biological nervous systems, such as the brain,
process information. This model is to replicate only the most basic functions of the
brain.
• The key element of ANN is the novel structure of is information processing system.
An ANN is composed of a large number of highly interconnected processing
elements (neurons) working in union to solve specific problems.

• Connections
• The neurons should be visualized for their arrangements in layers.
• A neural network consists of a set of highly interconnected processing elements
(neurons) such that each processing element output is found to be connected
through weight to the other processing elements or to itself.
• Hence, the arrangement of these processing elements and geometry are essential
for neural network
2. Explain Hebb Rule with training algorithm with its flow chart.
3. Desing Hebb network to train AND/NOT function use bipolar inputs and
targets.
4. Explain M-P model with diagram.
• The Mculloh-pitts neuron model was the earliest neural network discovered in 1943.
• It should be noted that the activation of a M-P neuron is binary, that is, at any time the the neuron may
fire or may not fire.
• The weight associated with the communication links may be excitatory(weight is positive) inhibitory
(weight is negative).
• The threshold plays a major role in M-P neuron there is a fixed threshold for each neuron, and if the
net input to the neuron is greater then the threshold then the neuron fires.
• The activation function use for mp model is
1 𝑖𝑓 𝑦𝑖𝑛 ≥ 𝜃
F (yin) = {
0 𝑖𝑓 𝑦𝑖𝑛 < 𝜃

• For inhibitior to be absolete, the threshold with the activation function should satisfy the following
condition
𝜃>nw-p
5. Implement AND function using M-P model use bipolar inputs and targets.
6. What is activation function? List and explain various types of activation?
• It’s just a thing function that you use to get the output of node. It is also known as Transfer
Function.
• Why we use Activation functions with Neural Networks?
• It is used to determine the output of neural network like yes or no. It maps the resulting values in
between 0 to 1 or -1 to 1 etc. (depending upon the function).
• The Activation Functions can be basically divided into 2 types-
a. Linear Activation Function
b. Non-linear Activation Functions

Linear or Identity Activation Function


• As you can see the function is a line or linear. Therefore, the output of the functions will not be confined
between any range.

Equation : f(x) = x
Range : (-infinity to infinity)
It doesn’t help with the complexity or various parameters of usual data that is fed to the neural networks.

Non-linear Activation Function


• The Nonlinear Activation Functions are the most used activation functions. Nonlinearity helps to makes
the graph look something like this
• It makes it easy for the model to generalize or adapt with variety of data and to differentiate between the
output.
Sigmoid or Logistic Activation Function
The Sigmoid Function curve looks like a S-shape.

• The main reason why we use sigmoid function is because it exists between (0 to 1).
• Therefore, it is especially used for models where we have to predict the probability as an output.
• Since probability of anything exists only between the range of 0 and 1, sigmoid is the right choice.
• The function is differentiable.That means, we can find the slope of the sigmoid curve at any two points.

Tanh or hyperbolic tangent Activation Function


• tanh is also like logistic sigmoid but better. The range of the tanh function is from (-1 to 1). tanh is also
sigmoidal (s - shaped)

• The advantage is that the negative inputs will be mapped strongly negative and the zero inputs will be
mapped near zero in the tanh graph.
• The function is differentiable.
• The function is monotonic while its derivative is not monotonic.
• The tanh function is mainly used classification between two classes.
ReLU (Rectified Linear Unit) Activation Function
• The ReLU is the most used activation function in the world right now.Since, it is used in almost all the
convolutional neural networks or deep learning.

• As you can see, the ReLU is half rectified (from bottom). f(z) is zero when z is less than zero and f(z) is
equal to z when z is above or equal to zero.
• Range: [ 0 to infinity)
• The function and its derivative both are monotonic.
SoftMax Activation Function

• The softmax function is used as the activation function in the output layer of neural network models
that predict a multinomial probability distribution.
• That is, softmax is used as the activation function for multi-class classification problems where class
membership is required on more than two class labels.

7. Write a short note on a) Weights b) Bias c) Learning Rate


Chapter-03(Classification)
1. Define classification? What are its applications?
• Classification models predict discrete value or class, while Regression models predict a continuous
value.
• Classification is a classical method which is used by machine learning researchers and statisticians
for predicting the outcome of unknown samples.
• It is used for categorization of objects (or things) into a given discrete number of classes.
• Classification problems can be of two types, either binary or multiclass
• Classification is defined as two types:
• Posteriori classification
• Priori classification

Applications of Classification:
• To analyze the credit history of bank customers to identify if it would be risky or safe to grant them
loans.
• To analyze the purchase history of a shopping mall’s customers to predict whether they will buy a
certain product or not.
• To predict how much a given customer will spend during a sale.
• To predict the salary-package of a student that he/she may get during his/her placement.
• Other Applications of Classifications:
• Email spam filtering
• Credit risk assessment
• Medical diagnosis
• Image classification
• Sentiment analysis.
• Fraud detection
• Quality control
• Recommendation systems

2. Write a short note on Binary and Multiclass classification with example?

• Classification is a classical method which is used by machine learning researchers and statisticians
for predicting the outcome of unknown samples. It is used for categorization of objects (or things)
into given discrete number of classes. Classification problems can be of two types, either binary or
multiclass.

• In binary classification the target attribute can only have two possible values. For example, a
tumor is either cancerous or not, a team will either win or lose, a sentiment of a sentence is either
positive or negative and so on.

• In multiclass classification, the target attribute can have more than two values. For example, a
tumor can be of type 1, type 2 or type 3 cancer; the sentiment of a sentence can be happy, sad,
angry or of love; news stories can be classified as weather, finance, entertainment or sports news.
3. Explain guidelines for size and quality of training data in classification.

• There should be a balance between the number of training samples and independent attributes.

• It has been observed that generally, the number of training samples required is likely to be
relatively small if the number of independent or input attributes is small and similarly, number of
training samples required is likely to be relatively large if the number of independent or input
attributes is large.

• The quality of the classifier depends upon the quality of the training data. If there are two or more
than two classes, then sufficient training data should be available belonging to each of these classes.

• Researchers have developed a number of classifiers that include: Decision Tree, Naïve Bayes,
Support Vector Machine and Neural Networks.

4. Differentiate between binary and multiclass classification?

Parameters Binary classification Multi-class classification

No. of classes It is a classification of two There can be any number of


groups, i.e. classifies objects in classes in it, i.e., classifies the
at most two classes. object into more than two
classes.
Algorithms used Logistic Regression k-Nearest Neighbors
k-Nearest Neighbors Decision Trees
Decision Trees Naive Bayes
Support Vector Machine Random Forest.
Naive Bayes Gradient Boosting

Examples Email spam detection (spam or Face classification.


not). Plant species classification.
Churn prediction (churn or not). Optical character recognition.
Conversion prediction (buy or
not).

You might also like