Efficient Learning by Directed Acyclic Graph For Resource Constrained Prediction