{"id":1828,"date":"2019-07-17T05:44:10","date_gmt":"2019-07-17T05:44:10","guid":{"rendered":"http:\/\/kusuaks7\/?p=1433"},"modified":"2023-08-23T07:06:43","modified_gmt":"2023-08-23T07:06:43","slug":"vectors-and-matrixes","status":"publish","type":"post","link":"https:\/\/www.experfy.com\/blog\/ai-ml\/vectors-and-matrixes\/","title":{"rendered":"Vectors and Matrixes"},"content":{"rendered":"<p><b>Vectors are one of the most crucial concepts within Machine Learning because many bugs are due to having matrix \/vector dimensions that don&rsquo;t fit properly. Therefore it is essential for a machine learning engineer to have a good understanding of it.<\/b><\/p>\n<h2><strong>Vectors<\/strong><\/h2>\n<p>Let&rsquo;s say your an engineer at Tesla and you get a dataset of produced cars with 3 features: Length, Width and Height.<\/p>\n<p style=\"text-align: center;\"><img fetchpriority=\"high\" decoding=\"async\" alt=\"Bildschirmfoto 2017-11-07 um 08.14.04\" data-attachment-id=\"91\" data-comments-opened=\"1\" data-image-description=\"\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Bildschirmfoto 2017-11-07 um 08.14.04\" data-large-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-14-04.png?w=736\" data-medium-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-14-04.png?w=300\" data-orig-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-14-04.png\" data-orig-size=\"1338,204\" data-permalink=\"https:\/\/machinelearning-blog.com\/2017\/11\/04\/calculus-derivatives\/bildschirmfoto-2017-11-07-um-08-14-04\/\" height=\"97\" sizes=\"(max-width: 634px) 100vw, 634px\" src=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-14-04.png?w=634&amp;h=97\" srcset=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-14-04.png?w=634&amp;h=97 634w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-14-04.png?w=1268&amp;h=194 1268w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-14-04.png?w=150&amp;h=23 150w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-14-04.png?w=300&amp;h=46 300w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-14-04.png?w=768&amp;h=117 768w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-14-04.png?w=1024&amp;h=156 1024w\" width=\"634\" \/><\/p>\n<p>Each of those cars can be represented as a point within a 3-dimensional space.<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" alt=\"Bildschirmfoto 2017-11-07 um 08.03.27.png\" data-attachment-id=\"92\" data-comments-opened=\"1\" data-image-description=\"\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Bildschirmfoto 2017-11-07 um 08.03.27\" data-large-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-03-27.png?w=736\" data-medium-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-03-27.png?w=300\" data-orig-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-03-27.png\" data-orig-size=\"942,944\" data-permalink=\"https:\/\/machinelearning-blog.com\/2017\/11\/04\/calculus-derivatives\/bildschirmfoto-2017-11-07-um-08-03-27\/\" height=\"287\" sizes=\"(max-width: 286px) 100vw, 286px\" src=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-03-27.png?w=286&amp;h=287\" srcset=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-03-27.png?w=286&amp;h=287 286w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-03-27.png?w=572&amp;h=574 572w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-03-27.png?w=150&amp;h=150 150w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-03-27.png?w=300&amp;h=300 300w\" width=\"286\" \/><\/p>\n<p>Datapoints with for example 500 features could be represented within a 500-dimensional space. It is hard for us as humans to imagine more than a 3-dimensional space but computers are very good at it.<\/p>\n<p>A vector is a 1-dimensional array. Think of an vector as a list of values or a row in a table. You could also say that a vector is a matrix but with only one column.<\/p>\n<p>A vector of n-elements is an n-dimensional vector, with one dimension for each element.<\/p>\n<p>So for a 3 dimensional datapoint we could use a 1-by-3 array to hold the 3 features. It represents a set of features, which is why we call it a feature vector.<\/p>\n<h2><strong>Matrix<\/strong><\/h2>\n<p>More general than a vector is a matrix. A matrix is a rectangular array of numbers and a vector can be a row or column within a matrix.&nbsp; &nbsp;<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" alt=\"Bildschirmfoto 2017-11-09 um 17.19.16.png\" data-attachment-id=\"93\" data-comments-opened=\"1\" data-image-description=\"\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Bildschirmfoto 2017-11-09 um 17.19.16\" data-large-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-19-16.png?w=736\" data-medium-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-19-16.png?w=300\" data-orig-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-19-16.png\" data-orig-size=\"1220,556\" data-permalink=\"https:\/\/machinelearning-blog.com\/2017\/11\/04\/calculus-derivatives\/bildschirmfoto-2017-11-09-um-17-19-16\/\" height=\"243\" sizes=\"(max-width: 533px) 100vw, 533px\" src=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-19-16.png?w=533&amp;h=243\" srcset=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-19-16.png?w=533&amp;h=243 533w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-19-16.png?w=1066&amp;h=486 1066w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-19-16.png?w=150&amp;h=68 150w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-19-16.png?w=300&amp;h=137 300w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-19-16.png?w=768&amp;h=350 768w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-19-16.png?w=1024&amp;h=467 1024w\" width=\"533\" \/><\/p>\n<p>Therefore each row in an array could represent a different datapoint. Less general than a vector is a scalar, because it&rsquo;s just a single number but that&rsquo;s another topic.&nbsp;<\/p>\n<p>The Dimension of a matrix is going to be written as the number of rows times the number of columns.&nbsp;<\/p>\n<p>To show this more clearly you can&nbsp;see a 4 by 2 matrix below.<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" alt=\"Bildschirmfoto 2017-11-09 um 17.20.16\" data-attachment-id=\"94\" data-comments-opened=\"1\" data-image-description=\"\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Bildschirmfoto 2017-11-09 um 17.20.16\" data-large-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-16.png?w=554\" data-medium-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-16.png?w=300\" data-orig-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-16.png\" data-orig-size=\"554,506\" data-permalink=\"https:\/\/machinelearning-blog.com\/2017\/11\/04\/calculus-derivatives\/bildschirmfoto-2017-11-09-um-17-20-16\/\" height=\"276\" sizes=\"(max-width: 302px) 100vw, 302px\" src=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-16.png?w=302&amp;h=276\" srcset=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-16.png?w=302&amp;h=276 302w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-16.png?w=150&amp;h=137 150w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-16.png 554w\" width=\"302\" \/><\/p>\n<p>Next let&rsquo;s talk about how to refer to specific elements of the matrix. Matrix elements are just mean the entries\/numbers inside the matrix. The picture below shows you just that. If you got a matrix called A, then A subscript ij is going to refer to the i comma j entry. Meaning the entry is in the I row and the j column.<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" alt=\"Bildschirmfoto 2017-11-09 um 17.20.27\" data-attachment-id=\"95\" data-comments-opened=\"1\" data-image-description=\"\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Bildschirmfoto 2017-11-09 um 17.20.27\" data-large-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-27.png?w=736\" data-medium-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-27.png?w=300\" data-orig-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-27.png\" data-orig-size=\"1118,402\" data-permalink=\"https:\/\/machinelearning-blog.com\/2017\/11\/04\/calculus-derivatives\/bildschirmfoto-2017-11-09-um-17-20-27\/\" height=\"224\" sizes=\"(max-width: 622px) 100vw, 622px\" src=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-27.png?w=622&amp;h=224\" srcset=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-27.png?w=622&amp;h=224 622w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-27.png?w=150&amp;h=54 150w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-27.png?w=300&amp;h=108 300w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-27.png?w=768&amp;h=276 768w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-27.png?w=1024&amp;h=368 1024w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-09-um-17-20-27.png 1118w\" width=\"622\" \/><\/p>\n<p>Here are some examples for it:<\/p>\n<p>A11&nbsp;= 1402<\/p>\n<p>A32&nbsp;= 1437<\/p>\n<p>It is nearly the same with a vector. If you have a vector called A then A1&nbsp;would be it&rsquo;s first element, A2&nbsp;it&rsquo;s second and so on.<\/p>\n<h2><b>Tensors<\/b><\/h2>\n<p>The most general term for all of these concepts above is a Tensor because a Tensor is a multidimensional array.<\/p>\n<p>So a first-order tensor would be a vector. A second order tensor is a matrix and third-order tensors and higher are called higher-order tensors.<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" alt=\"Bildschirmfoto 2017-11-07 um 08.20.02.png\" data-attachment-id=\"96\" data-comments-opened=\"1\" data-image-description=\"\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Bildschirmfoto 2017-11-07 um 08.20.02\" data-large-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-20-02.png?w=736\" data-medium-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-20-02.png?w=300\" data-orig-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-20-02.png\" data-orig-size=\"1612,898\" data-permalink=\"https:\/\/machinelearning-blog.com\/2017\/11\/04\/calculus-derivatives\/bildschirmfoto-2017-11-07-um-08-20-02\/\" height=\"332\" sizes=\"(max-width: 595px) 100vw, 595px\" src=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-20-02.png?w=595&amp;h=332\" srcset=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-20-02.png?w=595&amp;h=332 595w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-20-02.png?w=1190&amp;h=664 1190w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-20-02.png?w=150&amp;h=84 150w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-20-02.png?w=300&amp;h=167 300w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-20-02.png?w=768&amp;h=428 768w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-08-20-02.png?w=1024&amp;h=570 1024w\" width=\"595\" \/><\/p>\n<p>For an example you could represent a social graph that represents friends of friends as a higher order tensor.<\/p>\n<p>You probably know googles own library called tensor flow that allows you to build a computational graph where tensors can &bdquo;flow&ldquo; trough a series of mathematical operations.<\/p>\n<p>As computational power and the amount of data we have increases we are becoming more capable of processing multi dimensional data.<\/p>\n<p>Vectors are usually represented in a lot of different ways and are also used in a lot of fields like physics and science. For an example in Einsteins theory of relativity the curvature of spacetime is described by a Riemann Curvature Tensor (in an order 4 tensor, a higher-order tensor).<\/p>\n<p>Any type of data can be represented as a vector because it can be broken down into a set of numbers. Examples would be Images, stock-prices, videos, text, audio and so on.<\/p>\n<p>A common problem in machine learning is that a model is not really accepting the data and therefore keeps throwing errors. Often the solution lies in vectorizing the data which means nothing more than reshaping the data into the required dimensions. A model expects tensors of a certain size and therefore you need to reshape your input data so that it is in the right vector space. Vectorization is essentially just a matrix operation.<\/p>\n<p>There is a python library called Numpy that can do this with just a single line of code.<\/p>\n<p>&gt;&gt;&gt; x.reshape(10, 10)<\/p>\n<p>Vectors don&rsquo;t just represent data. They help us to represent our models too because many machine learning models represent their learnings as vectors. All types of neural networks do this.<\/p>\n<p>Once data is vectorized we can do a lot of things with it. A so called &bdquo;Word2Vec&ldquo; model turns words into vectors&nbsp;&nbsp;and then we can do mathematical operations with it. We can then for an example see how closely words are connected together by computing the distance between their vectors. An example for it would be that the word Germany is closely related to other wealthy European countries. Word vectors that are similar are likely to be clustered together. Through vectorizing words we are able to capture their semantic meanings numerically.<\/p>\n<p>We compute the distance between two vectors by using the notion of a &bdquo;vector norm&ldquo;. A norm is any function that maps vectors to real numbers, that satisfy the following conditions.<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" alt=\"Bildschirmfoto 2017-11-07 um 09.42.30\" data-attachment-id=\"97\" data-comments-opened=\"1\" data-image-description=\"\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Bildschirmfoto 2017-11-07 um 09.42.30\" data-large-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-42-30.png?w=736\" data-medium-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-42-30.png?w=300\" data-orig-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-42-30.png\" data-orig-size=\"1504,394\" data-permalink=\"https:\/\/machinelearning-blog.com\/2017\/11\/04\/calculus-derivatives\/bildschirmfoto-2017-11-07-um-09-42-30\/\" height=\"172\" sizes=\"(max-width: 658px) 100vw, 658px\" src=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-42-30.png?w=658&amp;h=172\" srcset=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-42-30.png?w=658&amp;h=172 658w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-42-30.png?w=1313&amp;h=344 1313w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-42-30.png?w=150&amp;h=39 150w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-42-30.png?w=300&amp;h=79 300w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-42-30.png?w=768&amp;h=201 768w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-42-30.png?w=1024&amp;h=268 1024w\" width=\"658\" \/><\/p>\n<p>The conditions above mean that the lengths need to be always positive, the length of zero implies zero, scalar multiplication extends lengths in a predictable way and distances add reasonably.<\/p>\n<p>Therefore in a basic vector space the norm of a vector would be it&rsquo;s absolute value and the distance between two numbers. Like this:&nbsp;<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" alt=\"Bildschirmfoto 2017-11-07 um 09.46.48\" data-attachment-id=\"98\" data-comments-opened=\"1\" data-image-description=\"\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Bildschirmfoto 2017-11-07 um 09.46.48\" data-large-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-46-48.png?w=688\" data-medium-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-46-48.png?w=300\" data-orig-file=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-46-48.png\" data-orig-size=\"688,338\" data-permalink=\"https:\/\/machinelearning-blog.com\/2017\/11\/04\/calculus-derivatives\/bildschirmfoto-2017-11-07-um-09-46-48\/\" height=\"192\" sizes=\"(max-width: 391px) 100vw, 391px\" src=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-46-48.png?w=391&amp;h=192\" srcset=\"https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-46-48.png?w=391&amp;h=192 391w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-46-48.png?w=150&amp;h=74 150w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-46-48.png?w=300&amp;h=147 300w, https:\/\/machinelearningblogcom.files.wordpress.com\/2017\/11\/bildschirmfoto-2017-11-07-um-09-46-48.png 688w\" width=\"391\" \/>\u200b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is essential for a machine learning engineer to have a good understanding of Vectors, one of the most crucial concepts within Machine Learning because many bugs are due to having matrix \/vector dimensions that don&rsquo;t fit properly. A common problem in machine learning is that a model is not really accepting the data and therefore keeps throwing errors. Often the solution lies in vectorizing the data which means nothing more than reshaping the data into the required dimensions.<\/p>\n","protected":false},"author":413,"featured_media":3346,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[183],"tags":[92],"ppma_author":[2327],"class_list":["post-1828","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-ml","tag-machine-learning"],"authors":[{"term_id":2327,"user_id":413,"is_guest":0,"slug":"niklas-donges","display_name":"Niklas Donges","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","user_url":"","last_name":"Donges","first_name":"Niklas","job_title":"","description":"<a href=\"https:\/\/www.linkedin.com\/in\/niklas-donges\/\">Niklas Donges<\/a>&nbsp;is Machine Learning Engineer at SAP. He is a Technical Blogger for the &#039;Towards Data Science&#039; publication"}],"_links":{"self":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts\/1828","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/users\/413"}],"replies":[{"embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/comments?post=1828"}],"version-history":[{"count":1,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts\/1828\/revisions"}],"predecessor-version":[{"id":6706,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts\/1828\/revisions\/6706"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/media\/3346"}],"wp:attachment":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/media?parent=1828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/categories?post=1828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/tags?post=1828"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=1828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}