0% found this document useful (0 votes)
180 views32 pages

1 - Machine Learning (Start)

This document provides an introduction to machine learning, including: 1. An overview of machine learning, which allows software to learn from experience and improve without being explicitly programmed. 2. A brief history of machine learning from the 1950s to today, including important developments like neural networks and deep learning. 3. Examples of machine learning applications like virtual assistants, traffic predictions, fraud detection, and product recommendations.

Uploaded by

Anmol Durgapal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0% found this document useful (0 votes)
180 views32 pages

1 - Machine Learning (Start)

This document provides an introduction to machine learning, including: 1. An overview of machine learning, which allows software to learn from experience and improve without being explicitly programmed. 2. A brief history of machine learning from the 1950s to today, including important developments like neural networks and deep learning. 3. Examples of machine learning applications like virtual assistants, traffic predictions, fraud detection, and product recommendations.

Uploaded by

Anmol Durgapal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 32

MACHINE LEARNING

INTRODUCTION

BY NISHANT
Introduction to Machine Learning
.
Table of Content:
• Revision of Python.(Overview)
• Introduction of Machine Learning.
• History of Machine Learning.
• Applications of Machine Learning.
• How it is Work.
• Basic Concept of Machine Learning.
• Area of Machine Learning.
• Python Libraries used in Machine Learning.
• Types of Machine Learning.
• Installation of IDE(Anaconda with Spyder).
Introduction to Machine Learning
A computer program is said to learn from experience E with respect to some class of tasks T and
performance measure P, if its performance at tasks in T, as measured by P, improves with experience E.“
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.
Machine learning focuses on the development of computer programs that can access data and use
it learn for themselves.
Machine learning (ML) is a category of algorithm that allows software applications to become
more accurate in predicting outcomes without being explicitly programmed.
The basic premise of machine learning is to build algorithms that can receive input data and use
statistical analysis to predict an output while updating outputs as new data becomes available.
Machine learning has gained traction in recent years due to emergence of big data and
advancement in computing power.
It is important to note that all machine learning is Artificial Intelligence (AI) while not all AI is
machine learning.
Introduction to Machine Learning

ML vs DL vs AI
Introduction to Machine Learning

Flow To Implement Machine Learning


History of Machine Learning

• 1950 — Alan Turing creates the “Turing Test” to determine if a computer has real intelligence. To
pass the test, a computer must be able to fool a human into believing it is also human.
• 1952 — Arthur Samuel wrote the first computer learning program. The program was the game of
checkers, and the IBM +3.91% computer improved at the game the more it played, studying which
moves made up winning strategies and incorporating those moves into its program.
• 1957 — Frank Rosenblatt designed the first neural network for computers (the perceptron), which
simulate the thought processes of the human brain.
• 1967 — The “nearest neighbor” algorithm was written, allowing computers to begin using very basic
pattern recognition. This could be used to map a route for traveling salesmen, starting at a random
city but ensuring they visit all cities during a short tour.
• 1997 — IBM’s Deep Blue beats the world champion at chess.
• 2011 — IBM’s Watson beats its human competitors at Jeopardy.
History of Machine Learning

Brief idea for Evolution of Machine Learning


Application of Machine Learning
There are various applications of Machine Learning.
Virtual Personal Assistants : Siri, Alexa, Google Now are some of the popular examples of virtual personal assistants.
As the name suggests, they assist in finding information, when asked over voice .

Predictions while Commuting : Traffic Predictions- We all have been using GPS navigation services. While we do
that, our current locations and velocities are being saved at a central server for managing traffic.
Online Transportation Networks: When booking a cab, the app estimates the price of the ride.
Videos Surveillance : The video surveillance system nowadays are powered by AI that makes it possible to detect crime
before they happen. They track unusual behaviour of people like standing motionless for a long time, stumbling, or
napping on benches etc.

Social Media Services : People You May Know: Machine learning works on a simple concept: understanding with
experiences. Facebook continuously notices the friends that you connect with, the profiles that you visit very often, your
interests, workplace, or a group that you share with someone etc.
Face Recognition: You upload a picture of you with a friend and Facebook instantly recognizes that friend. Facebook
checks the poses and projections in the picture, notice the unique features, and then match them with the people in your
friend list.
Applications of Machine Learning

Email Spam and Malware Filtering :There a re a number of spam filtering approaches that email clients use. To
ascertain that these spam filters are continuously updated, they are powered by machine learning. Over 325, 000 malwares
are detected everyday and each piece of code is 90–98% similar to its previous versions. The system security programs that
are powered by machine learning understand the coding pattern.

