unit-2
unit-2
unit-2
The field of artificial intelligence (AI) and machine learning has been progressing rapidly
towards developing intelligent machines. These intelligent machines, also known as artificial
general intelligence (AGI) or strong AI, aim to exhibit human-level intelligence and perform a
wide range of tasks that typically require human intelligence.
Definitation of Machine Learning: It enables computers to learn from data and make decisions
or predictions without being explicitly programmed to do so. This is part of Artificial
Intelligence.
Normally, the software behaves the way the programmer programmed it; while machine learning
capable of accomplishing intended tasks by using statistical analysis and predictive analytics
techniques.
For Ex: You may have noticed that whenever we like or comment a friend’s pictures or videos
on a social media site, the related images and videos are posted earlier and keeps on displaying.
Same with the ‘people you may know’ suggestions, the system suggests us other user’s profiles
to add as a friend who is somehow related to our existing friend’s list. Wondering! How does the
system know that? That is called Machine learning. The software uses the statistical analysis to
identify the pattern as a user you are performing, and using the predictive analytics it populates
the related news feed on your social media site.
Why we need Machine Learning?
Advancements in AI and machine learning algorithms, coupled with the increasing availability
of big data and computational power, have fueled progress towards intelligent machines. Here
are a few key areas where advancements are being made:
Machine Learning: Machine learning algorithms, such as deep learning, have revolutionized AI
research. These algorithms enable machines to learn patterns and make predictions or decisions
based on data. With the availability of large datasets and improved models, machines are
becoming increasingly capable of understanding and extracting valuable insights from complex
data.
Natural Language Processing (NLP): NLP focuses on enabling machines to understand and
generate human language. Significant progress has been made in areas like machine translation,
sentiment analysis, and chatbots. NLP advancements have led to the development of virtual
assistants like Siri and Alexa, which can understand and respond to natural language queries.
Computer Vision: Computer vision is concerned with enabling machines to interpret and
understand visual information from images or videos. Advances in computer vision have led to
applications like object recognition, facial recognition, autonomous vehicles, and augmented
reality. Machines can now accurately identify and classify objects in real-time, enabling a wide
range of applications in various industries.
Reinforcement Learning: Reinforcement learning involves training machines to make decisions
by trial and error, receiving feedback in the form of rewards or penalties. This approach has
enabled machines to achieve superhuman performance in complex games like chess, Go, and
poker. Reinforcement learning is also being applied to robotics, where machines learn to perform
tasks in physical environments.
Explainable AI: As AI systems become more complex, there is a growing need for transparency
and interpretability. Researchers are working on developing techniques to make AI models and
their decision-making processes more understandable to humans. Explainable AI aims to provide
insights into how AI systems arrive at their decisions, enhancing trust and accountability.
While significant progress has been made, there are still challenges to overcome on the path
towards intelligent machines. Some of these challenges include ethical considerations,
ensuring fairness and avoiding bias in AI systems, addressing privacy concerns, and ensuring
the safety of AGI.
Overall, the development of intelligent machines holds great promise for enhancing various
aspects of our lives, including healthcare, transportation, education, and more. However, it is
important to approach the development and deployment of AI technologies with careful
consideration of their societal impact.
Certain examples that efficiently defines the well-posed learning problem are
Machine learning is a buzzword for today's technology, and it is growing very rapidly day by
day. We are using machine learning in our daily life even without knowing it such as Google
Maps, Google assistant, Alexa, etc. Below are some most trending real-world applications of
Machine Learning:
1. Image Recognition:
• Image recognition is one of the most common applications of machine learning. It is used
to identify objects, persons, places, digital images, etc. The popular use case of image
recognition and face detection is, Automatic friend tagging suggestion:
• Facebook provides us a feature of auto friend tagging suggestion. Whenever we upload a
photo with our Facebook friends, then we automatically get a tagging suggestion with
name, and the technology behind this is machine learning's face
detection and recognition algorithm.
• It is based on the Facebook project named "Deep Face," which is responsible for face
recognition and person identification in the picture.
2. Speech Recognition
• While using Google, we get an option of "Search by voice," it comes under speech
recognition, and it's a popular application of machine learning.
• Speech recognition is a process of converting voice instructions into text, and it is also
known as "Speech to text", or "Computer speech recognition." At present, machine
learning algorithms are widely used by various applications of speech
recognition. Google assistant, Siri, Cortana, and Alexa are using speech recognition
technology to follow the voice instructions.
3. Traffic prediction:
• If we want to visit a new place, we take help of Google Maps, which shows us the correct
path with the shortest route and predicts the traffic conditions.
• It predicts the traffic conditions such as whether traffic is cleared, slow-moving, or
heavily congested with the help of two ways:
o Real Time location of the vehicle form Google Map app and sensors
o Average time has taken on past days at the same time.
• Everyone who is using Google Map is helping this app to make it better. It takes
information from the user and sends back to its database to improve the performance.
4. Product recommendations:
• Machine learning is widely used by various e-commerce and entertainment companies
such as Amazon, Netflix, etc., for product recommendation to the user. Whenever we
search for some product on Amazon, then we started getting an advertisement for the
same product while internet surfing on the same browser and this is because of machine
learning.
• Google understands the user interest using various machine learning algorithms and
suggests the product as per customer interest.
• As similar, when we use Netflix, we find some recommendations for entertainment
series, movies, etc., and this is also done with the help of machine learning.
5. Self-driving cars:
One of the most exciting applications of machine learning is self-driving cars. Machine learning
plays a significant role in self-driving cars. Tesla, the most popular car manufacturing company
is working on self-driving car. It is using unsupervised learning method to train the car models to
detect people and objects while driving.
In this topic, we will provide a detailed description of the types of Machine Learning along with
their respective algorithms:
Let's understand supervised learning with an example. Suppose we have an input dataset of cats
and dog images. So, first, we will provide the training to the machine to understand the images,
such as the shape & size of the tail of cat and dog, Shape of eyes, colour, height (dogs are taller,
cats are smaller), etc. After completion of training, we input the picture of a cat and ask the
machine to identify the object and predict the output. Now, the machine is well trained, so it will
check all the features of the object, such as height, shape, colour, eyes, ears, tail, etc., and find
that it's a cat. So, it will put it in the Cat category. This is the process of how the machine
identifies the objects in Supervised Learning.
The main goal of the supervised learning technique is to map the input variable(x) with the
output variable(y). Some real-world applications of supervised learning are Risk Assessment,
Fraud Detection, Spam filtering, etc.
b) Regression
Regression algorithms are used to solve regression problems in which there is a linear
relationship between input and output variables. These are used to predict continuous output
variables, such as market trends, weather prediction, etc.
Some popular Regression algorithms are given below:
o Simple Linear Regression Algorithm
o Multivariate Regression Algorithm
o Decision Tree Algorithm
o Lasso Regression
In unsupervised learning, the models are trained with the data that is neither classified nor
labelled, and the model acts on that data without any supervision. The main aim of the
unsupervised learning algorithm is to group or categories the unsorted dataset according to the
similarities, patterns, and differences. Machines are instructed to find the hidden patterns from
the input dataset.
Let's take an example to understand it more preciously; suppose there is a basket of fruit images,
and we input it into the machine learning model. The images are totally unknown to the model,
and the task of the machine is to find the patterns and categories of the objects.
So, now the machine will discover its patterns and differences, such as colour difference, shape
difference, and predict the output when it is tested with the test dataset.
Categories of Unsupervised Machine Learning
Unsupervised Learning can be further classified into two types, which are given below:
o Clustering
o Association
1) Clustering
The clustering technique is used when we want to find the inherent groups from the data. It is a
way to group the objects into a cluster such that the objects with the most similarities remain in
one group and have fewer or no similarities with the objects of other groups. An example of the
clustering algorithm is grouping the customers by their purchasing behaviour.
Some of the popular clustering algorithms are given below:
o K-Means Clustering algorithm
o Mean-shift algorithm
o DBSCAN Algorithm
o Principal Component Analysis
o Independent Component Analysis
2) Association
Association rule learning is an unsupervised learning technique, which finds interesting relations
among variables within a large dataset. The main aim of this learning algorithm is to find the
dependency of one data item on another data item and map those variables accordingly so that it
can generate maximum profit. This algorithm is mainly applied in Market Basket analysis, Web
usage mining, continuous production, etc.
Some popular algorithms of Association rule learning are Apriori Algorithm, Eclat, FP-growth
algorithm.
3. Semi-Supervised Learning
Semi-Supervised learning is a type of Machine Learning algorithm that lies between Supervised
and Unsupervised machine learning. It represents the intermediate ground between Supervised
(With Labelled training data) and Unsupervised learning (with no labelled training data)
algorithms and uses the combination of labelled and unlabeled datasets during the training
period.
Although Semi-supervised learning is the middle ground between supervised and unsupervised
learning and operates on the data that consists of a few labels, it mostly consists of unlabeled
data. As labels are costly, but for corporate purposes, they may have few labels. It is completely
different from supervised and unsupervised learning as they are based on the presence & absence
of labels.
To overcome the drawbacks of supervised learning and unsupervised learning algorithms, the
concept of Semi-supervised learning is introduced. The main aim of semi-supervised learning is
to effectively use all the available data, rather than only labelled data like in supervised learning.
Initially, similar data is clustered along with an unsupervised learning algorithm, and further, it
helps to label the unlabeled data into labelled data. It is because labelled data is a comparatively
more expensive acquisition than unlabeled data.
We can imagine these algorithms with an example. Supervised learning is where a student is
under the supervision of an instructor at home and college. Further, if that student is
self-analysing the same concept without any help from the instructor, it comes under
unsupervised learning. Under semi-supervised learning, the student has to revise himself after
analyzing the same concept under the guidance of an instructor at college.
4. Reinforcement Learning
In reinforcement learning, there is no labelled data like supervised learning, and agents learn
from their experiences only. The reinforcement learning process is similar to a human being; for
example, a child learns various things by experiences in his day-to-day life. An example of
reinforcement learning is to play a game, where the Game is the environment, moves of an agent
at each step define states, and the goal of the agent is to get a high score. Agent receives
feedback in terms of punishment and rewards.
Due to its way of working, reinforcement learning is employed in different fields such as Game
theory, Operation Research, Information theory, multi-agent systems.
A reinforcement learning problem can be formalized using Markov Decision Process (MDP). In
MDP, the agent constantly interacts with the environment and performs actions; at each action,
the environment responds and generates a new state.
1. Numpy
2. Scipy
3. Scikit-learn
4. TensorFlow
5. Keras
6. PyTorch
7. Pandas
8. Matplotlib
1. Numpy
SciPy is a library for scientific computing in Python. It provides various functions and
algorithms for numerical integration, optimization, signal processing, and linear algebra. SciPy
builds on top of NumPy and provides additional functionality for scientific computing tasks.
SciPy is extensively used in machine learning for optimization, signal processing, and statistical
analysis tasks. It offers functions for numerical integration, interpolation, and solving differential
equations. SciPy also provides statistical distributions and hypothesis-testing functions, making it
a valuable tool for data analysis and modelling.
3.Scikit-learn
5. Keras
Keras is a high-level deep-learning library that provides a user-friendly interface for building and
training neural networks. It offers a wide range of pre-built layers, activation, and loss functions,
making it easy to create complex neural network architectures. Keras supports CPU and GPU
acceleration and can seamlessly integrate with other deep learning libraries like TensorFlow.
Keras is extensively used in deep learning projects for tasks such as image recognition, text
classification, and generative modeling. It provides a simple and intuitive API for defining and
training neural networks, allowing rapid prototyping and experimentation. Keras also supports
transfer learning and model deployment on various platforms.
6.PyTorch
PyTorch is a popular deep-learning library that provides a flexible and efficient framework for
building and training neural networks. It offers dynamic computational graphs, automatic
differentiation, and GPU acceleration, making it a preferred choice for deep learning research
and development.
PyTorch is extensively used in deep learning projects for tasks such as image classification,
object detection, and natural language processing. It provides many pre-built neural network
architectures, modules, optimization algorithms, and loss functions. PyTorch also supports
transfer learning and model deployment on various platforms.
7.Pandas
Pandas is a powerful library for data manipulation and analysis. It provides data structures like
DataFrames and Series for efficient, structured data handling. Pandas offers a wide range of data
cleaning, transformation, and exploration functions, making it an essential tool for machine
learning tasks.
Pandas are extensively used in data preprocessing, feature engineering, and exploratory data
analysis. It enables tasks such as data cleaning, missing value imputation, and data aggregation.
Pandas also integrates well with other libraries like NumPy and Matplotlib, facilitating seamless
data analysis and visualization.
8.Matplotlib
Matplotlib is a popular library for data visualization in Python. It provides a wide range of
functions and classes for creating various types of plots, including line plots, scatter plots, bar
plots, and histograms. Matplotlib is highly customizable and allows for detailed control over plot
aesthetics.
Matplotlib is extensively used in machine learning for visualizing data distributions, model
performance, and feature importance. It enables the creation of informative and visually
appealing plots that aid in data exploration and model interpretation. Matplotlib integrates well
with other libraries like NumPy and Pandas, making it a versatile tool for data visualization.