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-

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-

Data point representation in 2 dimensional vector space-

Data point representation in 3 dimensional vector space-

Hope you got an idea !!!