HAMLET: A Hierarchical Agent-based Machine Learning Platform