MACHINE LEARNING
Kritim Prasad Kafle
Computer Science and Engineering
Excel Engineering College
WHAT ARE THE THINGS WE WILL BE LEARNING TODAY?
- Prerequisites before learning machine learning:
: Python
: Python libraries
- Machine Learning
- Types of Machine Learning
- Applications of Machine Learning
- Advantages and Disadvantages of Machine Learning
- Simple Example of Machine Learning
PREREQUISITES BEFORE LEARNING
MACHINE LEARNING
PROGRAMMING LANGUAGE: PYTHON
POPULAR PYTHON LIBRARIES VISUALIZATION LIBRARIES
NUMPY MATPLOTLIB
PANDAS SEABORN
SCIKIT-LEARN
PYTHON
Python is an high-level, interpreted, general-purpose programming language.
Basic Essentials
- . Data types are numbers, strings
- . lists, and dictionaries.
. For loops and conditionals
. Functions
. Object oriented
PANDAS NUMPY
 Data from different file objects
can be loaded.
 Easy handling of missing data
(represented as NaN) in floating
point as well as non-floating
point data.
 To Install pandas:
 pip install pandas
 To import panda:
 Import pandas as pd
 NumPy is a Python library used for
working with arrays.

In Python we have lists that serve
the purpose of arrays, but they are
slow to process.
 NumPy aims to provide an array
object that is up to 50x faster than
traditional Python lists.
 To install numpy:
 pip install numpy
 To import numpy
 import numpy
SCIKIT-LEARN
- Scikit-learn (Sklearn) is the most useful and robust library for
machine learning in Python.
- It provides a selection of efficient tools for machine learning and
statistical modeling including classification, regression, clustering.
To install scikit-learn:
pip install scikit-learn
MATPLOTLIB
 Matplotlib is a plotting library for
creating static, animated, and
interactive visualizations in
Python.
 The various plots we can utilize
using Pyplot are Line
Plot, Histogram, Scatter, 3D
Plot, Image, Contour, and Polar.
 To install matplotlib :
 pip install matplotlib
MACHINE LEARNING
 The term machine learning was coined in 1959
by Arthur Samuel.
 Machine learning is an application of artificial
intelligence (AI) that provides systems the ability to
automatically learn and improve from experience
without being explicitly programmed.
 A subset of machine learning is closely related
to computational statistics, which focuses on
making predictions using computers, but not all
machine learning is statistical learning.
TYPES OF MACHINE LEARNING
SUPERVISED LEARNING
 As its name suggests, supervised machine learning is based on supervision. It means in the
supervised learning technique, we train the machines using the "labelled" dataset, and based on
the training, the machine predicts the output. Here, the labelled data specifies that some of the
inputs are already mapped to the output. More preciously, we can say; first, we train the machine
with the input and corresponding output, and then we ask the machine to predict the output using
the test dataset.
 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.
 Applications of supervised learning
 Medical Diagnosis
 Spam detection – spam or not in a mail
UNSUPERVISED LEARNING
 Unsupervised learning is different from the Supervised learning technique; as its name suggests,
there is no need for supervision. It means, in unsupervised machine learning, the machine is trained
using the unlabeled dataset, and the machine predicts the output 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 understand by example:
 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.
 Applications of unsupervised learning:
 Network Analysis: For identifying plagiarism and copyright in document .
 Recommendation Systems: For building recommendation applications.
REINFORCEMENT LEARNING
Reinforcement learning works on a feedback-based process, in which
an AI agent (A software component) automatically explore its
surrounding by hitting & trail, taking action, learning from experiences,
and improving its performance.
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.
Applications of reinforcement learning:
Robotics
Video Games
APPLICATIONS OF MACHINE LEARNING
ADVANTAGES DISADVANTAGES
 Easily identifies trends and
patterns
 No human intervention needed
(automation)
 Continuous Improvement
 Wide Range of Applications
Time and Resources
Possibility of High Error
Algorithm Selection
EXAMPLE
Dataset of area and price
LINEAR FORM
 Y = price x = area
 m = slope b = intercept
