In our last lesson, we explored the concept of linear combinations, the fundamental recipe for building new vectors by scaling and adding existing ones. We saw how this idea forms the basis of feature representation in machine learning, where data points are essentially linear combinations of feature vectors. This led us to the idea of a "span"—the set of all possible vectors you can create from a given set of building blocks.
However, a critical question was left unanswered: what happens if some of our building blocks are redundant? What if one feature in our dataset provides no new information because it can be perfectly constructed from other features? This brings us to the core of today's lesson: linear independence. We will define what it means for a set of vectors to be independent, establishing the mathematical language for non-redundancy, and then explore the profound implications this has for building stable and interpretable machine learning models.
From Geometric Intuition to a Formal Test
Let's start by revisiting the geometric intuition we developed with 3Blue1Brown.
Linear combinations, span, and basis vectors | Chapter 2, Essence of linear algebra
Recall this key segment from the video "Linear combinations, span, and basis vectors" that we watched in the previous lesson.
Please re-watch the final part of the video from this timestamp. It introduces the exact terminology we need: "linearly dependent" and "linearly independent".
The video provides the perfect mental model:
- A set of vectors is linearly dependent if at least one of them is redundant—it lies within the span of the others and can be removed without shrinking the span.
- A set of vectors is linearly independent if each vector adds a new dimension to the span. No vector is redundant.
This idea of redundancy is the key. A vector is redundant if it can be written as a linear combination of the other vectors in the set.

Now, let's formalize this with a mathematical test. The following article provides a clear, developer-focused explanation.
Linear Independence & Dependence Explained (The Key to ...
This article frames linear independence in terms of feature engineering and provides both the intuitive and mathematical definitions.
Read the introduction to see a clear ML example of feature redundancy. Study the section "The Developer's Mental Model," which explains independence using the concept of unique, non-redundant building blocks. Finally, read the section on the formal mathematical test. Pay close attention to the logic: if we can find a non-trivial (non-zero) set of scalars that makes the linear combination equal to the zero vector, it proves dependence.
Let's break down the formal test because it's a clever piece of logic. A set of vectors is linearly independent if the only way to satisfy the equation:
is with the "trivial solution," where .
If there is any other solution (a "non-trivial" solution where at least one is not zero), the vectors are linearly dependent. Why? Because if a non-trivial solution exists, we can rearrange the equation. For example, if , we can write:
This algebraic rearrangement proves that is a linear combination of the other vectors, confirming it's redundant.
The Machine Learning Connection: Multicollinearity
In machine learning and statistics, when the feature vectors in a dataset are linearly dependent (or nearly so), we call this problem multicollinearity. This is not just a theoretical curiosity; it has severe practical consequences, especially for the kind of model interpretation you are interested in for your computational biology work.
Imagine you have a dataset of gene expression data to predict a cancer subtype.
- Perfect Multicollinearity: You include a gene's expression level measured by two different assays, but one assay's output is always exactly 1.5 times the other. This is linear dependence.
- High Multicollinearity: You include the expression levels of two genes that are part of the same regulatory pathway and are almost always co-expressed. Their feature vectors won't be perfectly dependent, but they will be extremely close.
What happens when a model like linear or logistic regression is trained on such data? The following video explains the core problem beautifully.
This video on "Multicollinearity" by Ben Lambert provides a fantastic intuition for why correlated features are a problem for statistical models.
Watch the introduction from the beginning to understand the difference between perfect and high collinearity. Follow the example from this segment, which uses TV and radio advertising spend. It's a great analogy for any two correlated effects, like two genes in the same pathway. Most importantly, watch the explanation of the consequences from here. The key takeaway is that the model finds it hard to disentangle the individual effects of the correlated variables, leading to unstable and unreliable coefficient estimates.
As the video explains, even if your model as a whole is highly predictive (it has a high R-squared), the coefficients for the individual collinear features become unreliable. Their standard errors explode, and you can no longer trust them to interpret the importance of each feature. For your project of differentiating ALL and AML, if two genes are highly correlated, your model might assign a large positive weight to one and a large negative weight to the other. In another training run with slightly different data, these weights could flip. This makes it impossible to draw biological conclusions about which gene is truly important.
Detecting Feature Redundancy in Practice
So, how do we detect this in a real dataset? A primary method is to analyze the rank of the data matrix. We will define rank formally in the next lesson, but for now, you can think of it as the number of linearly independent columns (features).
If a data matrix has p features, but its rank is less than p, it means there is perfect multicollinearity. At least one feature is a perfect linear combination of others. The following article demonstrates this with a practical Python example.
Detecting and Overcoming Perfect Multicollinearity in Large Datasets - MachineLearningMastery.com
This MachineLearningMastery article provides a hands-on guide to finding redundant features using matrix rank.
Read the first section, "Exploring the Impact," which clearly states the connection: if rank < number of features, you have multicollinearity. Work through the Python code in the next section. Read the code that calculates the rank of the Ames Housing dataset and finds it to be less than the number of features. Examine the function find_redundant_features and its output. See how it identifies a set of redundant features. Finally, look at the verification step, where the article proves that one feature, 'GrLivArea', is a direct sum of three other features. This is a perfect, real-world example of linear dependence.
The consequences of multicollinearity are a critical concern in bioinformatics research. When analyzing high-dimensional data like transcriptomics or proteomics, features (genes, proteins) are often highly correlated due to underlying biological pathways. Failing to account for this can lead to incorrect conclusions about which factors are associated with a disease state.

This is precisely the kind of issue you aim to understand. By identifying and handling linear dependence, researchers can build more robust and interpretable models, moving closer to understanding the underlying mechanisms rather than just fitting noise.
Conclusion
In this lesson, we have given a formal structure to the intuitive idea of redundancy. We've seen that linear dependence is not just an abstract concept but a practical problem in data analysis known as multicollinearity, with serious consequences for model stability and interpretability.
Key Takeaways:
- Linear Independence: A set of vectors is linearly independent if no vector in the set can be written as a linear combination of the others. Each vector contributes unique information.
- Linear Dependence: A set of vectors is linearly dependent if at least one vector is redundant—it's already in the span of the others.
- The Formal Test: The equation having a non-trivial (non-zero) solution is the mathematical proof of linear dependence.
- Multicollinearity: In machine learning, linear dependence among features makes it difficult for a model to disentangle their individual effects, leading to unstable coefficients and unreliable interpretations.
We've now talked about the "reach" of a set of vectors (span) and how to check if they're an efficient set of building blocks (linear independence). The next logical step is to formalize the notion of the "dimensionality" of the span. This leads us directly to the concepts of column space and rank, which will allow us to precisely quantify the effective dimensions of our data and the range of possible outputs of our models.