Sampling of instances implemented in preprocessing.py