Fixed end index in dataset splitting for preprocessing