preprocess the cotton dataset