pre-process for dataset