0% found this document useful (0 votes)
2 views25 pages

Machine Learning Unit 1

Machine learning is a subfield of AI focused on developing algorithms that enable computers to learn from data and make predictions. It includes types such as supervised, unsupervised, semi-supervised, and reinforcement learning, with applications in image recognition, speech recognition, traffic prediction, product recommendations, and self-driving cars. The machine learning lifecycle involves steps like data gathering, preparation, analysis, model training, testing, and deployment, ensuring the model performs effectively in real-world scenarios.

Uploaded by

theswaran909
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)
2 views25 pages

Machine Learning Unit 1

Machine learning is a subfield of AI focused on developing algorithms that enable computers to learn from data and make predictions. It includes types such as supervised, unsupervised, semi-supervised, and reinforcement learning, with applications in image recognition, speech recognition, traffic prediction, product recommendations, and self-driving cars. The machine learning lifecycle involves steps like data gathering, preparation, analysis, model training, testing, and deployment, ensuring the model performs effectively in real-world scenarios.

Uploaded by

theswaran909
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/ 25

MACHINE LEARNING

UNIT 1
MACHINE LEARNING
Machine learning is a subfield of artificial intelligence (AI) that
focuses on the development of algorithms and statistical models that
enable computers to perform tasks without explicit programming
instructions. The primary goal of machine learning is to allow
computers to learn from data and make predictions or decisions based
on that learning.
Types of Machine Learning:
1. Supervised Learning:
In supervised learning, the algorithm learns from labeled data, where each input-output pair is
provided during the training phase. The algorithm aims to learn the mapping from input to
output.

2. Unsupervised Learning:
Unsupervised learning involves training algorithms on data without labeled responses. The
algorithm tries to find patterns or structures within the data.

3. Semi-supervised Learning:
This approach combines both labeled and unlabeled data for training. It's particularly useful
when labeled data is scarce.

4. Reinforcement Learning:
Reinforcement learning involves training algorithms to make sequential decisions. The
algorithm learns to interact with an environment by receiving feedback in the form of rewards or
penalties.
Applications of Machine learning
■ 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, a key application of machine learning, helps computers identify
objects, people, places, and more in digital images.
■ One popular example is automatic friend tagging on Facebook:
When we upload a photo with our friends on Facebook, the platform automatically
suggests tagging them by name. This is made possible by machine learning algorithms
that detect and recognize faces.
Behind the scenes, Facebook uses a project called "Deep Face" for face recognition and
identifying people in photos. It's all about making it easier for us to tag our friends in
pictures without having to manually do it ourselves.
2. Speech Recognition

■ Speech recognition, a common use of machine learning, powers features like "Search by
voice" in Google.
■ It works by converting spoken words into text, also known as "Speech to text."
■ Many applications, like Google Assistant, Siri, Cortana, and Alexa, use machine learning
algorithms for speech recognition. They understand and respond to voice commands,
making it easier for users to interact with technology using their voice.
3. Traffic prediction
■ When we use Google Maps to navigate to a new destination, it not only shows us the shortest route
but also predicts the traffic conditions along the way

■ This prediction is based on two main factors:

1. Real-time data: Google Maps gathers information about the current location of vehicles through its
app and various sensors. It tracks the movement of cars on the roads to determine if traffic is flowing
smoothly, moving slowly, or heavily congested.

