0% found this document useful (0 votes)
26 views3 pages

18.2 - Data Matrix Notation - mp4

svm

Uploaded by

NAKKA PUNEETH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views3 pages

18.2 - Data Matrix Notation - mp4

svm

Uploaded by

NAKKA PUNEETH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Now let's learn some simple notation in classification algorithms, very simple notation.

So
the notation goes as follows. Let's take our Amazon reviews data set, right? So we have a
reviews data set like this. It's also called data matrix, right? So let's assume each row here in
this matrix, each row in this matrix represents a review. So you're converting a review into
a vector, right? So let's assume this vector, this vector is put here. Let's call each of those
vectors as xi. So for each review ri, we have a vector representation which is xi, right? As I
told you, every vector by default is a column vector. We learned this in linear algebra and in
dimensional reduction chapters. If I don't say what a vector is, by default it means a column
vector. Now here I'm representing it as a row. So what should I write it as? This whole row
is xi transpose, because if xi is a column vector, by default its row vector representation will
be xi transpose, right? You should always be careful whether something is a row vector or a
column vector. Now, for each review, for each review, suppose let's assume I've used the
review text and converted into a vector. This is how it will look like. Right. Now comes the
fun part. For each review, I also have along with. So for each review ri, I use the text and
convert it into a vector. Similarly, for each review, I also have its class, whether it is positive
or negative. Right? And if you remember our previous video, we said our job is to find y
equals to f of x. So if I'm calling each of these reviews as x, I will call each of my class labels
as y. So for each review I have an xi and I have a yi. I'll put all my yis in a vector like this,
right? So this matrix, this matrix has, let's say, n rows. This matrix has, let's say, n rows.
What does it mean? It means I have n reviews or n data points, right? And if it has d
columns, what does that mean? What does that mean? It means that each of my reviews is
represented, or each of my data points here is represented as a d dimensional vector. Now,
what will be the size of y? This vector, this vector also will have n rows and one column.
Because for every row which corresponds to a review, I will have a class label whether it's
positive or not, right? So this whole thing is represented mathematically as follows. I can say
my whole data set. Again, I'll read this for you. My data set d is a combination of pairs of x, I,
y, I, for every xi, I have a yi, and I goes from one to n because I have n such values, right?
Such that this vertical line here is read as such that, such that xi belongs to rd. Xi is a d
dimensional vector. It's a d dimensional vector where each cell is a real value. Where each
cell is a real value. That's what it means, right? And yi belongs to a set of zero or one. I'll tell
you why it's called zero or one. Now, I have two possible values of yi, right? Positive or
negative. When I have two values, obviously I can represent, because I need to put
everything into mathematical form, right? I need to put everything into numbers because I
can only process numbers. That's what linear algebra can process. Linear algebra can't
process symbols like plus or minus. So what I do here is, since there are only two values
here, there are only two possible class labels here. I will say, I will use the binary
representation where zero could represent that it's negative. One could represent that it's
positive or vice versa. I could have called zero as positive, one as negative. So this is the
notation in which we will follow, right? So let me write it clearly here. My data set d is
basically a comb is basically a set. What does this mean? This means it's a set. It's basically a
set. It's a set of pairs of x, I, y I, where I goes from one to n, which means I have n such
values, such that this is to be read as such that, such that x I belongs to rd, which means x I is
a d dimensional vector where the vector is all real values, and my yi belongs to zero, comma,
one, which means my y I can be zero or one. Here I'm saying my zero means it's negative
class. My one means it's positive class. This is the mathematical representation of your data
set. Sometimes this is also written as dn to denote that there are endpoints in this data set.
Okay? Very simple. See, when you read an equation in English, that's the poetry of
mathematics, okay? So whenever you're given an equation, try to read it in English.
Sentence. Let me explain this to you. D is a data set. D is a set of pairs of numbers, x, I, and y
I, and have n such numbers, such that my xi is a d dimensional vector, and my yi could be
either zero or one. My yi belongs to a set, or y is either zero or one, where zero means it's a
negative review. One means it's a positive review. This is a representation of a data set.
Okay, this is the notation that we will follow. Right. So going back to our Amazon food
reviews. So each review ri, we will call it xi right now, because we have converted into a
vector xi. And for each review we'll have its yi being zero or one. And what is the whole task
of classification? What is the whole purpose of classification? Classification algorithm takes
these xi yi pairs as training data, and it learns a function f, to which, if you input xi, it should
output yi. This is the task of classification. Classification is all about learning this function.
The better you can learn this function, the better your classification system is.

