Learning with tree-based tensor formats