2. Historical data: Google Maps also considers past traffic patterns for the same route and time of day.
By analyzing data from previous days, it estimates how long it typically takes to travel the route at that
particular time. By combining real-time and historical data, Google Maps can provide accurate
predictions about traffic conditions, helping users plan their journeys more efficiently.
4. Product recommendations
■ Many e-commerce and entertainment companies like Amazon and Netflix use
machine learning to recommend products to users.
For example, when we search for a product on Amazon, we might start seeing ads for
similar products while browsing the internet. This is because Amazon's machine
learning algorithms understand our interests and suggest relevant products.
Similarly, when we use Netflix, we receive recommendations for movies and TV shows
based on our viewing history. Machine learning helps Netflix understand our
preferences and suggests content we're likely to enjoy
5. Self-driving cars
■ Self-driving cars represent one of the most fascinating applications of machine learning. Tesla,
a leading car manufacturer, is at the forefront of developing self-driving technology.
■ In self-driving cars, machine learning algorithms play a crucial role in enabling vehicles to
navigate and make decisions autonomously. Tesla utilizes unsupervised learning methods to
train its car models to detect and recognize people, objects, and obstacles while driving.
■ This technology allows self-driving cars to perceive their surroundings, make real-time
decisions, and safely navigate roads without human intervention. It's an exciting advancement
that holds the promise of revolutionizing transportation and improving road safety in the future
Key Algorithms
1. Linear Regression: A basic algorithm for modeling the relationship
between a dependent variable and one or more independent variables.
2. Logistic Regression: For binary classification problems, logistic
regression estimates the probability that an instance belongs to a
particular class.
3. Decision Trees: Decision trees recursively split the data based on
features, resulting in a tree-like structure used for classification or
regression tasks.
4. Random Forests: An ensemble learning method that constructs
multiple decision trees during training and outputs the mode of the
classes (classification) or the average prediction (regression).
5. Support Vector Machines (SVM): SVM finds the optimal hyperplane
that best separates classes in high-dimensional space.
Key Algorithms
6. Neural Networks: Inspired by the human brain, neural networks consist of
interconnected layers of nodes (neurons) that process input data. Deep neural networks
(DNNs) are neural networks with multiple hidden layers.
7. Clustering Algorithms: Such as K-means, hierarchical clustering, etc., used in
unsupervised learning to group similar data points together.
8. Dimensionality Reduction Techniques: Like Principal Component Analysis (PCA) and t-
distributed Stochastic Neighbor Embedding (tSNE), used to reduce the number of
features in a dataset while preserving its essential characteristics
Evaluation Metrics:
Various metrics are used to assess the performance of machine learning models, including
accuracy, precision, recall, F1-score, ROC-AUC, mean squared error (MSE), etc.

Model Training and Evaluation


1. Data preprocessing involves tasks such as cleaning, normalization, and feature engineering
to prepare the data for training.
2. Models are trained using optimization algorithms that minimize a loss function, which
quantifies the model's error.
3. After training, models are evaluated on a separate test set to assess their generalization
performance. Cross-validation techniques can also be used to assess performance more
reliably.
Machine learning finds applications across various domains, including but not limited to
healthcare, finance, marketing, image recognition, natural language processing, and
autonomous vehicles. It continues to evolve rapidly with advancements in algorithms,
computing power, and data availability.
Definition of learning systems
■ What is a Learning System?
A learning system is essentially a collection of artifacts that are ‘brought together’, in an
appropriate way, to create an environment that will facilitate various types of learning process.
➢ Learning systems can take a variety of different forms - for example, a book, a mobile form, a
computer, an online forum, a school, and a university.
➢ Most learning systems will provide various types of learning resources and descriptions of
procedures for using these to achieve particular learning outcomes.
➢ “Machine Learning enables a Machine to automatically learn from Data, improve performance
from an Experience, and predict things without explicitly programmed.”
➢ In Simple Words, when we feed the Training Data to the Machine Learning Algorithm, this
algorithm will produce a mathematical model and with the help of the mathematical model, the
machine will make a prediction and take a decision without being explicitly programmed.
➢ Also, during training data, the more machines will work with it the more it will get experience
and the more efficient results is produced
■ Example: Predicting Student Grades Imagine you're a teacher and you want to predict the
final grades of your students based on their study hours. You collect data on past students,
including the number of hours they studied and their final grades. This dataset serves as
your labeled training data.
■ 1. Data Collection:
➢ You record the number of hours each student spends studying and their corresponding final
grades.
2. Data Representation:
➢ Each student's data point consists of two features:
the number of hours studied (input)
and the final grade achieved (output).
3. Model Selection:
➢ You decide to use a simple linear regression model for this task. Linear regression is a
straightforward supervised learning algorithm used for predicting numerical values based on
input features.
4. Training:
➢ You split your dataset into a training set and a test set. Let's say you allocate 80% of the data
for training and 20% for testing.
➢ You train the linear regression model on the training data. The model learns to fit a straight
line to the data, minimizing the difference between the predicted grades and the actual grades in
the training set.
5. Evaluation:
➢ After training, you evaluate the performance of the model using the test set. You calculate
metrics such as mean squared error (MSE) to quantify how close the predicted grades are to the
actual grades.
➢ A low MSE indicates that the model's predictions are close to the true values, suggesting good
performance.
6. Prediction:
➢ Once you're satisfied with the model's performance, you can use it to predict the grades of new
students based on their study hours.
➢ Given the number of study hours for a new student, the model can provide an estimate of their
final grade.
MACHINE LEARNING LIFECYCLE

