[英]What is the cause of this error and how to solve it? ValueError: all features must be in [0, 79] or [-80, 0]
我正在尝试研究 house-prices-advanced-regression-techniques 数据集,这是我的笔记本链接https://www.kaggle.com/code/azzeineaftiss/notebook599600c1d0 ,我的代码 kernel:
代码输出此错误:ValueError: all features must be in [0, 79] or [-80, 0]。
请问有什么帮助吗???
正如@mozway 建议的那样,请尽量减少您的问题并自给自足。 查看您的笔记本,您似乎将train
与train_x
混淆了。 首先,您定义了独立和依赖:
train_x = train.drop(columns = "SalePrice")
train_y = train["SalePrice"]
您从train
中获取列名,其中实际上包含目标变量。 如果您运行以下命令, "SalePrice"
列将是您的数字列之一:
train_dtypes = train.apply(lambda x: get_data_type(x)).reset_index()
numerical_columns = train_dtypes[train_dtypes[0] == "numerical"]["index"].index.tolist()
我的建议是检查您的数字列是否与 go 匹配到最终的 gridSearchCV 中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.