Survival Analysis, Python, Aft, Cox Ph, Machine Learning.
consists of 1: censored and 2: dead; while, sex consist of 1: Male and 2 :Female. We can keep it like that, but I usually prefer the base label for categorical variable as 0 (zero). Thus, to make the base label 0 we need to deduct 1 from the variables. data = data[['time', 'status', 'age', 'sex',