Training an open quantum classifier