12

I want to understand what is a vector in terms of machine learning.

I looked into the below 2 links:

https://en.wikipedia.org/wiki/Support_vector_machine https://en.wikipedia.org/wiki/Feature_vector.

I couldn't understand it fully. Can someone explain this in simple words?

4
  • Explain which specific part of the definition you don't understand and why it is confusing to you.
    – takendarkk
    Jul 14, 2016 at 16:55
  • Is the input object in machine learning models called vector.
    – subho
    Jul 14, 2016 at 17:01
  • in the en.wikipedia.org/wiki/Supervised_learning link, I read that the In supervised learning, each example is a pair consisting of an input object (typically a vector) and input object is transformed into a feature vector, which contains a number of features that are descriptive of the object , so I am not able to understand the input itself called vector or input after transformation called vector
    – subho
    Jul 14, 2016 at 17:07
  • 1
    Think of a vector as a way of representing data, nothing more. It is a kind a matrix which shows the input values. Transformations could be performed upon this matrix and the result of transformation will be matrix again. Jul 14, 2016 at 17:42

3 Answers 3

33

I would think that much of your problem comes because vector is a general term with many uses. In this case, think of it as a list of values or a row in a table. The data structure is a 1-dimensional array; a vector of N elements is an N-dimensional vector, one dimension for each element.

For instance, the input (3.14159, 2.71828, 1.618) is a vector of 3 elements, and could be represented as a point in 3-dimensional space. Your program would declare a 1x3 array (one-dimensional data structure) to hold the three items.

Does this help you visualize the basic input handling? This is not a difficult problem with a Wronkskian transformation matrix -- it's just a change in format and visualization.


The feature vector is simply one row of input. For instance, in the popular machine learning example of housing price prediction, we might have features (table columns) including a house's year of construction, number of bedrooms, area (m^2), and size of garage (auto capacity). This would give input vectors such as

[1988, 4, 200, 2]
[2001, 3, 220, 1]

etc.

5

In Simple words,
Dimensions : the attributes/features taken for analysis
eg:
a) In health care domain : height, weight, gender, pulse rate, cholestral level
b) In banking domain : age, gender, profession, marital status etc

n-Dimensional Vector :<e1, e2, e3, ...., en> where ei is the value of dimension i and elements are ordered.
example:
<180, 74, M, 60, 120> is a 6-Dimensional Vector where 180, 74, M, 60, 120 are the values of attributes/dimensions height, weight, gender, pulse_rate, cholesterol_level respectively.

<180, 74, M, 60, 120> and <180, M, 74, 60, 120> are not same as the order of dimensions weight and gender are changed.

3

A scalar value will only have a magnitude but not direction.

For example,

  • Mark of a student in examination
  • Salary of a employee
  • Temperature of a city etc.

A vector value will have both magnitude and direction.

For example,

  • Velocity of a vehicle
  • Current density of an electric flow
  • Magnetic field of a coin etc.

In machine learning when we have multiple independent variables to predict a dependent variable, we usually represent all independent variables in a multidimensional space.

For example,

Let’s consider a ML problem in which we have to predict the mark of a student in final examinations using the following independent variables-

  • Attendance percentage
  • Number of failed subjects in internal examinations
  • Number of assignments completed

Here, we need to project all those data points of students in a multidimensional space where-

Dimension 1- Attendance percentage

Dimension 2 - Number of failed subjects in internal examinations

Dimension 3 - Number of assignments completed

It will somewhat look like this-

enter image description here

Now, each independent variable can be represented as a vector with respect to dependent variable.

Like,

“Attendance” vector will have a magnitude and positive direction with respect to mark in examination (mark in the final examination will increase if attendance also increases and mark will decrease if attendance decreases).

“Number of failed subjects in internal examinations” vector will have a magnitude and negative direction with respect to mark in examination (mark in the final examination will increase if the number of failed subjects in internal examinations decreases and mark will decrease if number of failed subjects in internal examinations increases).

Now, if we have a new student for whom we need to predict his marks then we can represent his data in these 3 vectors and the point in which the 3 vectors having an orthogonal relationship can be considered as his/her predicted mark in the final examination.

Data point representation in 1 dimensional vector space-

enter image description here

Data point representation in 2 dimensional vector space-

enter image description here

Data point representation in 3 dimensional vector space-

enter image description here

Hope you got an idea !!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.