In this particular unit test, the test data has 2 rows, where one of them has TRMT as true and the other as TRMT as false. What you are doing is, first getting the row where TRMT is true, and setting it to false. Then you are using that particular row to calculate base risk.
You are using DataFrame’s at function, which only gets you one row, but you need to get both rows so that the base risk can be calculated for both rows, check out the loc function instead.
Lab ID: eappwyhbnstd
Why are there two TRTMT columns in Test Case 1? Why are the values of the Test Case TRTMT column mixed type? Why is the TRTMT column type of X_dev “bool”, but the TRTMT column type of X “object”?
Going by the question, any method that forces all TRTMT values to False should solve this, but that’s not the case. Why does no assertion of zero values pass the “base_risks_test”? Even forcing the coefficient to zero fails.
I had a slightlly different problem. It was that of two rows, but I picked up only one, which is a more realistic problem to have than yours!
Your problem seems to be a dataframe with two columns named the same. I am not quite sure why that is so, but if genuine dupes, it seems like a good case for preprocessing actually, both on training and test.
As for mixed types this should be fixed in preprocessing as well. Looks like an inconsistency more than an error since True is 1 and False is 0. But needs to be fixed nevertheless.
@Mubsi can anyone who can access Gerald’s lab snd the original lab design look into this. I cant really make out if this was by design or inadvertent.
Thanks Jaidev. I agree with your analysis. Do you see any way for me to complete the lab in its current state? Is there anyone else I should reach out to for support?