Online Customer Support : A number of websites nowadays offer the option to chat with customer support representative
while they are navigating within the site. However, not every website has a live executive to answer your queries. In most of
the cases, you talk to a chatbot.

Online Fraud Detection : Machine learning is proving its potential to make cyberspace a secure place and tracking
monetary frauds online is one of its examples. For example: PayPal is using ML for protection against money laundering. The
company uses a set of tools that helps them to compare millions of transactions taking place and distinguish between
legitimate or illegitimate transactions taking place between the buyers and sellers .
Product Recommendations : You shopped for a product online few days back and then you keep receiving emails for
shopping suggestions. If not this, then you might have noticed that the shopping website or the app recommends you some
items that somehow matches with your taste.
Applications of Machine Learning
Various Applications of Machine Learning
Working of Machine Learning

Step by step procedure for working of Machine Learning


• Data Gathering : This step is very important because the quality and quantity of data that you gather will directly
determine how good your predictive model can be. The good quality of data required.

• Data preparation : Where we load our data into a suitable place and prepare it for use in our machine learning
training. We’ll first put all our data together, and then randomize the ordering.

• Choosing a model : There are many models that researchers and data scientists have created over the years. Some
are very well suited for image data, others for sequences (like text, or music), some for numerical data, others for
text-based data.

• Training : In this step, we will use our data to incrementally improve our model’s ability to predict the desired
output.

• Evaluation : Once training is complete, it’s time to see if the model is any good,
using Evaluation(Testing). This is where that dataset that we set aside earlier comes into play.
Evaluation allows us to test our model against data that has never been used for training.
Working of Machine Learning
• Parameter Tuning : Once you’ve done evaluation, it’s possible that you want to see if you can further improve your
training in any way. We can do this by tuning our parameters. There were a few parameters we implicitly assumed
when we did our training, and now is a good time to go back and test those assumptions and try other values.
• What is Model ?

Model refers to a mathematical expression of model parameters along with input place holders for each
prediction, class and action for regression, classification and reinforcement categories respectively.
A machine learning model can be a mathematical representation of a real-world process. To generate a machine learning
model you will need to provide training data to a machine learning algorithm to learn from.

• What is Algorithm ?
Machine Learning algorithm is the hypothesis set that is taken at the beginning before the training starts with
real-world data. When we say Linear Regression algorithm, it means a set of functions that define similar characteristics
as defined by Linear Regression and from those set of functions we will choose one function that fits the most by the
training data.
Working of Machine Learning

Flow of Machine Learning Model


Basic Concepts for Machine Learning(Requirements)
There are basic elements required for using Machine Learning:
• Computer Science Fundamentals and Programming: Computer science fundamentals important for MachineLearning
engineers include data structures (stacks, queues, multi-dimensional arrays, trees, graphs, etc.), algorithms (searching,
sorting, optimization, dynamic programming, etc.), computability and complexity (P vs. NP, NP-complete problems,
big-O notation, approximate algorithms, etc.).
• Probability and Statistics : A formal characterization of probability (conditional probability, Bayes rule, likelihood,
independence, etc.) and techniques derived from it (Bayes Nets, Markov Decision Processes, Hidden Markov Models) are
at the heart of many Machine Learning algorithms; these are a means to deal with uncertainty in the real world.

