Professional Documents
Culture Documents
Using Python
Vikram Kamath
Contents:
1. Introduction/Definition
2. Where and Why ML is used
3. Types of Learning
4. Supervised Learning – Linear Regression & Gradient
Descent
5. Code Example
6. Unsupervised Learning – Clustering and K-Means
7. Code Example
8. Neural Networks
9. Code Example
10. Introduction to Scikit-Learn
Definition:
0 1
Output (Y): Class Labels { y , y , . y }
9
Features( X i):
Proportion of pixels in
Each of the 12 cells
X i where i=1,2,... ,12
Handcrafted Rules will result in a large number of rules
and exceptions
Supervised Learning
Reinforcement Learning
Supervised Learning:
- The set of data (training data) consists of a set of input data and
correct responses corresponding to every piece of data.
Supervised Learning
Classification Problems
Supervised Learning: Classification Problems
“ Consists of taking input vectors and deciding which of the N classes they
belong to, based on training from exemplars of each class.“
- Is discrete (most of the time). i.e. an example belongs to precisely one class, and
the set of classes covers the whole possible output space.
How it's done: Find 'decision boundaries' that can be used to separate out the
different classes.
Given the features that are used as inputs to the classifier, we need to identify
some values of those features that will enable us to decide which class the
current input belongs to
Supervised Learning: Regression Problems
Given some data, you assume that those values come from some sort of
function and try to find out what the function is.
To Find: y at x =0.44
Unsupervised Learning:
-Classification?
The reinforcement learner has to try out different strategies and see which
works best
In essence: The algorithm searches over the state space of possible inputs
and outputs in order to maximize a reward
Good Robot Bad Robot
Supervised Learning: Linear Regression & Gradient Descent
Notation:
( x (i) , y(i) ) : ith training example (Represent's ith row on the table)
h(Θ)=Θ0+Θ1 x 1+Θ2 x 2
where (Θi 's) are theparameters(also called weights).
m
1 (i) 2
J (Θ)= ∑ (h(Θ) ( x )− y )
(i)
2 i=1
The LMS (Least Mean Squares ) algorithm begins with some initial
value of Θ and repeatedly changes Θ so as to make J (Θ) smaller
We now come to the Gradient Descent algorithm:
∂
Θ j :=Θj−α J(Θ)
∂θ j
m
∂ 1 (i) 2
( ∑ (h(Θ) (x )− y ) )
(i)
Θ j :=Θ j−α
∂θ j 2 i=1
(i ) (i ) (i )
Θ j :=Θ j +α( y −h Θ ( x )) x j
There are 2 ways of generalizing the above equation for more than
one training example:
Loop
{
for i=1 to m
{
}
}
In essence:
Clustering is “the process of organizing objects into groups whose members
are similar in some way”.
1. Place K points into the space represented by the objects that are
being clustered. These points represent initial group centroids.
2. Assign each object to the group that has the closest centroid
Number of classes : 3
Attribute Information:
Features :
1. sepal length in cm
2. sepal width in cm
3. petal length in cm
4. petal width in cm
Classes:
-- Iris Setosa
-- Iris Versicolour
-- Iris Virginica
Neural Networks
Motivation:
Datasets:
Discussions
Machine Learning subReddit: http://www.reddit.com/r/MachineLearning/
Books:
Pattern Classification (Duda, Hart)
Machine Learning (Tom Mitchell)
Introduction to Machine Learning (Ethem Alpaydin)
Neural Networks (Simon Haykin)
Machine Learning: an algorithmic approach (Marsland)
Thank You
Kosshans?