Whether your professional field focuses on data analytics, data science, or in sedentary (Tending to spend much time seated) job such as computer programmer, terminology such as TENSOR is something needed to be aware of. Especially if you are specialized in building models using a popular programming language such as R and Python. When you search on the internet, eclectic (broad) mixed definitions will be presented to you. Though, In this post, the bulleted list in the following will be discussed to get feel what are the several types of tensor chronologically. Some figures were also presented to make it a little bit comprehensible.
- Scalar
- Vector
- Matrix
- 3-Tensor
Note. This topic will be mainly concerned with the idea and theory of what is TENSOR.
What is TENSOR?
Tensor is related to the generalization of vectors, matrices, or higher dimensions. In programming, it is a term for an object that carries multiple data or serves as storage in the memory during computational operations. These operations are executed within the e.g algorithm intensively and used to make inferences or present results. Though, being cognizant (aware) of what to apply to the algorithm is essential that aligned to the company’s goals. For example, the programmer can’t just use any of the different tensors as these affect computational performance and cost computer memory resources.
Scalar
Scalar is a zero-dimensional tensor which means it has no direction at all but only presents the quantity or size value. To put in perspective, if you drove a car 10 miles from point A – to – B and someone asks you how many miles did you travel, yes and your answer is 10 miles away. Since the direction does not matter from the question and is only relevant to how many miles you’ve traveled then this means, the value(size) can be represented as a scalar quantity.
Figure 1
Scalar Is Magnitude Only

Vector
Vector is a one (1) dimensional tensor, and it has a magnitude (size) and destination direction which can be from the left or to the right. If someone told you to move a box, then you need a direction and the size of the magnitude as the box changes position (displacement). With that said, if the latter is not given, the box will stay stationary as it has no direction.
Figure 2
Vector Magnitude (Size) With Direction

In programming, assuming that you have an array of data, as a collection of different magnitude sizes you had e.g [ 1, 2, 3, 10, 5 ]. Given that someone asks you the recent changing position size (Magnitude) of your travel. You can specify the starting point position close to where the value 10 from the array is and give the direction. So, since the value 10 is close to the right, it is reasonable to say that, the program can start from the right to the left to get the value 10 which is beside the value 5. With that being said, doing this can expedite the indexing and counting process by the program.
Matrix
You can now conclude that each of these different tensors is like improvements of one another. Matrix has two dimensions, you can present data within the object from left to right, and up and down. This means this can also contain multiple collections of vectors. This is very useful in computer programming for intensive representation and transposition e.g. rows to columns or vice versa of different values. Also, this can be used to represent data to determine event recurrence as events counts happen from moving the box during the day, etc.
Figure 3
Presenting How Many Times The Box Move During The Weekday

Note. This is a 2×5 matrix, the labels RIGHT, LEFT, and DAY are only included for this demonstration. This matrix in programming can be look like this [ [ 4, 10, 5, 7, 2 ], [ 3, 4, 11, 5, 10 ] ].
So, you can see that if you want to select data from the matrix, the specification of the row and column position is needed. For example, if you want to select the count events for moving the box to the left on Friday, then row 2 and column 5 are needed to be defined which leads to a result of 10.
3- Tensor
Now, as an adjunct to the learning curve with this topic. Let’s see and understand what is 3-Tensor is. It just basically refers to 3 dimensions (3D). To best describe this is to give the example from Linear Regression Model – Part III – PORTA SFTP SERVER. The latter gives an example for determining how Free Shipping & Advertisement affect Sales. Well, trying to picture this can be a little bit abstruse (obscure) but hoping the figure below can help you.
Figure 4
Sales & Data Points Representation

Relating this to other figures given above, you can see that using 3D to represent different variables can show how they affect each other. If this is used to present the previous samples, the Car or Box movement can also have the exact locations, directions, measurements. With that said, this is also very useful when presenting objects that involve reflections.
Conclusion
So, in this sense, we can conclude that TENSORS are referring to different types of objects that present different types of data in a mathematical or arithmetic way. These are heavily used in programming for building algorithms to perform tasks that promote the organization’s goals and objectives associated with the business. Hope that this post helps you grasp what TENSORS are as part of your learning curve. With all this being said, consider subscribing to get updates about the new post(s) as all of this is not for accolade intentions.







