ml_unit_1
ml_unit_1
• 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.
• 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).
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?
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.
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
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.
• 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.
• 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.
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
• 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.