Now let's learn some simple notation in classification algorithms, very simple notation. So
the notation goes as follows. Let's take our Amazon reviews data set, right? So we have a
reviews data set like this. It's also called data matrix, right? So let's assume each row here in
this matrix, each row in this matrix represents a review. So you're converting a review into
a vector, right? So let's assume this vector, this vector is put here. Let's call each of those
vectors as xi. So for each review ri, we have a vector representation which is xi, right? As I
told you, every vector by default is a column vector. We learned this in linear algebra and in
dimensional reduction chapters. If I don't say what a vector is, by default it means a column
vector. Now here I'm representing it as a row. So what should I write it as? This whole row
is xi transpose, because if xi is a column vector, by default its row vector representation will
be xi transpose, right? You should always be careful whether something is a row vector or a
column vector. Now, for each review, for each review, suppose let's assume I've used the
review text and converted into a vector. This is how it will look like. Right. Now comes the
fun part. For each review, I also have along with. So for each review ri, I use the text and
convert it into a vector. Similarly, for each review, I also have its class, whether it is positive
or negative. Right? And if you remember our previous video, we said our job is to find y
equals to f of x. So if I'm calling each of these reviews as x, I will call each of my class labels
as y. So for each review I have an xi and I have a yi. I'll put all my yis in a vector like this,
right? So this matrix, this matrix has, let's say, n rows. This matrix has, let's say, n rows.
What does it mean? It means I have n reviews or n data points, right? And if it has d
columns, what does that mean? What does that mean? It means that each of my reviews is
represented, or each of my data points here is represented as a d dimensional vector. Now,
what will be the size of y? This vector, this vector also will have n rows and one column.
Because for every row which corresponds to a review, I will have a class label whether it's
positive or not, right? So this whole thing is represented mathematically as follows. I can say
my whole data set. Again, I'll read this for you. My data set d is a combination of pairs of x, I,
y, I, for every xi, I have a yi, and I goes from one to n because I have n such values, right?
Such that this vertical line here is read as such that, such that xi belongs to rd. Xi is a d
dimensional vector. It's a d dimensional vector where each cell is a real value. Where each
cell is a real value. That's what it means, right? And yi belongs to a set of zero or one. I'll tell
you why it's called zero or one. Now, I have two possible values of yi, right? Positive or
negative. When I have two values, obviously I can represent, because I need to put
everything into mathematical form, right? I need to put everything into numbers because I
can only process numbers. That's what linear algebra can process. Linear algebra can't
process symbols like plus or minus. So what I do here is, since there are only two values
here, there are only two possible class labels here. I will say, I will use the binary
representation where zero could represent that it's negative. One could represent that it's
positive or vice versa. I could have called zero as positive, one as negative. So this is the
notation in which we will follow, right? So let me write it clearly here. My data set d is
basically a comb is basically a set. What does this mean? This means it's a set. It's basically a
set. It's a set of pairs of x, I, y I, where I goes from one to n, which means I have n such
values, such that this is to be read as such that, such that x I belongs to rd, which means x I is
a d dimensional vector where the vector is all real values, and my yi belongs to zero, comma,
one, which means my y I can be zero or one. Here I'm saying my zero means it's negative
class. My one means it's positive class. This is the mathematical representation of your data
set. Sometimes this is also written as dn to denote that there are endpoints in this data set.
Okay? Very simple. See, when you read an equation in English, that's the poetry of
mathematics, okay? So whenever you're given an equation, try to read it in English.
Sentence. Let me explain this to you. D is a data set. D is a set of pairs of numbers, x, I, and y
I, and have n such numbers, such that my xi is a d dimensional vector, and my yi could be
either zero or one. My yi belongs to a set, or y is either zero or one, where zero means it's a
negative review. One means it's a positive review. This is a representation of a data set.
Okay, this is the notation that we will follow. Right. So going back to our Amazon food
reviews. So each review ri, we will call it xi right now, because we have converted into a
vector xi. And for each review we'll have its yi being zero or one. And what is the whole task
of classification? What is the whole purpose of classification? Classification algorithm takes
these xi yi pairs as training data, and it learns a function f, to which, if you input xi, it should
output yi. This is the task of classification. Classification is all about learning this function.
The better you can learn this function, the better your classification system is.

You might also like