I want to see how strongly each feature relates to the target, not just which ones were selected.
Answer 1: Use the scores_ and pvalues_ attributes
After fitting, SelectKBest stores the score of every feature, including the ones it didn't select. Put them in a DataFrame and sort them for a readable ranking.
import pandas as pd
selector = SelectKBest(f_classif, k="all").fit(X, y)
scores = pd.DataFrame({
"feature": X.columns,
"score": selector.scores_,
"p_value": selector.pvalues_,
}).sort_values("score", ascending=False)
print(scores.head(20))
Using k="all" is a common trick when you only want to inspect scores. It keeps every feature, so nothing is dropped while you explore.
A higher score means a stronger relationship with the target. A small p-value (e.g. < 0.05) means the relationship is unlikely to be due to chance. Keep in mind that with many features, some will have small p-values by pure chance. If that matters to you, see SelectFdr, which corrects for multiple testing.