CODE
PLOTTING OF AREA AND PRICE
DIVISION OF PRICE AND AREA
CREATE LINEAR REGRESSION OBJECT
Machine Learning Introduction

Machine Learning Introduction

  • 1.
    MACHINE LEARNING Kritim PrasadKafle Computer Science and Engineering Excel Engineering College
  • 2.
    WHAT ARE THETHINGS WE WILL BE LEARNING TODAY? - Prerequisites before learning machine learning: : Python : Python libraries - Machine Learning - Types of Machine Learning - Applications of Machine Learning - Advantages and Disadvantages of Machine Learning - Simple Example of Machine Learning
  • 3.
    PREREQUISITES BEFORE LEARNING MACHINELEARNING PROGRAMMING LANGUAGE: PYTHON POPULAR PYTHON LIBRARIES VISUALIZATION LIBRARIES NUMPY MATPLOTLIB PANDAS SEABORN SCIKIT-LEARN
  • 4.
    PYTHON Python is anhigh-level, interpreted, general-purpose programming language. Basic Essentials - . Data types are numbers, strings - . lists, and dictionaries. . For loops and conditionals . Functions . Object oriented
  • 5.
    PANDAS NUMPY  Datafrom different file objects can be loaded.  Easy handling of missing data (represented as NaN) in floating point as well as non-floating point data.  To Install pandas:  pip install pandas  To import panda:  Import pandas as pd  NumPy is a Python library used for working with arrays.  In Python we have lists that serve the purpose of arrays, but they are slow to process.  NumPy aims to provide an array object that is up to 50x faster than traditional Python lists.  To install numpy:  pip install numpy  To import numpy  import numpy
  • 6.
    SCIKIT-LEARN - Scikit-learn (Sklearn)is the most useful and robust library for machine learning in Python. - It provides a selection of efficient tools for machine learning and statistical modeling including classification, regression, clustering. To install scikit-learn: pip install scikit-learn
  • 7.
    MATPLOTLIB  Matplotlib isa plotting library for creating static, animated, and interactive visualizations in Python.  The various plots we can utilize using Pyplot are Line Plot, Histogram, Scatter, 3D Plot, Image, Contour, and Polar.  To install matplotlib :  pip install matplotlib
  • 8.
    MACHINE LEARNING  Theterm machine learning was coined in 1959 by Arthur Samuel.  Machine learning is an application of artificial intelligence (AI) that provides systems the ability to automatically learn and improve from experience without being explicitly programmed.  A subset of machine learning is closely related to computational statistics, which focuses on making predictions using computers, but not all machine learning is statistical learning.
  • 9.
  • 10.
    SUPERVISED LEARNING  Asits name suggests, supervised machine learning is based on supervision. It means in the supervised learning technique, we train the machines using the "labelled" dataset, and based on the training, the machine predicts the output. Here, the labelled data specifies that some of the inputs are already mapped to the output. More preciously, we can say; first, we train the machine with the input and corresponding output, and then we ask the machine to predict the output using the test dataset.  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.  Applications of supervised learning  Medical Diagnosis  Spam detection – spam or not in a mail
  • 11.
    UNSUPERVISED LEARNING  Unsupervisedlearning is different from the Supervised learning technique; as its name suggests, there is no need for supervision. It means, in unsupervised machine learning, the machine is trained using the unlabeled dataset, and the machine predicts the output 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 understand by example:  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.  Applications of unsupervised learning:  Network Analysis: For identifying plagiarism and copyright in document .  Recommendation Systems: For building recommendation applications.
  • 12.
    REINFORCEMENT LEARNING Reinforcement learningworks on a feedback-based process, in which an AI agent (A software component) automatically explore its surrounding by hitting & trail, taking action, learning from experiences, and improving its performance. 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. Applications of reinforcement learning: Robotics Video Games
  • 13.
  • 14.
    ADVANTAGES DISADVANTAGES  Easilyidentifies trends and patterns  No human intervention needed (automation)  Continuous Improvement  Wide Range of Applications Time and Resources Possibility of High Error Algorithm Selection
  • 15.
  • 16.
    LINEAR FORM  Y= price x = area  m = slope b = intercept
  • 17.
  • 18.
  • 19.
  • 20.