From 181ddd530e8b207c4131f2fb2df0f6bfd069eabe Mon Sep 17 00:00:00 2001 From: Burton DeWilde Date: Sat, 21 Dec 2024 15:30:33 -0500 Subject: [PATCH] Lowercase colname before features table lookup --- src/student_success_tool/modeling/inference.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/student_success_tool/modeling/inference.py b/src/student_success_tool/modeling/inference.py index ce1d8b87..a3a2698c 100644 --- a/src/student_success_tool/modeling/inference.py +++ b/src/student_success_tool/modeling/inference.py @@ -46,7 +46,10 @@ def select_top_features_for_display( zip(top_features, top_feature_values, top_shap_values), start=1 ): feature_name = ( - features_table.get(feature, {}).get("name", feature) + # HACK: lowercase feature column name in features table lookup + # TODO: we should *ensure* feature column names are lowercased + # before using them in a model; current behavior should be considered a bug + features_table.get(feature.lower(), {}).get("name", feature) if features_table is not None else feature )