add rank_limit option to prune tree at different rank levels