This question evaluates understanding of binary logistic regression, coefficient-based feature importance, and practical model-fitting considerations such as intercept inclusion and input shape handling.
You are given:
X
: a 2D numeric array where
each row is a feature
and each column is an observation (shape:
n_features x n_samples
).
feature_names
: a list of length
n_features
.
y
: a binary outcome array of length
n_samples
with values in {0, 1}.
Task:
y
from
X
.
|coef|
(break ties by lexicographic order of
feature_names
).
Output: