refactor transformation of data into its own function
refactor svmdigit to use transform_image_data