{"id":637,"date":"2018-11-14T16:38:09","date_gmt":"2018-11-14T22:38:09","guid":{"rendered":"http:\/\/www.jacobsoft.com.mx\/?p=637"},"modified":"2025-02-20T13:37:49","modified_gmt":"2025-02-20T19:37:49","slug":"analisis-del-componente-principal","status":"publish","type":"post","link":"https:\/\/www.jacobsoft.com.mx\/en\/analisis-del-componente-principal\/","title":{"rendered":"Principal Component Analysis"},"content":{"rendered":"<h2 class=\"wp-block-heading\">Principal Component Analysis<\/h2>\n\n\n\n<p>The PCA is a tool for <strong>reduce dimensionality<\/strong> in the data that can be used to convert a fairly large set of variables into a smaller set that contains the largest amount of information contained in the large set.<\/p>\n\n\n\n<p>Si quieres verlo en video:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"An\u00e1lisis del Componente Principal PCA con Python\" width=\"780\" height=\"439\" src=\"https:\/\/www.youtube.com\/embed\/oAsZfT-paG0?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>In this sense, the PCA is a mathematical procedure that transforms a set of correlated variables into a set (smaller) of variables<strong> not correlated<\/strong> calls <strong>main components<\/strong>.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The first principal component represents the greatest possible amount of variability in the data and each subsequent component explains most of the remaining variability, ie, that the smallest data set should preserve the <strong><em>variance<\/em><\/strong> of the original data.<\/p>\n\n\n\n<p>For example, a two-dimensional data set can be reduced by projecting points on a line, so each instance in the data set can be represented by a single value instead of a pair of values. A three-dimensional data set can be reduced to two dimensions by projecting the variables in a plane.<\/p>\n\n\n\n<p>In general, a set of <strong>n dimensions<\/strong> it can be reduced by projecting the data set into a subspace of k dimensions, where k is less than n.<\/p>\n\n\n\n<p>More formally, PCA can be used to find a set of vectors spanning a subspace, which minimizes the sum of the <strong><em>quadratic error<\/em><\/strong> of the projected data. The projection will retain the largest proportion of the variance of the original data.<\/p>\n\n\n\n<p>PCA rotates the data set to align it with its main components to maximize the variance contained within the first major components. Suppose we have the following set of data plotted in the figure:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"676\" height=\"510\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_grafica_1.png\" alt=\"\" class=\"wp-image-678\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_grafica_1.png 676w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_grafica_1-300x226.png 300w\" sizes=\"auto, (max-width: 676px) 100vw, 676px\" \/><figcaption>Graph of two data variables<\/figcaption><\/figure><\/div>\n\n\n\n<p>The instances form an approximate ellipse that can be seen from the origin to the top right of the graph. To reduce the dimension of this data set, we must project the points in a line. The following graph shows two lines where the data could be projected. In each of them, the variance is different, so the task is to see in which of the two lines the instances have the greatest variation.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"629\" height=\"472\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_grafica_2.png\" alt=\"\" class=\"wp-image-679\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_grafica_2.png 629w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_grafica_2-300x225.png 300w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><figcaption>Lines on which the data of the set can be projected<\/figcaption><\/figure><\/div>\n\n\n\n<p>Instances have the most variation on the dashed line, rather than on the dotted line. In fact, the line in dashes is the first main component. The second main component must be orthogonal to the first, that is, that the second main component must be statistically independent, and apparently it will be perpendicular to the first main component, as shown in the following figure:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"603\" height=\"452\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_grafica_3.png\" alt=\"\" class=\"wp-image-680\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_grafica_3.png 603w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_grafica_3-300x225.png 300w\" sizes=\"auto, (max-width: 603px) 100vw, 603px\" \/><figcaption>First and second main component<\/figcaption><\/figure><\/div>\n\n\n\n<p>Each subsequent principal component preserves the greater amount of the remaining variance, the only restriction being that each must be orthogonal to the previous one.<\/p>\n\n\n\n<p>If we now consider that the data has three variables, so the data set is three-dimensional:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"648\" height=\"486\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_grafica_4.png\" alt=\"\" class=\"wp-image-681\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_grafica_4.png 648w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_grafica_4-300x225.png 300w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><figcaption>Three-dimensional data set<\/figcaption><\/figure><\/div>\n\n\n\n<p>The points can be rotated and moved in such a way that two dimensions are accommodated and the points now form an ellipse, the third dimension has almost no variance and then it can be discarded.<\/p>\n\n\n\n<p>The PCA is most useful when the variance in the data set is unevenly distributed along the dimensions. If, on the contrary, a data set between three dimensions forms a convex sphere, the PCA analysis could not be as effective since there is a similar variance in each dimension, none of the dimensions can be discarded without losing significant information.<\/p>\n\n\n\n<p>Visually it is easier to identify the main components when the data set is composed of only two or three dimensions. For a larger dimension set the calculations for the main components are described in the following sections.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Variance and Covariance<\/h3>\n\n\n\n<p>Before entering fully with the calculations to identify the main components, let&#039;s see some basic concepts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Variance<\/h3>\n\n\n\n<p>The variance is the measure that tells us how scattered or distributed a set of values \u200b\u200bis. The variance is calculated as the average of the square of the difference in values \u200b\u200bwith respect to the average of that set of values:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"212\" height=\"96\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_Vrianza.png\" alt=\"\" class=\"wp-image-682\"\/><figcaption>Equation of variance<\/figcaption><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Covariance<\/h3>\n\n\n\n<p>Covariance is the measure of how much two variables change together. It is a measure of the strength of the correlation between two sets of variables. If the covariance between <strong>two variables is zero<\/strong>, variables <strong>They&#039;re not here<\/strong> correlated. However, the fact that two variables are not correlated does not imply that they are independent, since the correlation is only a measure of linear dependence and is calculated with the following equation:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"380\" height=\"76\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_covarianza.png\" alt=\"\" class=\"wp-image-683\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_covarianza.png 380w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_covarianza-300x60.png 300w\" sizes=\"auto, (max-width: 380px) 100vw, 380px\" \/><figcaption>Equation of covariance<\/figcaption><\/figure><\/div>\n\n\n\n<p>If the covariance is not zero, the sign indicates whether the variables are <strong>positive<\/strong> or <strong>negatively<\/strong> correlated. If two variables are positively correlated, it means that one increases its value when the other increases it.<\/p>\n\n\n\n<p>When two variables are <strong>negatively correlated<\/strong> means that a variable has a decrease relative to its mean when the other variable presents an increase relative to its mean. <\/p>\n\n\n\n<p>The <strong>covariance matrix<\/strong> describes the values \u200b\u200bof the covariance between each pair of values \u200b\u200bin the data set. The element (i, j) indicates the covariance of the dimension i, j of the data. For example, the covariance matrix of a three-dimensional data set would look like this:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"464\" height=\"145\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_matriz_covarianza.png\" alt=\"\" class=\"wp-image-684\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_matriz_covarianza.png 464w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_matriz_covarianza-300x94.png 300w\" sizes=\"auto, (max-width: 464px) 100vw, 464px\" \/><figcaption>Covariance matrix of a 3-dimensional set<\/figcaption><\/figure><\/div>\n\n\n\n<p>If as an example we consider the following data set:<\/p>\n\n\n\n<figure class=\"wp-block-table aligncenter is-style-regular\"><table><tbody><tr><td>2<\/td><td>0<\/td><td>-1.4<\/td><\/tr><tr><td>2.2<\/td><td>0.2<\/td><td>-1.5<\/td><\/tr><tr><td>2.4<\/td><td>0.1<\/td><td>-1<\/td><\/tr><tr><td>1.9<\/td><td>0<\/td><td>-1.2<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>In the previous table we have 3 variables as 4 cases, then the average of each variable is: 2.125, 0.075 and -1.275, with this we can now calculate the covariance of each pair of variables to generate the following covariance matrix.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"615\" height=\"134\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_matriz_datos.png\" alt=\"\" class=\"wp-image-687\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_matriz_datos.png 615w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/PCA_matriz_datos-300x65.png 300w\" sizes=\"auto, (max-width: 615px) 100vw, 615px\" \/><figcaption>Covariance matrix of the previous data set<\/figcaption><\/figure><\/div>\n\n\n\n<p>Using <strong>Numpy <\/strong>we can generate the covariance matrix in the following way:<\/p>\n\n\n\n\n<pre><span class=\"key\">import<\/span> numpy <span class=\"key\">ace<\/span> np X = [[2, 0, -1.4], [2.2, 0.2, -1.5], [2.4, 0.1, -1], [1.9, 0, -1.2]] print np.cov (np.array (X ) .T out: [[0.04916667 0.01416667 0.01916667] [0.01416667 0.00916667 -0.00583333] [0.01916667 -0.00583333 0.04916667]]\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Own and Own Values<\/h3>\n\n\n\n<p>A vector is described by its direction and its magnitude, or length. An eigenvector of a matrix is \u200b\u200ba nonzero vector that satisfies the following equation:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"114\" height=\"40\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/Vector_propio.png\" alt=\"\" class=\"wp-image-688\"\/><\/figure><\/div>\n\n\n\n<p>In the previous equation <strong>v<\/strong> is the own vector <strong>TO<\/strong> is a square matrix and <strong>lanbda<\/strong> it is a scalar called own value. The direction of the eigenvector remains the same after being transformed by A, only its magnitude changes, given by the eigenvalue, that is to say that multiplying a matrix by one of its eigenvectors is equivalent to scaling the eigenvector.&nbsp;<\/p>\n\n\n\n<p>In English a vector of its own is known as <strong>eigenvector <\/strong>and the word <strong>eigen <\/strong>in German means belongs to, or that is<em> peculiar to<\/em>, so that the eigenvector of a matrix is \u200b\u200ba vector that belongs to, and characterizes the structure of the data.<\/p>\n\n\n\n<p>Both the eigenvectors and the eigenvalues \u200b\u200bcan only be derived from <strong><em>square matrices<\/em><\/strong> and not all square matrices have eigenvectors or eigenvalues. If a matrix has vectors and eigenvalues, it will have a pair for each of its dimensions. The <strong>main components<\/strong> of a matrix are the eigenvectors of its <strong><em>covariance matrix<\/em><\/strong>, ordered by their corresponding eigenvalues.<\/p>\n\n\n\n<p>The eigenvector with the largest eigenvalue is the <strong>first <\/strong>main component, the second main component is the eigenvector with the second largest eigenvalue and so on.&nbsp;<\/p>\n\n\n\n<p>As an example, let us calculate the eigenvectors and their eigenvalues \u200b\u200bof the following square matrix:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"170\" height=\"97\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/matriz_cuadrada.png\" alt=\"\" class=\"wp-image-689\"\/><\/figure><\/div>\n\n\n\n<p>From the equation we showed previously, remember that the product of the matrix A and any of its eigenvectors must be equal to the eigenvector multiplied by its eigenvalue.<\/p>\n\n\n\n<p>Let&#039;s start by finding the eigenvalues, which can be found with the following characteristic equations:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"424\" height=\"178\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/ecuaciones_caracteristicas.png\" alt=\"\" class=\"wp-image-691\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/ecuaciones_caracteristicas.png 424w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/ecuaciones_caracteristicas-300x126.png 300w\" sizes=\"auto, (max-width: 424px) 100vw, 424px\" \/><\/figure><\/div>\n\n\n\n<p>The characteristic equation states that the determinant of the matrix, that is, the difference between the data of the matrix and the product of the identity matrix and an eigenvalue is zero:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"422\" height=\"104\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/determinante_matriz.png\" alt=\"\" class=\"wp-image-692\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/determinante_matriz.png 422w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/determinante_matriz-300x74.png 300w\" sizes=\"auto, (max-width: 422px) 100vw, 422px\" \/><\/figure><\/div>\n\n\n\n<p>Both eigenvalues \u200b\u200bof this matrix are equal to -1. So now we can use the eigenvalues \u200b\u200bto solve the eigenvectors<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"114\" height=\"40\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/Vector_propio.png\" alt=\"\" class=\"wp-image-688\"\/><\/figure><\/div>\n\n\n\n<p>First, we make the equation equal to zero:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"178\" height=\"51\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/ecuacion_igual_a-cero.png\" alt=\"\" class=\"wp-image-693\"\/><\/figure><\/div>\n\n\n\n<p>Substituting the values \u200b\u200bfor A we have the following:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"112\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/sustituyendo_valores.png\" alt=\"\" class=\"wp-image-694\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/sustituyendo_valores.png 780w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/sustituyendo_valores-300x43.png 300w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/sustituyendo_valores-768x110.png 768w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/figure><\/div>\n\n\n\n<p>Now we can substitute the first eigenvalue to solve the eigenvectors.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"537\" height=\"101\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/sustitucion_valores_propios.png\" alt=\"\" class=\"wp-image-696\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/sustitucion_valores_propios.png 537w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/sustitucion_valores_propios-300x56.png 300w\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" \/><\/figure><\/div>\n\n\n\n<p>Now we show the resulting equations as a system of equations:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"244\" height=\"115\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/sistema_ecuaciones.png\" alt=\"\" class=\"wp-image-697\"\/><\/figure><\/div>\n\n\n\n<p>Each nonzero vector that satisfies the previous equations, can be used as own vector:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"321\" height=\"90\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/vectores_propios.png\" alt=\"\" class=\"wp-image-699\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/vectores_propios.png 321w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/vectores_propios-300x84.png 300w\" sizes=\"auto, (max-width: 321px) 100vw, 321px\" \/><\/figure><\/div>\n\n\n\n<p>PCA requires unit vectors or vectors that have a length of 1, so you can normalize the vectors by dividing them by their normal, which is achieved with the following equation:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"295\" height=\"82\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/vector_normalizado.png\" alt=\"\" class=\"wp-image-701\"\/><\/figure><\/div>\n\n\n\n<p>The norm of the vector is the following:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"269\" height=\"100\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/vector_norm.png\" alt=\"\" class=\"wp-image-702\"\/><\/figure><\/div>\n\n\n\n<p>This generates the following unitary own vector:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"422\" height=\"100\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/vector_propio_unitario.png\" alt=\"\" class=\"wp-image-703\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/vector_propio_unitario.png 422w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/vector_propio_unitario-300x71.png 300w\" sizes=\"auto, (max-width: 422px) 100vw, 422px\" \/><\/figure><\/div>\n\n\n\n<p>To verify with Numpy that the previous solution is correct, we can do the following where the eig function returns a tuple of eigenvalues \u200b\u200band the eigenvectors.<\/p>\n\n\n\n\n<pre><span class=\"key\">import<\/span> numpy <span class=\"key\">ace<\/span> np v, w = np.linalg.eig (np.array ([[1, -2], [2, -3]])) w; v arrray ([- 0.99999998, -1.00000002]) array ([[0.70710678, 0.70710678], [0.70710678, 0.70710678]])\n<\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<script async=\"\" src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n<ins class=\"adsbygoogle\" style=\"display:block; text-align:center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-2380084220870127\" data-ad-slot=\"2437322509\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Reduction of Dimensionality<\/h2>\n\n\n\n<p>Using PCA (Principal Component Analysis) to reduce the following two-dimensional data set in only one dimension:<\/p>\n\n\n\n<figure class=\"wp-block-table aligncenter is-style-stripes\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>x1<\/strong><\/td><td><strong>x2<\/strong><\/td><\/tr><tr><td>0.9<\/td><td>1<\/td><\/tr><tr><td>2.4<\/td><td>2.6<\/td><\/tr><tr><td>1.2<\/td><td>1.7<\/td><\/tr><tr><td>0.5<\/td><td>0.7<\/td><\/tr><tr><td>0.3<\/td><td>0.7<\/td><\/tr><tr><td>1.8<\/td><td>1.4<\/td><\/tr><tr><td>0.5<\/td><td>0.6<\/td><\/tr><tr><td>0.3<\/td><td>0.6<\/td><\/tr><tr><td>2.5<\/td><td>2.6<\/td><\/tr><tr><td>1.3<\/td><td>1.1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The first step is to subtract the mean of each variable in each of the cases<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"644\" height=\"389\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/pca_resta_de_la_media.png\" alt=\"\" class=\"wp-image-705\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/pca_resta_de_la_media.png 644w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/pca_resta_de_la_media-300x181.png 300w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/figure><\/div>\n\n\n\n<p>Now we calculate the main components of the data. Recalling that the principal components are the eigenvectors of the covariance matrix ordered by the eigenvalues.<\/p>\n\n\n\n<p>The main components can be found using two different techniques. The first technique requires calculating the covariance matrix of the data. Since the covariance matrix will be a square matrix, we can calculate the vectors and eigenvalues \u200b\u200bas described above.&nbsp;<\/p>\n\n\n\n<p>The second technique uses the decomposition of the singular value of the data matrix to find the vectors and the square root of the eigenvalues \u200b\u200bof the covariance matrix. We use the first technique to describe the process and the second technique with the library <strong>scikit-learn<\/strong>.<\/p>\n\n\n\n<p>The following matrix is \u200b\u200bthe covariance matrix of the data<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"433\" height=\"102\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/matriz_covarianza_datos.png\" alt=\"\" class=\"wp-image-707\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/matriz_covarianza_datos.png 433w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/matriz_covarianza_datos-300x71.png 300w\" sizes=\"auto, (max-width: 433px) 100vw, 433px\" \/><\/figure><\/div>\n\n\n\n<p>Using the technique described above, the eigenvalues \u200b\u200bare 1,250 and 0.034. The following matrix represents the unit eigenvectors:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"340\" height=\"91\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/vectores_propios_unitarios.png\" alt=\"\" class=\"wp-image-708\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/vectores_propios_unitarios.png 340w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/vectores_propios_unitarios-300x80.png 300w\" sizes=\"auto, (max-width: 340px) 100vw, 340px\" \/><\/figure><\/div>\n\n\n\n<p>Now we project the data into the main components. The first eigenvector has the highest eigenvalues \u200b\u200band is the first principal component. We build a transformation matrix where each column of the matrix is \u200b\u200bthe proper vector for a main component.<\/p>\n\n\n\n<p>If you were reducing a 5-dimensional data set in a three-dimensional set, you would build a transformation matrix with 3 columns. In this example, we project the two-dimensional data set into one dimension, so we only use the eigenvector for the first principal component.<\/p>\n\n\n\n<p>Finally we calculate the product point of the data matrix with the transformation matrix, resulting in the following:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"533\" height=\"418\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/producto_punto.png\" alt=\"\" class=\"wp-image-710\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/producto_punto.png 533w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/producto_punto-300x235.png 300w\" sizes=\"auto, (max-width: 533px) 100vw, 533px\" \/><\/figure><\/div>\n\n\n\n<p>The resulting vector is the resulting dimension, that is, it is the matrix of a dimension that corresponds to the variable that results from reducing the two original dimensions in a dimension of the data set.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">PCA with Python<\/h2>\n\n\n\n<p>Now we will implement the <a href=\"https:\/\/click.linksynergy.com\/link?id=cTjR400Zjac&amp;offerid=145238.2767345&amp;type=2&amp;murl=http%3A%2F%2Fwww.informit.com%2Ftitle%2F9780134770857\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Ahora implementaremos el an\u00e1lisis de componente principal con python, aunque quiz\u00e1s antes de continuare podr\u00eda ser conveniente que revisaras algunos de los curso de programaci\u00f3n que te podr\u00edan ayudar a entender la estructura y la l\u00f3gica detr\u00e1s de los lenguajes m\u00e1s comunes. (opens in a new tab)\">main component analysis with python<\/a>, although perhaps before continuing, it might be convenient to review some of the <a rel=\"noreferrer noopener\" aria-label=\"Ahora implementaremos el an\u00e1lisis de componente principal con python, aunque quiz\u00e1s antes de continuare podr\u00eda ser conveniente que revisaras algunos de los curso de programaci\u00f3n que te podr\u00edan ayudar a entender (opens in a new tab)\" href=\"https:\/\/click.linksynergy.com\/fs-bin\/click?id=cTjR400Zjac&amp;offerid=529351.17&amp;type=3&amp;subid=0\" target=\"_blank\">programming course<\/a> that could help you understand the structure and logic behind the most common languages.<\/p>\n\n\n\n<p>As a first step we import the necessary libraries for machine learning<\/p>\n\n\n\n\n<pre><span class=\"key\">import<\/span> numpy <span class=\"key\">ace<\/span> np\n<span class=\"key\">import<\/span> matplotlib.pyplot <span class=\"key\">ace<\/span> plt\n<span class=\"key\">import<\/span> pandas <span class=\"key\">ace<\/span> P.S\n<\/pre>\n\n\n\n<p>For this example we will use a set of data from a wine collection with 13 independent variables and a dependent variable, which gives us the classification of the wine. The independent variables are characteristic values \u200b\u200bof the wine in question and that go from the alcohol, the aroma, the flavor, the acidity, and other components or ingredients that classify a wine.<\/p>\n\n\n\n\n<pre><span class=\"com\"># We import the data set<\/span>\ndataset = pd.read_csv (&#039;<span class=\"tex\">Wine.csv<\/span>&#039;) X = dataset.iloc [:, <span class=\"key\">0<\/span>:<span class=\"key\">13<\/span>] .values \u200b\u200by = dataset.iloc [:, <span class=\"key\">13<\/span>] .values\n<\/pre>\n\n\n\n<p>The set of 177 cases with 13 independent variables is as follows:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1191\" height=\"538\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/wine_dataset.png\" alt=\"\" class=\"wp-image-713\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/wine_dataset.png 1191w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/wine_dataset-300x136.png 300w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/wine_dataset-768x347.png 768w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/wine_dataset-1024x463.png 1024w\" sizes=\"auto, (max-width: 1191px) 100vw, 1191px\" \/><figcaption>Data set for wine classification<\/figcaption><\/figure><\/div>\n\n\n\n<p>Once we import the data, we separate the independent variables in the X matrix and the dependent variable in the vector y.<\/p>\n\n\n\n<p>Now we divide the data set into two sets for training and testing<\/p>\n\n\n\n\n<pre><span class=\"com\"># Splitting the dataset into the Training set and Test set<\/span>\n<span class=\"key\">desde<\/span> sklearn.model_selection <span class=\"key\">import<\/span> train_test_split X_train, X_test, y_train, y_test = train_test_split (X, y, test_size = <span class=\"key\">0.2<\/span>, random_state = <span class=\"key\">0<\/span>)\n\n\n<\/pre>\n\n\n\n<p>Our next step will be to standardize the scales for the 13 variables<\/p>\n\n\n\n\n<pre><span class=\"com\"># Feature Scaling<\/span>\n<span class=\"key\">desde<\/span> sklearn.preprocessing <span class=\"com\">import<\/span> StandardScaler sc = StandardScaler () X_train = sc.fit_transform (X_train) X_test = sc.transform (X_test)\n\n\n<\/pre>\n\n\n\n<p>Once with the normalized data, we apply the PCA to reduce the dimension from 13 to 2 variables.<\/p>\n\n\n\n\n<pre><span class=\"com\"># Applying PCA<\/span>\n<span class=\"key\">desde<\/span> sklearn.decomposition <span class=\"key\">import<\/span> PCA pca = PCA (n_components = <span class=\"key\">2<\/span>) X_train = pca.fit_transform (X_train) X_test = pca.transform (X_test)\n\n\n<\/pre>\n\n\n\n<p>The training set was now with 2 variables as follows:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"416\" height=\"594\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/pca_training_set.png\" alt=\"\" class=\"wp-image-718\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/pca_training_set.png 416w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/pca_training_set-210x300.png 210w\" sizes=\"auto, (max-width: 416px) 100vw, 416px\" \/><figcaption>training set reduced from 13 to 2 variables<\/figcaption><\/figure><\/div>\n\n\n\n<p>The same happened with the X_test test set. Now to know how much the variance of the two resulting principal components is expressed, in relation to the original dimension, that is, to the data of the original 13 variables, we can extract that information from the PCA object and analyze it.<\/p>\n\n\n\n\n<pre><span class=\"com\"># Explanation of the variance # We create a vector with the percentage of influence of the variance # for the two variables resulting from the data set<\/span>\nexplained_variance = pca.explained_variance_ratio_\n\n\n<\/pre>\n\n\n\n<p>The values \u200b\u200bof the variable explained_variance are:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"416\" height=\"338\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/explained_variance.png\" alt=\"\" class=\"wp-image-719\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/explained_variance.png 416w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/explained_variance-300x244.png 300w\" sizes=\"auto, (max-width: 416px) 100vw, 416px\" \/><\/figure><\/div>\n\n\n\n<p>The two resulting principal components are the two eigenvalues \u200b\u200bof the eigenvectors with the highest value of the original 13 of the data set. From there, the two highest were obtained to obtain the two resulting dimensions or main components. The first represents 36.9% and the second 19.3%<\/p>\n\n\n\n<p>To verify that the two resulting variables represent the original 13 variables, we will make the prediction of the dependent variable with logistic regression, checking the prediction results with the confusion matrix:<\/p>\n\n\n\n\n<pre><span class=\"com\"># Fitting Logistic Regression to the Training set<\/span>\n<span class=\"key\">desde<\/span> sklearn.linear_model <span class=\"key\">import<\/span> LogisticRegression classifier = LogisticRegression (random_state = <span class=\"key\">0<\/span>) classifier.fit (X_train, y_train)\n\n<span class=\"com\"># Predicting the Test set results<\/span>\ny_pred = classifier.predict (X_test)\n\n<span class=\"com\"># Making the Confusion Matrix<\/span>\n<span class=\"key\">desde<\/span> sklearn.metrics <span class=\"key\">import<\/span> confusion_matrix cm = confusion_matrix (y_test, y_pred)\n\n<\/pre>\n\n\n\n<p>When making the prediction for the test set, the confusion matrix is \u200b\u200bas follows:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"416\" height=\"338\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/pca_matriz_de_confusion.png\" alt=\"\" class=\"wp-image-722\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/pca_matriz_de_confusion.png 416w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/pca_matriz_de_confusion-300x244.png 300w\" sizes=\"auto, (max-width: 416px) 100vw, 416px\" \/><figcaption>Matrix of confusion of the logistic regression<\/figcaption><\/figure><\/div>\n\n\n\n<p>As observed in the confusion matrix, there is only one error, a false positive in the first of the three classes of wines. So we conclude that the prediction is correct using the data set of two variables, instead of the data set of 13 variables.<\/p>\n\n\n\n<p>Now we can graph the prediction data to observe in a visual way the results of this classification<\/p>\n\n\n\n\n<pre><span class=\"key\">desde<\/span> matplotlib.colors <span class=\"key\">import<\/span> ListedColormap X_set, y_set = X_test, y_test X1, X2 = np.meshgrid (np.arange (start = X_set [:, <span class=\"key\">0<\/span>] .min () - <span class=\"key\">1<\/span>, stop = X_set [:, <span class=\"key\">0<\/span>] .max () + <span class=\"key\">1<\/span>, step = <span class=\"key\">0.01<\/span>), np.arange (start = X_set [:, <span class=\"key\">1<\/span>] .min () - <span class=\"key\">1<\/span>, stop = X_set [:, <span class=\"key\">1<\/span>] .max () + <span class=\"key\">1<\/span>, step = <span class=\"key\">0.01<\/span>)) plt.contourf (X1, X2, classifier.predict (np.array ([X1.ravel (), X2.ravel ()]). T) .reshape (X1.shape), alpha = <span class=\"key\">0.75<\/span>, cmap = ListedColormap ((&#039;<span class=\"tex\">net<\/span>', '<span class=\"tex\">green<\/span>', '<span class=\"tex\">blue<\/span>&#039;))) plt.xlim (X1.min (), X1.max ()) plt.ylim (X2.min (), X2.max ()) for i, j in enumerate (np.unique (y_set)) : plt.scatter (X_set [y_set == j, <span class=\"key\">0<\/span>], X_set [y_set == j, <span class=\"key\">1<\/span>], c = ListedColormap ((&#039;<span class=\"tex\">net<\/span>', '<span class=\"tex\">green<\/span>', '<span class=\"tex\">blue<\/span>&#039;)) (i), label = j) plt.title (&#039; Logistic Regression (Test set) &#039;) plt.xlabel (&#039; PC1 &#039;) plt.ylabel (&#039; PC2 &#039;) plt.legend () plt.show ()\n\n\n<\/pre>\n\n\n\n<p>The resulting graph is as follows<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"656\" height=\"584\" src=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/pca_grafica_pred.png\" alt=\"\" class=\"wp-image-723\" srcset=\"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/pca_grafica_pred.png 656w, https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/11\/pca_grafica_pred-300x267.png 300w\" sizes=\"auto, (max-width: 656px) 100vw, 656px\" \/><figcaption>Graph of the prediction with logistic regression<\/figcaption><\/figure>\n\n\n\n<p>In the graph we observe the areas of the 3 wine classes with the points of the prediction of the test set, where we also observe the only error that exists, the green dot in the red zone.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Final comments<\/h3>\n\n\n\n<p>Many times it is necessary to implement this type of examples in the cloud with a greater amount of real data and execute several of the techniques and algorithms of <a rel=\"noreferrer noopener\" aria-label=\"Muchas veces es necesario implementar este tipo de ejemplos en la nube con una mayor cantidad de datos reales y ejecutar varias de las t\u00e9cnicas y algoritmos de machine learning para realizar algunos comparativos con los distintos algoritmos de clasificaci\u00f3n y\/o predicci\u00f3n. Hoy en d\u00eda existe diversos proveedores de recursos en la nube para ciencia de datos y machine learning, algunos de ellos podr\u00edan ser: Azure de Microsoft, Alibaba Cloud, Amazon Web Servioces, en el este enlace puede checar un webinar para conocer las diferentes certificaciones de Azure. (opens in a new tab)\" href=\"https:\/\/click.linksynergy.com\/link?id=cTjR400Zjac&amp;offerid=145238.2267051&amp;type=2&amp;murl=http%3A%2F%2Fwww.informit.com%2Ftitle%2F9780134116549\" target=\"_blank\">machine learning<\/a> to make some comparisons with the different classification and \/ or prediction algorithms. Today there are several providers of resources in the cloud for data science and <a rel=\"noreferrer noopener\" aria-label=\"Muchas veces es necesario implementar este tipo de ejemplos en la nube con una mayor cantidad de datos reales y ejecutar varias de las t\u00e9cnicas y algoritmos de machine learning para realizar algunos comparativos con los distintos algoritmos de clasificaci\u00f3n y\/o predicci\u00f3n. Hoy en d\u00eda existe diversos proveedores de recursos en la nube para ciencia de datos y machine learning, algunos de ellos podr\u00edan ser: Azure de Microsoft, Alibaba Cloud, Amazon Web Servioces, en el este enlace puede checar un webinar para conocer las diferentes certificaciones de Azure. (opens in a new tab)\" href=\"https:\/\/click.linksynergy.com\/link?id=cTjR400Zjac&amp;offerid=145238.2267051&amp;type=2&amp;murl=http%3A%2F%2Fwww.informit.com%2Ftitle%2F9780134116549\" target=\"_blank\">machine learning<\/a>, some of them could be: <a rel=\"noreferrer noopener\" aria-label=\"Muchas veces es necesario implementar este tipo de ejemplos en la nube con una mayor cantidad de datos reales y ejecutar varias de las t\u00e9cnicas y algoritmos de machine learning para realizar algunos comparativos con los distintos algoritmos de clasificaci\u00f3n y\/o predicci\u00f3n. Hoy en d\u00eda existe diversos proveedores de recursos en la nube para ciencia de datos y machine learning, algunos de ellos podr\u00edan ser: Azure de Microsoft, Alibaba Cloud, Amazon Web Servioces, en el este enlace puede checar un webinar para conocer las diferentes certificaciones de Azure (opens in a new tab)\" href=\"https:\/\/click.linksynergy.com\/fs-bin\/click?id=cTjR400Zjac&amp;offerid=579862.460&amp;type=3&amp;subid=0&amp;LSNSUBSITE=LSNSUBSITE\" target=\"_blank\">Microsoft Azure<\/a>, <a rel=\"noreferrer noopener\" aria-label=\"Muchas veces es necesario implementar este tipo de ejemplos en la nube con una mayor cantidad de datos reales y ejecutar varias de las t\u00e9cnicas y algoritmos de machine learning para realizar algunos comparativos con los distintos algoritmos de clasificaci\u00f3n y\/o predicci\u00f3n. Hoy en d\u00eda existe diversos proveedores de recursos en la nube para ciencia de datos y machine learning, algunos de ellos podr\u00edan ser: Azure de Microsoft, Alibaba Cloud, Amazon Web Servioces, en el este enlace puede checar un webinar para conocer las diferentes certificaciones de Azure. (opens in a new tab)\" href=\"https:\/\/click.linksynergy.com\/fs-bin\/click?id=cTjR400Zjac&amp;offerid=584883.64&amp;subid=0&amp;type=4\" target=\"_blank\">Alibaba Cloud<\/a>, <a href=\"https:\/\/click.linksynergy.com\/link?id=cTjR400Zjac&amp;offerid=145238.2726982&amp;type=2&amp;murl=http%3A%2F%2Fwww.informit.com%2Ftitle%2F9780134702179\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Muchas veces es necesario implementar este tipo de ejemplos en la nube con una mayor cantidad de datos reales y ejecutar varias de las t\u00e9cnicas y algoritmos de machine learning para realizar algunos comparativos con los distintos algoritmos de clasificaci\u00f3n y\/o predicci\u00f3n. Hoy en d\u00eda existe diversos proveedores de recursos en la nube para ciencia de datos y machine learning, algunos de ellos podr\u00edan ser: Azure de Microsoft, Alibaba Cloud, Amazon Web Services, en el este enlace puede checar un webinar para conocer las diferentes certificaciones de Azure. (opens in a new tab)\">Amazon Web Services<\/a>, in this link you can check a <a rel=\"noreferrer noopener\" aria-label=\"Muchas veces es necesario implementar este tipo de ejemplos en la nube con una mayor cantidad de datos reales y ejecutar varias de las t\u00e9cnicas y algoritmos de machine learning para realizar algunos comparativos con los distintos algoritmos de clasificaci\u00f3n y\/o predicci\u00f3n. Hoy en d\u00eda existe diversos proveedores de recursos en la nube para ciencia de datos y machine learning, algunos de ellos podr\u00edan ser: Azure de Microsoft, Alibaba Cloud, Amazon Web Servioces, en el este enlace puede checar un webinar para conocer las diferentes certificaciones de Azure (opens in a new tab)\" href=\"https:\/\/click.linksynergy.com\/fs-bin\/click?id=cTjR400Zjac&amp;offerid=579862.460&amp;type=3&amp;subid=0&amp;LSNSUBSITE=LSNSUBSITE\" target=\"_blank\">webinar<\/a> to know the different certifications of Azure.<\/p>\n\n\n\n<p>On the other hand, some courses with good discounts for cloud services can be checked in <a rel=\"noreferrer noopener\" aria-label=\"Por otro lado, algunos cursos con buenos descuentos para servicios en la nube los puede checar en Alibaba, donde adem\u00e1s (opens in a new tab)\" href=\"https:\/\/click.linksynergy.com\/fs-bin\/click?id=cTjR400Zjac&amp;offerid=584883.11&amp;type=3&amp;subid=0\" target=\"_blank\">Alibaba<\/a>, where you can also verify information about the different <a href=\"https:\/\/click.linksynergy.com\/fs-bin\/click?id=cTjR400Zjac&amp;offerid=584883.7&amp;type=3&amp;subid=0\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Por otro lado, algunos cursos con buenos descuentos para servicios en la nube los puede checar en Alibaba, donde adem\u00e1s podr\u00e1s verificar informaci\u00f3n sobre los distintos servicios. (opens in a new tab)\">services<\/a>.<\/p>\n\n\n\n<p>You can also try the <a rel=\"noreferrer noopener\" aria-label=\"Puedes probar tambi\u00e9n con los trials sin costo por tiempo suficiente para hacer todo tipo de pruebas (opens in a new tab)\" href=\"https:\/\/click.linksynergy.com\/fs-bin\/click?id=cTjR400Zjac&amp;offerid=584883.76&amp;subid=0&amp;type=4\" target=\"_blank\">trials without cost<\/a> for enough time to do all kinds of <a rel=\"noreferrer noopener\" aria-label=\"Puedes probar tambi\u00e9n con los trials sin costo por tiempo suficiente para hacer todo tipo de pruebas. (opens in a new tab)\" href=\"https:\/\/click.linksynergy.com\/fs-bin\/click?id=cTjR400Zjac&amp;offerid=347188.10000786&amp;type=3&amp;subid=0\" target=\"_blank\">tests<\/a>.<\/p>\n\n\n\n<p>Finally, it will always be important to have the foundations of the <a rel=\"noreferrer noopener\" aria-label=\"Por \u00faltimo, siempre ser\u00e1 importante contar con las bases de la programaci\u00f3n y el manejo de bases de datos, por lo que aqu\u00ed podr\u00edas encontrar algunos cursos interesantes. (opens in a new tab)\" href=\"https:\/\/click.linksynergy.com\/fs-bin\/click?id=cTjR400Zjac&amp;offerid=529351.17&amp;type=3&amp;subid=0\" target=\"_blank\">programming <\/a>and the management of databases, so <a rel=\"noreferrer noopener\" aria-label=\"Por \u00faltimo, siempre ser\u00e1 importante contar con las bases de la programaci\u00f3n y el manejo de bases de datos, por lo que aqu\u00ed podr\u00edas encontrar algunos cursos interesantes. (opens in a new tab)\" href=\"https:\/\/click.linksynergy.com\/fs-bin\/click?id=cTjR400Zjac&amp;offerid=529351.17&amp;type=3&amp;subid=0\" target=\"_blank\">here <\/a>You could find some interesting courses.<\/p>\n\n\n\n<p>If you are interested in the article, share it<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<style class=\"advgb-styles-renderer\">\n.key{color:blue;}\n\n\n.key{color:blue;}\n\n\n.key{color:blue;}\n\n\n.key{color:blue;}\n.com{color:gray;}\n.tex{color:green;}\n\n.key{color:blue;}\n.com{color:gray;}\n.tex{color:green;}\n\n.key{color:blue;}\n.com{color:gray;}\n.tex{color:green;}\n\n.key{color:blue;}\n.com{color:gray;}\n.tex{color:green;}\n\n.key{color:blue;}\n.com{color:gray;}\n.tex{color:green;}\n\n.key{color:blue;}\n.com{color:gray;}\n.tex{color:green;}\n\n.key{color:blue;}\n.com{color:gray;}\n.tex{color:green;}\n<\/style>","protected":false},"excerpt":{"rendered":"<p>An\u00e1lisis del Componente Principal El PCA es una herramienta para reducir la dimensionalidad en los &hellip; <\/p>","protected":false},"author":2,"featured_media":639,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[25,35,46],"tags":[91,66,57,58,56,82,50,59,90,92,93],"class_list":["post-637","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-algoritmos","category-inteligencia-artificial","category-machine-learning","tag-analisis-de-componente-principal","tag-analisis-de-datos","tag-ciencia-de-datos","tag-data-mining","tag-data-science","tag-inteligencia-artificial","tag-machine-learning","tag-mineria-de-datos","tag-pca","tag-principal-component-analysis","tag-reduccion-de-la-dimension"],"aioseo_notices":[],"author_meta":{"display_name":"Jacob Avila Camacho","author_link":"https:\/\/www.jacobsoft.com.mx\/en\/author\/jacob-avila\/"},"featured_img":"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/10\/destacada_pca-300x165.png","featured_image_src":"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/10\/destacada_pca.png","featured_image_src_square":"https:\/\/www.jacobsoft.com.mx\/wp-content\/uploads\/2018\/10\/destacada_pca.png","author_info":{"display_name":"Jacob Avila Camacho","author_link":"https:\/\/www.jacobsoft.com.mx\/en\/author\/jacob-avila\/"},"coauthors":[],"tax_additional":{"categories":{"linked":["<a href=\"https:\/\/www.jacobsoft.com.mx\/en\/category\/algoritmos\/\" class=\"advgb-post-tax-term\">Algoritmos<\/a>","<a href=\"https:\/\/www.jacobsoft.com.mx\/en\/category\/inteligencia-artificial\/\" class=\"advgb-post-tax-term\">Inteligencia Artificial<\/a>","<a href=\"https:\/\/www.jacobsoft.com.mx\/en\/category\/inteligencia-artificial\/machine-learning\/\" class=\"advgb-post-tax-term\">Machine Learning<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">Algoritmos<\/span>","<span class=\"advgb-post-tax-term\">Inteligencia Artificial<\/span>","<span class=\"advgb-post-tax-term\">Machine Learning<\/span>"]},"tags":{"linked":["<a href=\"https:\/\/www.jacobsoft.com.mx\/en\/category\/inteligencia-artificial\/machine-learning\/\" class=\"advgb-post-tax-term\">an\u00e1lisis de componente principal<\/a>","<a href=\"https:\/\/www.jacobsoft.com.mx\/en\/category\/inteligencia-artificial\/machine-learning\/\" class=\"advgb-post-tax-term\">an\u00e1lisis de datos<\/a>","<a href=\"https:\/\/www.jacobsoft.com.mx\/en\/category\/inteligencia-artificial\/machine-learning\/\" class=\"advgb-post-tax-term\">Ciencia de Datos<\/a>","<a href=\"https:\/\/www.jacobsoft.com.mx\/en\/category\/inteligencia-artificial\/machine-learning\/\" class=\"advgb-post-tax-term\">Data Mining<\/a>","<a href=\"https:\/\/www.jacobsoft.com.mx\/en\/category\/inteligencia-artificial\/machine-learning\/\" class=\"advgb-post-tax-term\">Data Science<\/a>","<a href=\"https:\/\/www.jacobsoft.com.mx\/en\/category\/inteligencia-artificial\/machine-learning\/\" class=\"advgb-post-tax-term\">Inteligencia Artificial<\/a>","<a href=\"https:\/\/www.jacobsoft.com.mx\/en\/category\/inteligencia-artificial\/machine-learning\/\" class=\"advgb-post-tax-term\">machine learning<\/a>","<a href=\"https:\/\/www.jacobsoft.com.mx\/en\/category\/inteligencia-artificial\/machine-learning\/\" class=\"advgb-post-tax-term\">Miner\u00eda de Datos<\/a>","<a href=\"https:\/\/www.jacobsoft.com.mx\/en\/category\/inteligencia-artificial\/machine-learning\/\" class=\"advgb-post-tax-term\">PCA<\/a>","<a href=\"https:\/\/www.jacobsoft.com.mx\/en\/category\/inteligencia-artificial\/machine-learning\/\" class=\"advgb-post-tax-term\">principal component analysis<\/a>","<a href=\"https:\/\/www.jacobsoft.com.mx\/en\/category\/inteligencia-artificial\/machine-learning\/\" class=\"advgb-post-tax-term\">reducci\u00f3n de la dimensi\u00f3n<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">an\u00e1lisis de componente principal<\/span>","<span class=\"advgb-post-tax-term\">an\u00e1lisis de datos<\/span>","<span class=\"advgb-post-tax-term\">Ciencia de Datos<\/span>","<span class=\"advgb-post-tax-term\">Data Mining<\/span>","<span class=\"advgb-post-tax-term\">Data Science<\/span>","<span class=\"advgb-post-tax-term\">Inteligencia Artificial<\/span>","<span class=\"advgb-post-tax-term\">machine learning<\/span>","<span class=\"advgb-post-tax-term\">Miner\u00eda de Datos<\/span>","<span class=\"advgb-post-tax-term\">PCA<\/span>","<span class=\"advgb-post-tax-term\">principal component analysis<\/span>","<span class=\"advgb-post-tax-term\">reducci\u00f3n de la dimensi\u00f3n<\/span>"]}},"comment_count":"0","relative_dates":{"created":"Posted 7 years ago","modified":"Updated 1 year ago"},"absolute_dates":{"created":"Posted on November 14, 2018","modified":"Updated on February 20, 2025"},"absolute_dates_time":{"created":"Posted on November 14, 2018 4:38 pm","modified":"Updated on February 20, 2025 1:37 pm"},"featured_img_caption":"","series_order":"","_links":{"self":[{"href":"https:\/\/www.jacobsoft.com.mx\/en\/wp-json\/wp\/v2\/posts\/637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jacobsoft.com.mx\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jacobsoft.com.mx\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jacobsoft.com.mx\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jacobsoft.com.mx\/en\/wp-json\/wp\/v2\/comments?post=637"}],"version-history":[{"count":28,"href":"https:\/\/www.jacobsoft.com.mx\/en\/wp-json\/wp\/v2\/posts\/637\/revisions"}],"predecessor-version":[{"id":1772,"href":"https:\/\/www.jacobsoft.com.mx\/en\/wp-json\/wp\/v2\/posts\/637\/revisions\/1772"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.jacobsoft.com.mx\/en\/wp-json\/wp\/v2\/media\/639"}],"wp:attachment":[{"href":"https:\/\/www.jacobsoft.com.mx\/en\/wp-json\/wp\/v2\/media?parent=637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jacobsoft.com.mx\/en\/wp-json\/wp\/v2\/categories?post=637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jacobsoft.com.mx\/en\/wp-json\/wp\/v2\/tags?post=637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}