加上这两行代码: all_features = all_features.dropna() # 删除包含 NaN 值的行 all_features = all_features.astype(float) # 将所有数据转换为浮点数