Efficient Learning by Directed Acyclic Graph for Resource Constrained Prediction