liveBook · Manning

Eigenvector

As explained in Data Without Labels

An eigenvector is a nonzero vector whose direction is unchanged when a linear transformation is applied, changing only by a scalar factor.

An eigenvector is a nonzero vector whose direction is unchanged by a linear transformation; the transformation only scales it. In principal component analysis (PCA), eigenvectors of a covariance matrix identify directions through the data. The corresponding eigenvalues indicate how much variance those directions capture. section 3.5.1

(3.2)

A*v = λ*v

The equation A*v = λ*v expresses the relationship: applying square matrix A to eigenvector v has the same effect as multiplying v by eigenvalue λ. section 3.5.1

This makes eigenvectors useful for reducing dimensions. A principal component is a linear combination of the original variables, with weights supplied by an eigenvector. To choose components, normalize the variables, calculate their covariance matrix, find its eigenvectors and eigenvalues, then favor the eigenvectors associated with the largest eigenvalues. The chosen components retain the directions of greatest variance. section 3.5 section 3.5.1

Inspect directions in the Iris data

Start with flower measurements as input variables and keep species separate as the target. Inspect the data, standardize the measurements with StandardScaler, and calculate their covariance matrix with np.cov. Then use np.linalg.eig to obtain eigenvalues and eigenvectors. Compare this inspection with a fitted sklearn PCA model: its explained_variance_ratio_ and cumulative-variance plot help decide how many components to keep. A two-component result reduces four input variables to two while retaining all 150 observations. section 3.5.2

For a covariance matrix, the eigenvectors used as component directions are orthogonal: a subsequent component can capture variance along a direction distinct from the first. Eigenvalue decomposition provides the matrix-based explanation; the practical workflow can leave the calculation to NumPy or scikit-learn. section 3.5 section 3.5.1

How Data Without Labels covers it

How deep it goes
Defines the matrix equation and works through covariance-based selection, while deferring broader mathematical treatment.
Examples
Uses Iris flower measurements, NumPy eigenvalue calculations, and scikit-learn PCA variance plots.
What it assumes
Assumes basic Python data handling and introduces normalization and covariance in the PCA workflow; refers deeper eigenvector mathematics to an appendix.
What you can do after
Apply it via NumPy and scikit-learn to inspect variance directions and choose PCA components.
How it connects
Connects eigenvectors to covariance matrices, eigenvalues, principal component analysis, orthogonality, and eigenvalue decomposition.

Also explained in

Compare how 4 books explain eigenvector →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Without Labels. The section links point to the parts of the book it draws on.