I think there is a typo in the test function.
In the test function, "data", "lifetime", and "censor" must be created using test data.
However, in this code, "censor" is created as Y_train data (lines 162 and 166).
So,there is an error that "idx", defined at Train function for random.permutation, is not defined in Test function.
I think there is a typo in the test function. In the test function, "data", "lifetime", and "censor" must be created using test data. However, in this code, "censor" is created as Y_train data (lines 162 and 166). So,there is an error that "idx", defined at Train function for random.permutation, is not defined in Test function.