Should a p-Value Choose My Features?

By

There is a doubt I have always had, and I often discuss it with my colleagues: can we use the p-value of a t-test or an ANOVA to decide which features to give to a classifier?

It is a very common habit. We compare patients and healthy controls, for example on the thickness of hundreds of brain regions, keep only the regions with p < 0.05, and then train the model on those.

My first worry is when we do it. If the test runs on all the patients, including those we will later use to check the model, we are peeking. I tried it on random numbers, and the model looked perfect.

Simulation with random brain measures and random diagnoses: choosing measures by peeking at all patients gives a 100% score, choosing them without peeking gives 49%, like a coin toss.

My second worry is what the p-value tells us. It says whether two groups differ on average, not whether a measure helps to recognise a single patient. In a large cohort, a tiny difference can be “significant” and still useless for diagnosis. And a region that is not significant on its own can become useful together with others.

The pill: a p-value answers a different question. If we use it to choose features, let it look only at the patients used to build the model, and never confuse “significant” with “predictive”.

I am still not completely at peace with this habit. How do you choose your features?

Comments

Leave a Reply