Learning from queries for maximum information gain in imperfectly learnable problems