0% found this document useful (0 votes)
4 views27 pages

Chapter 1 - Introduction To Machine Learning

Chapter 1 introduces Machine Learning (ML) as a subset of Artificial Intelligence that enables systems to learn from data without explicit programming. It covers the ML process, types of ML (supervised, unsupervised, reinforcement), and essential tools like Python and libraries such as scikit-learn and NumPy. The chapter emphasizes the importance of generalization, common reasons for ML failures, and the role of frameworks and steps in the ML workflow.

Uploaded by

spalphaman24
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 views27 pages

Chapter 1 - Introduction To Machine Learning

Chapter 1 introduces Machine Learning (ML) as a subset of Artificial Intelligence that enables systems to learn from data without explicit programming. It covers the ML process, types of ML (supervised, unsupervised, reinforcement), and essential tools like Python and libraries such as scikit-learn and NumPy. The chapter emphasizes the importance of generalization, common reasons for ML failures, and the role of frameworks and steps in the ML workflow.

Uploaded by

spalphaman24
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

Chapter 1:

Introduction to
Machine Learning
Road Map
◼ What is Machine Learning?
◼ Machine Learning Process
◼ Types of Machine Learning
◼ Machine Learning Problems
◼ Machine Learning Framework
◼ Machine Learning Steps
◼ Generalization
◼ Reasons for ML failure
◼ Why Python?
◼ Essential Libraries and Tools
Chapter 1: Introduction 2
What is Machine Learning?

Machine Learning is a sub set of Artificial Intelligence (AI)


that provides system the ability to automatically learn and
improve from experience without being explicitly programmed

Predicts
Ordinary System With Artificial Machine Learning
Intelligence

Improves
Machine Learning Process

Learns from the


feedback

Prediction/Decision

Find Pattern

Analyse Data

Input Data
Cont..
▪ Machine learning is about extracting knowledge from
data. It is a research field at the intersection of
statistics, artificial intelligence, and computer science
and is also known as predictive analytics or statistical
learning.
▪ The application of machine learning methods has in
recent years become ubiquitous in everyday life.

▪ When you look at a complex website like Facebook,


Amazon, or Netflix, it is very likely that every part of
the site contains multiple machine learning models.
Cont..
▪ Machine learning is a class of
computational algorithms which iteratively
“learn” an approximation to some
function.
▪ Pedro Domingos, a professor of computer
science at the University of
Washington, laid out three
components that make up a machine
learning algorithm: representation,
evaluation, and optimization.
Cont..
Learning = Representation + Evaluation + Optimization

▪ Representation: A classifier must be represented in


some formal language that the computer can handle.

▪ Evaluation: An evaluation function is needed to


distinguish good classifiers from bad ones.

▪ Optimization: We need a method to search among


the classifiers in the language for the highest scoring
one.
Types of Machine Learning!

The machine learns No labelled Machine learns on


from the training training data it’s own
data that is labelled
Cont..

1. Supervised Machine Learning

Machine Learning
Model
Cont..

2. Unsupervised Machine Learning

Input Data Model Output


Cont..

3. Reinforcement Machine Learning


Cont..
Machine Learning Problems!
Cont..
Machine Learning Framework
Apply a prediction function to a feature
representation of the image to get the desired
output:
f( ) = “apple”
f( ) = “tomato”
f( ) = “cow”
Cont..
y = f(x)
output prediction Image
function feature

▪ Training: given a training set of labeled examples


{(x1,y1), …, (xN,yN)}, estimate the prediction
function f by minimizing the prediction error on the
training set
▪ Testing: apply f to a never before seen test example
x and output the predicted value y = f(x)
Machine Learning Steps!
Training Training
Training Labels
Images

Image Learned
Training
Features model

Testing

Image Learned
Prediction
Features model
Test Image
Generalization
◼ The term ‘generalization’ refers to the model’s
capability to adapt and react properly to previously
unseen, new data, which has been drawn from the
same distribution as the one used to build the
model.
◼ In other words, generalization examines how well
a model can digest new data and make correct
predictions after getting trained on a training set.
◼ A fundamental goal of machine learning is
generalization: the ability to draw inferences about
unseen data from finite training examples.
Cont..

Training set (labels known) Test set (labels


unknown)
▪ How well does a learned model generalize from the data it was
trained on to a new test set?
▪ The term ‘generalization’ refers to the model’s capability to adapt
and react properly to previously unseen, new data
Reasons for ML Failure
▪ Asking the wrong question
▪ Trying to solve the wrong problem
▪ Not having enough data
▪ Not having the right data
▪ Having too much data
▪ Hiring the wrong people
▪ Using the wrong tools
▪ Not having the right model
Why Python?
▪ Python has become the lingua franca for many data
science applications. It combines the power of general-
purpose programming languages with the ease of use of
domain-specific scripting languages like MATLAB or R.
▪ Python has libraries for data loading, visualization,
statistics, natural language processing, image processing,
and more.
▪ One of the main advantages of using Python is the
ability to interact directly with the code, using a terminal
or other tool like the Jupyter Notebook, which we’ll
look at shortly.
scikit-learn
▪ scikit-learn is an open source project, meaning
that it is free to use and distribute, and anyone
can easily obtain the source code to see what is
going on behind the scenes.
▪ scikit-learn is a very popular tool, and the
most prominent Python library for machine
learning.
▪ scikit-learn works well with a number of other
scientific Python tools, which we will discuss
later in this chapter.
Installing scikit-learn
▪ scikit-learn depends on two other Python
packages, NumPy and SciPy.
▪ For plotting and interactive development, you
should also install matplotlib, and the Jupyter
Notebook.
▪ We recommend using one of the following
prepackaged Python distributions, which will
provide the necessary packages, such us Anaconda.
▪ $ pip install numpy scipy matplotlib ipython scikit-
learn pandas
Jupyter Notebook
▪ The Jupyter Notebook is an interactive
environment for running code in the browser.
▪ It is a great tool for exploratory data analysis and is
widely used by data scientists.
▪ While the Jupyter Notebook supports many
programming languages, we only need the Python
support.
▪ The Jupyter Notebook makes it easy to incorporate
code, text, and images, and all of this book was in
fact written as a Jupyter Notebook.
NumPy
▪ The NumPy is one of the fundamental packages
for scientific computing in Python.
▪ It contains functionality for multidimensional
arrays, high-level mathematical functions such as
linear algebra operations and the Fourier
transform, and pseudorandom number generators.
▪ In scikit-learn, the NumPy array is the fundamental
data structure. scikit-learn takes in data in the form
of NumPy arrays. Any data you’re using will have
to be converted to a NumPy array.
Libraries and Packages – Summary
To understand machine learning, you need to have basic
knowledge of Python programming. In addition, there are
a number of libraries and packages generally used in
performing various machine learning tasks as listed below:
❑ numpy - is used for its N-dimensional array objects
❑ pandas – is a data analysis library that includes dataframes

❑ matplotlib – is 2D plotting library for creating graphs and


plots
❑ scikit-learn - the algorithms used for data analysis and data
mining tasks
❑ seaborn – a data visualization library based on matplotlib
Thank You!

Chapter 1: Introduction 27

You might also like