# UNQ_C10 estimator_score error id # UNQ_C11 block

I use
estimator_score = c_statistic(preds, y_val_hp, X_val_hp.TRTMT)
But in was call from UNQ_C11 without TRTMT
I have error AttributeError: ‘DataFrame’ object has no attribute ‘TRTMT’
But test # UNQ_C10 was pass

Hi @Mikolay_Kostiuk ,

The error message said no attribution of ‘TRTMT’.
So first, can you check if the TRTMT column exists in X_val_hp?

Hope it may help you,
Nakamura

Hi , Mikolay_Kostiuk

The function c_statistic is used to calculate the statistic c, which is a measure of the accuracy of a binary classifier. The function takes three arguments: predicted labels, true labels and the processing variable.

In your code, predicted_labels and true_labels are passed correctly. However, the processing_variable is not transmitted correctly. The processing variable is the variable that the classifier is trying to predict. In this case, the processing variable is TRTMT.

The X_val_hp DataFrame was created in the UNQ_C10 test, which did not include the TRTMT column. This is why the c_statistic function fails with an AttributeError message: ‘DataFrame’ object has no attribute ‘TRTMT’.

To correct this error, be sure to check: column TRTMT in DataFrame X_val_hp.


In function was remove TRTMT column for treatment_dataset_split
May be error deep

Hello,

I am having the same problem. The processing variable is the column 'TRTMT'. In C10, I have: 

estimator_score = c_statistic(preds, y_val_hp, X_val_hp[‘TRTMT’])

The TRTMT column was removed in C11 (treatment_dataset_split). Further in the lab, we call holdout_grid_search in C10, however we need that ‘TRTMT’ column which was removed.

Just found my mistake, I was not using the correct function!