A charity shortlists volunteers with a simple scoring model. Each row of X is one volunteer, and each column is something measured about them, such as hours free per week or years of experience.
The columns use very different units, so the features are put on the same scale first.
.std()). Work these out from X itself.weights, all added up, plus bias. weights holds one number per column.threshold. Compare the unrounded score.Task: write fair_scores(X, weights, bias, threshold) and return a dict:
"scores" — every volunteer's score, in row order, rounded to 3 decimal places,"shortlisted" — how many volunteers were shortlisted.There are at least two volunteers, and no column has a spread of 0.