A Computational Framework for Learning from Complex Data: Formulations, Algorithms, and Applications