NelworksNelworks

ML & AI / Season 2 / EP07

Feature Selection vs Causal Inference: Proxy Variables and Collider Bias

Shez

I've solved it, Kurumi! I know why the *Nebula Orchids* are dying!

Kurumi

Let me guess. You fed the sensor data into a model?

Shez

I used **Lasso Regression**. It zeroed out all the noise and left me with the one true killer.

Shez

The feature 'leaf_color_yellow' has the highest coefficient!

Shez

The model says 'Yellow Leaves' predict death with 99% accuracy.

Shez

So, if I paint the leaves green, the plants will live! Causal intervention!

Kurumi

Shez. Put the paint down.

Shez

But the data says—

Kurumi

The data says *correlation*. You are about to commit a war crime against botany.

Kurumi

You used **Feature Selection**. You asked the model: 'What helps you *guess* the outcome?'

Shez

Right. And if it helps guess, it must be important!

Kurumi

In reality, the Fungus causes the Yellow Leaves. The Fungus *also* causes Death.

Kurumi

Yellow Leaves are a **Proxy** (or a Mediator). They are a symptom.

Kurumi

But to your Lasso model, the 'Yellow Leaf' signal is super clear. It's easy to measure.

Kurumi

The 'Fungus' is hard to measure (it's underground). It's noisy.

Kurumi

So Lasso says: 'I don't need the Fungus variable. Yellow Leaves give me all the info I need.'

Kurumi

It drops the Cause and keeps the Symptom.

Shez

But... if I get rid of the yellow, doesn't it fix it?

Kurumi

No, you walnut.

Kurumi

Your model finds that 'Loud Beeping' is the #1 predictor of 'House Burning.'

Kurumi

So your solution is to cut the wires to the alarm.

Shez

Ideally, the fire should stop now.

Kurumi

The fire does not care about your regression coefficients.

Shez

Okay. So 'Yellow Leaves' is a proxy.

Shez

But what about this other feature? 'High Soil Moisture.' That's a cause, right?

Kurumi

Ah. Now we enter the **Collider Trap**.

Shez

Is that a wrestling move?

Kurumi

Two things cause wet soil. The Sprinkler. Or the Rain.

Kurumi

Your dataset has a **Selection Bias**. You only collect data when the sensors trigger 'Wet Soil' (because dry soil is boring).

Kurumi

You have 'Conditioned on a Collider.'

Kurumi

If the Soil is Wet, and I tell you 'It didn't Rain'... what do you know about the Sprinkler?

Shez

The sprinkler must be ON.

Kurumi

Exactly. By looking only at Wet Soil, you created a fake correlation between Rain and Sprinklers.

Kurumi

Your model thinks: 'Rain prevents Sprinklers.'

Shez

But modern Sprinklers *do* turn off when it rains!

Kurumi

Not these ones! These are dumb timers!

Kurumi

But the *data* makes them look smart because of how you filtered it.

Kurumi

Feature Selection is blind to structure.

Kurumi

It grabs whatever correlation exists in the filtered slice of reality you gave it.

Kurumi

It doesn't know if the link is causal, reverse-causal, or completely imaginary.

Shez

So... Lasso is useless? RFE is a lie?

Kurumi

No. They are for **Passive Prediction**.

Kurumi

If you just want to *bet* on the stock market or predict crop yield, use Lasso.

Kurumi

If you see Yellow Leaves, bet 'Short.' You will make money.

Kurumi

You don't need to know *why* it's dying to profit from its death.

Kurumi

But if you want to **Intervene**, EG: if you want to *cure* the patient or save the crop, you need **Causality**.

Kurumi

You need to know 'P(Y | do(X))'.

Shez

How do I find the cause then? The model won't tell me.

Kurumi

You have to tell the model.

Shez

Me?

Kurumi

Draw the **DAG** (Directed Acyclic Graph).

Kurumi

Use your biology knowledge. Does Fungus cause Yellow Leaves? Or do Yellow Leaves cause Fungus?

Shez

Fungus causes Yellow Leaves.

Kurumi

Good. Now force the model to keep 'Fungus' and ignore 'Yellow Leaves' if you want to test a fungicide.

Kurumi

Use **Instrumental Variables** or **Propensity Matching**.

Kurumi

Do not just run '.fit(X, y)' and pray.

Shez

Painting the leaves green was... pretty stupid, huh?

Kurumi

It was a data-driven decision that is stupid when applied to real world context.

Kurumi

Now, if you want to save these orchids, stop looking at the feature importance chart.

Kurumi

Dig up the roots. Look for the rot.

Shez

Hey, Kurumi?

Kurumi

Yeah?

Shez

'Root_Rot' wasn't even in my dataset. The sensor is only above ground.

Kurumi

That is the **Omitted Variable Bias**.

Kurumi

The most important feature is usually the one you forgot to measure.

Shez

So what now?

Kurumi

Recognize most researchers were in the same place as you before. Now correct the silly mistake, I'm going to check out the flower on the other greenhouse.