My c_statistic function works correctly out of UNQ_C8.
But when run against the test data there is an exception thrown. That is in this cell…
tmp_cstat_test = c_statistic(rr_lr, y_test, X_test.TRTMT)
print(f"Logistic Regression evaluated by C-for-Benefit: {tmp_cstat_test:.4f}")
Debugging the above, here is what I find…
For some strange reason the y_test shape is (152,) as is the X_test.TRTMT shape also (152,) which is correct. But I can return values of only y_test[2] and X_test.TRTMT[2]. All others such as y_test[0] and X_test.TRTMT[0] throw an exception.