• Data Modeling and Evaluation: Data modeling is the process of estimating the underlying structure of a given
dataset, with the goal of finding useful patterns (correlations, clusters, eigenvectors, etc.) and/or predicting properties
of previously unseen instances (classification, regression, anomaly detection, etc.).
• Applying Machine Learning Algorithms and Libraries : Standard implementations of Machine Learning
algorithms are widely available through libraries/packages/APIs (e.g. scikit-learn, Theano, Spark MLlib, H2O,
TensorFlow etc.), but applying them effectively involves choosing a suitable model (decision tree, nearest
neighbor, neural net, support vector machine, ensemble of multiple models, etc.), a learning procedure to fit the
data (linear regression, gradient descent, genetic algorithms, bagging, boosting, and other model .
Basic Concepts of Machine Learning (Requirements)
Area for Machine Learning

Area covered by Machine Learning


Python Libraries

There are various types of libraries which are use to implement Machine Learning. Libraries are sets of routines
and functions that are written in a given language. A robust set of libraries can make it easier for developers to
perform complex tasks without rewriting many lines of code.
Machine learning is largely based upon mathematics. Specifically, mathematical optimization, statistics and
probability. Python libraries help researchers/mathematicians who are less equipped with developer knowledge
to easily “do machine learning”.
• Scikit-learn :- It is one the most popular ML libraries. It supports many supervised and unsupervised learning
algorithms. The library is built upon the SciPy (Scientific Python) that must be installed before you can use scikit-learn.

• Numpy :- Its stands for numeric python. Numpy is a general-purpose array-processing package. It provides a high-
performance multidimensional array object, and tools for working with these arrays. It is the fundamental package for
scientific computing with Python.

• Pandas (data extraction and preparation):- Pandas is a very popular library that provides high-level data structures
which are simple to use as well as intuitive. It has many inbuilt methods for grouping, combining data and filtering as well
as performing time series analysis.Pandas can easily fetch data from different sources like SQL databases, CSV, Excel,
JSON files and manipulate the data to perform operations on it.
Python Libraries
• Matplotlib :- It is a standard Python library used by every data scientist for creating 2D plots and graphs. It’s pretty
low-level, meaning it requires more commands to generate nice-looking graphs and figures than with some advanced
libraries. However, the flip side of that is flexibility. With enough commands, you can make just about any kind of
graph you want with Matplotlib. You can build diverse charts, from histograms and scatterplots to non-Cartesian
coordinates graphs.
• Seaborn :- Seaborn is a popular visualization library that builds on Matplotlib’s foundations. It is a higher-level
library, meaning it’s easier to generate certain kinds of plots, including heat maps, time series, and violin plots.
• Theano:- It is another good Python library for numerical computation, and is similar to NumPy. Theano allows you to
define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently.What sets
Theano apart is that it takes advantage of the computer’s GPU. This allows it to make data-intensive calculations up to
100 times faster than when run on the CPU alone. Theano’s speed makes it especially valuable for deep learning and
other computationally complex tasks.
• Tensorflow :- TensorFlow is an open source library for numerical computation and large-scale machine learning.
TensorFlow bundles together a slew of machine learning and deep learning (aka neural networking) models and
algorithms and makes them useful by way of a common metaphor. TensorFlow can train and run deep neural networks
for handwritten digit classification, image recognition, word embeddings, recurrent neural networks, sequence-to-
sequence models for machine translation, natural language processing, and PDE (partial differential equation) based
simulations. Best of all, TensorFlow supports production prediction at scale, with the same models used for training.
Python Libraries
• OpenCV : - OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning
software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the
use of machine perception in the commercial products. The algorithms can be used to detect and recognize faces, identify
objects, classify human actions in videos, track camera movements, track moving objects, extract 3D models of objects, produce
3D point clouds from stereo cameras, stitch images together to produce a high resolution image of an entire scene, find similar
images from an image database.

• Pickle :- Python pickle module is used for serializing and de-serializing a Python object structure. Any object in Python
can be pickled so that it can be saved on disk. What pickle does is that it “serializes” the object first before writing it to
file. Pickling is a way to convert a python object (list, dict, etc.) into a character stream. The idea is that this character
stream contains all the information necessary to reconstruct the object in another python script.
• Pillow :- Pillow is a fork of the Python Imaging Library (PIL). PIL is a library that offers several standard procedures
for manipulating images. It's a powerful library, but hasn't been updated since 2011 and doesn't support Python 3. Pillow
builds on this, adding more features and support for Python 3. It supports a range of image file formats such as PNG,
JPEG, PPM, GIF, TIFF and BMP. We'll see how to perform various operations on images such as cropping, resizing,
adding text to images, rotating, greyscaling, e.t.c using this library.
• SciPy :- It stands for scientific python. SciPy has a huge set of different scientific calculation operations. The
abovementioned Scikit-learn relies heavily on it to implement different ML algorithms.Usually, SciPy is rarely used
directly because Scikit-learn tries hard to provide a higher-level API which covers all ML needs.
Python Libraries

Libraries use by Machine Learning


Types of Machine Learning

Machine learning is sub-categorized to three types.

 Supervised Learning – (Underguidence-train it)


 Unsupervised Learning – (Self capable in learning)
 Reinforcement Learning -- (Hit and Trial –Rules depended)
Supervised Learning is the one, where you can consider the learning is guided by a teacher. We have a dataset
which acts as a teacher and its role is to train the model or the machine. It deals with labelled data. Once the model
gets trained it can start making a prediction or decision when new data is given to it.
Example –Suppose you are given an basket filled with different kinds of fruits. Now the first step is to train the
machine with all different fruits one by one like:
• 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.
Types of Machine Learning
Supervised learning classified into two categories of algorithms:
Classification: It is the process of finding or discovering a model (function) which helps in separating the data into
multiple categorical classes. In classification, the group membership of the problem is identified, which means the data is
categorized under different labels according to some parameters and then the labels are predicted for the data.

Regression: It is the process of finding a model or function for distinguishing the data into continuous real values instead
of using classes. Mathematically, with a regression problem, one is trying to find the function approximation with the
minimum error deviation. In regression, the data numeric dependency is predicted to distinguish it.

The Regression analysis is the statistical model which is used to predict the numeric data instead of labels. It can also
identify the distribution movement depending on the available data or historic data.
Classification technique provides the predictive model or function which predicts the new data in discrete categories or
labels with the help of the historic data. Conversely, the regression method models continuous-valued functions which
means it predicts the data in continuous numeric data.
Types of Machine Learning
• Logistic Regression
• Decision trees

• Support vector machine


(SVM)
• k-Nearest Neighbors
• Naive Bayes

• Random forest
• Linear regression
• polynomial regression

• SVM for regression


Types of Machine Learning

Difference between Regression and classification


Types of machine Learning
• Classification predictive modeling problems are different from regression predictive modeling problems.
• Classification is the task of predicting a discrete class label.
• Regression is the task of predicting a continuous quantity.
• There is some overlap between the algorithms for classification and regression; for example:
• A classification algorithm may predict a continuous value, but the continuous value is in the form of a
probability for a class label.
• A regression algorithm may predict a discrete value, but the discrete value in the form of an integer quantity.
• Some algorithms can be used for both classification and regression with small modifications, such as decision
trees and artificial neural networks. Some algorithms cannot, or cannot easily be used for both problem types,
such as linear regression for regression predictive modeling and logistic regression for classification predictive
modeling.
• Importantly, the way that we evaluate classification and regression predictions varies and does not overlap, for
example:
• Classification predictions can be evaluated using accuracy, whereas regression predictions cannot.
• Regression predictions can be evaluated using root mean squared error, whereas classification predictions
cannot.
Types of Machine Learning

• Unsupervised Learning:
Unsupervised learning is the training of machine using information that is neither classified nor labeled and allowing the
algorithm to act on that information without guidance. Here the task of machine is to group unsorted information
according to similarities, patterns and differences without any prior training of data.
Unlike supervised learning, no teacher is provided that means no training will be given to the machine. Therefore
machine is restricted to find the hidden structure in unlabeled data by our-self.
Unsupervised learning is bit difficult to implement and its not used as widely as supervised.

All clustering algorithms come under unsupervised learning algorithms.


• K – means clustering
• Hierarchical clustering
• Hidden Markov models
• Suppose you have a basket and it is filled with some different types of fruits and your task is to arrange them as groups.
• This time, you don’t know anything about the fruits, honestly saying this is the first time you have seen them. You have no clue about those.
• So, how will you arrange them?
• What will you do first???
• You will take a fruit and you will arrange them by considering the physical character of that particular fruit.
• Suppose you have considered color.
• Then you will arrange them on considering base condition as color.
• Then the groups will be something like this.
• RED COLOR GROUP: apples & cherry fruits.
• GREEN COLOR GROUP: bananas & grapes.
• So now you will take another physical character such as size.
• RED COLOR AND BIG SIZE: apple.
• RED COLOR AND SMALL SIZE: cherry fruits.
• GREEN COLOR AND BIG SIZE: bananas.
• GREEN COLOR AND SMALL SIZE: grapes.
• The job has done, the happy ending.
• Here you did not learn anything before ,means no train data and no response variable.
• In data mining or machine learning, this kind of learning is known as unsupervised learning.
Types of Machine Learning

Working Procedure for Unsupervised Learning


Types of Machine Learning
• Reinforcement Learning: The machine is exposed to an environment where it gets trained by trial and error method,
here it is trained to make a much specific decision.
• The machine learns from past experience and tries to capture the best possible knowledge to make accurate
decisions based on the feedback received.

• Reinforcement learning occurs when you present the algorithm with examples that lack labels, as in unsupervised
learning. However, you can accompany an example with positive or negative feedback according to the solution the
algorithm proposes. Reinforcement learning is connected to applications for which the algorithm must make decisions
(so the product is prescriptive, not just descriptive, as in unsupervised learning), and the decisions bear consequences.
In the human world, it is just like learning by trial and error.
• Errors help you learn because they have a penalty added (cost, loss of time, regret, pain, and so on), teaching you that a
certain course of action is less likely to succeed than others. An interesting example of reinforcement learning occurs
when computers learn to play video games by themselves.
• In this case, an application presents the algorithm with examples of specific situations, such as having the gamer stuck
in a maze while avoiding an enemy. The application lets the algorithm know the outcome of actions it takes, and
learning occurs while trying to avoid what it discovers to be dangerous and to pursue survival.
Types of Machine Learning
Example for Reinforcement Learning :--
It is totally depends on the final stage.
Types of Machine Learning
Types of Machine Learning

You might also like