User-guided machine learning for generating abstractions