Basically you encode the labels with the error correcting fomula. Like the Hamming Code. Just google ecc error correcting code.
Then train. On the test set you can then verify a little that the classification is correct by computing the three parity bits from the data and compare. It should also be possible to correct a classification.
Here I got a data bit error . 4 bits index [0,1,2,4] were data bits. The other 3 were parity bits.
The correct was y_test.