I am working on a project to classify lung CT dataset using CNN and tensorflow, I know that the order for the category is cancer/no-cancer (only 2 classes), in more than one Github repository I see that they did one hot encoding like the code below:
if label == 1: label = np.array([0, 1]) elif label == 0: label = np.array([1, 0])
what makes me confused is: 1 means cancer and 0 means no-cancer, as I understand it should be:
if label == 1: label = np.array([1, 0]) elif label == 0: label = np.array([0, 1])
but why they did one hot encoding like this, I don't know I am wrong or there is another thing that I did not understand, can anyone explain it for? or give me a better way to do encoding for my data, but with code?