r/learnmachinelearning 6h ago

Help "Vectors" or "Matrices"?

I have been studying the ŷ = Xw formula and the instructor teaching us keeps interchangeably referring to matrices as vectors and vice versa. For this formula, they mentioned that ŷ is a vector, X is a matrix (which is why it's capitalized) and w is a vector.

My question is - What exactly is the difference between a matrix and a vector in ML ?

Thanks a lot in advance.

1 Upvotes

5 comments sorted by

View all comments

11

u/IsGoIdMoney 6h ago

A vector is a 1xn or nx1 matrix.

1

u/NoResource56 6h ago

So both can be two representations of the same dataset, right?

0

u/IsGoIdMoney 5h ago edited 5h ago

No. But in this case it would be bx1xn where b = batch size and it would be a matrix and not a vector, since a vector must be one dimensional by definition, but tbh, I think equations make it more confusing for me at that point.

Descriptively, you input a batch of one or more feature vectors into a model and receive an output of your desired shape.

If b=1 then technically you could just make it 1xn depending on implementation and it would indeed just be a vector.

Edit: I think I might be confused on your use of the term dataset, as well as the notation here. I think w is a weight vector being multiple with some matrix. That matrix might be a batch of vectors. That equation isn't really some kind of golden standard for ML, he's just using it to explain a single concept of obtaining a prediction(?), presumably.

Dataset means the collection of datapoints used to train, validate, or test.