■ Machine learning life cycle involves seven major steps, which are given below:
■ 1. Gathering Data:
➢ The first step in the machine learning journey is gathering data. This means finding and
collecting all the information we need.
➢ In this step, we look for data in different places like files, databases, the internet, or even
from mobile devices.
➢ This step is super important because the amount and quality of data we collect
determine how well our predictions will work. The more data we have, the better our
predictions will be.
➢ We do a few things in this step:
• Figure out where to get data from
• Collect the data
• Put all the data together from different places into one big set called a dataset.
Once we've got our dataset, we can move on to the next steps in our machine learning
adventure!
■ 2. Data preparation
After we collect our data, the next step is to prepare it for the rest of the machine learning
process. This step is called data preparation.
Here's what we do in data preparation:
1. Put Data Together and Randomize: First, we gather all our data into one place and mix it up
so it's not in any particular order.
2. Data Exploration:
➢ We take some time to understand the data we have. This means looking at what kind of data it
is, how it's structured, and if there are any mistakes or missing pieces.
➢ Understanding our data well helps us get better results later on. During this stage, we try to
find patterns, trends, and any unusual data bits.
3. Data Pre-processing:
➢ Once we know our data inside out, it is ready for analysis. So, in simple terms, data
preparation involves getting all data organized, understanding it, and then getting it ready to be
analyzed by our machine learning system.
3. Data Wrangling
Data wrangling is all about getting your data into shape so it's ready for analysis. This
process involves cleaning up the data, selecting the important parts, and transforming it
into a format that's easy to work with the next steps.
Here's why data wrangling is so important:
1. Cleaning Data: Sometimes, the data we collect isn't perfect. It might have missing
values, duplicates, invalid entries, or even random noise. Data wrangling helps us
identify and fix these issues to make our data more reliable.
2. Selecting Variables: Not all the data we collect will be useful for our analysis. Data
wrangling allows us to pick out the important variables that we actually need.

By using various techniques like filtering, we can clean up our data and make sure it's in
good shape for the next stages of our project. This is crucial because the quality of our
data directly impacts the quality of our final results.
■ 4. Data Analysis

Now that we've got our data all cleaned up and ready to go, it's time to start analyzing it. This step
involves a few key tasks:
1. Choosing Analysis Techniques: Just like picking the right tools for a job, we need to select the
best techniques for analyzing our data. This might involve methods like sorting, categorizing,
or finding patterns.
2. Building Models: Think of this like building a blueprint for a house. We use our data to create
models that help us understand and predict outcomes. We might use different types of
models depending on the problem we're trying to solve.
3. Reviewing Results: Once our models are built, we take a look at what they tell us. Are they
giving us the insights we expected? Do they accurately represent our data? This step helps us
fine-tune our analysis and make any necessary adjustments. So, in simple terms, in this step,
we take our cleaned-up data and use special algorithms to build models that help us
understand it better.
■ 5. Train Model
In the "Train Model" step, we teach our model to get better at its job. Here's how it works:

1. Training the Model: Just like teaching a student, we show our model lots of examples from
our datasets. This helps it learn different patterns, rules, and features in the data.
2. Using Machine Learning Algorithms: Think of these as different teaching methods. We use
various algorithms to train our model, each one helping it understand the data differently.

The goal here is to improve the model's performance so that it can give us better results when
we apply it to real-world problems.
■ 6. Test Model
In the "Test Model" step, we evaluate how well our trained machine learning model
performs. Here's what happens:
1. Testing the Model: After we've trained our model on a specific dataset, we give it a
different dataset to see how well it performs. This dataset is called a test dataset.
2. Checking Accuracy: We measure how accurate our model is by comparing its predictions
with the actual outcomes in the test dataset.
This gives us a percentage that shows how well the model performs according to the
project's requirements or the problem we're trying to solve.
The goal of this step is to ensure that our model is reliable and gives accurate predictions
when applied to new data
7. Deployment
In the "Deployment" phase, we put our machine learning model to work in the real world. Here's
how it unfolds:
1. Real-world Implementation: After ensuring our model delivers accurate results at an
acceptable speed, we integrate it into the actual system where it will be used.
2. Performance Monitoring: Before fully deploying the project, we continue to monitor the
model's performance with real-world data. This ensures that it maintains its accuracy and
effectiveness over time.
Think of the deployment phase as finalizing and presenting our project's findings. It's the
culmination of all the hard work put into developing and refining the machine learning model.
Previous year Questions
■ Write the applications of machine learning (5 marks 2024)
■ Explain the challenges of Machine Learning ( 8 Marks 2024)
■ Life cycle of developing a working model of machine learning (8 Marks )

You might also like