max_leaf_nodes has precedence over max_depth if the former is not None.