0
在下面的代码中,“net_worths”,“predictions”是用于找出平方误差的两个numpy数组,即“错误”,然后将参数压缩到新变量cleared_data中。在列表中使用限制
cleaned_data = []
### code goes here
errors = (net_worths - predictions)**2
cleaned_data = zip(ages, net_worths, errors)
cleaned_data = sorted(cleaned_data, key=lambda x: x[2], reverse=True)
limit = int(len(ages) * 0.1
return list(cleaned_data[limit:])
但是我很难理解下面的3行,谁能请帮忙。
cleaned_data = sorted(cleaned_data, key=lambda x: x[2], reverse=True)
limit = int(len(ages) * 0.1
return list(cleaned_data[limit:])