for leaf_size in candidate_max_leaf_nodes:
my_mae = get_mae(leaf_size , train_X, val_X, train_y, val_y)
scores[leaf_size]=my_mae
#下面一樣功能
scores = {leaf_size: get_mae(leaf_size, train_X, val_X, train_y, val_y) for leaf_size in candidate_max_leaf_nodes}
print([scores.get(i) for i in candidate_max_leaf_nodes])
print(scores)
best_tree_size =min(scores , key=scores.get)
print(best_tree_size)