Efficient and effective quantum compiling for entanglement-based machine learning on IBM Q devices