unction load_boston is deprecated; `load_boston` is deprecated in 1.0 and will be removed in 1.2. The Boston housing prices dataset has an ethical problem. You can refer to the documentation of this function for further details. The scikit-learn maintainers therefore strongly discourage the use of this dataset unless the purpose of the code is to study and educate about ethical issues in data science and machine learning. In this special case, you can fetch the dataset from the original source:: import pandas as pd import numpy as np data_url = "http://lib.stat.cmu.edu/datasets/boston" raw_df = pd.read_csv(data_url, sep="\s+", skiprows=22, header=None) data = np.hstack([raw_df.values[::2, :], raw_df.values[1::2, :2]]) target = raw_df.values[1::2, 2] Alternative datasets include the California housing dataset (i.e. :func:`~sklearn.datasets.fetch_california_housing`) and the Ames housing dataset. You can load the datasets as follows:: from sklearn.datasets import fetch_california_housing housing = fetch_california_housing() for the California housing dataset and:: from sklearn.datasets import fetch_openml housing = fetch_openml(name="house_prices", as_frame=True) for the Ames housing dataset. warnings.warn(msg, category=FutureWarning) 线性回归模型的RMSE: 4.928602182665355 决策树回归模型的RMSE: 3.2273949915330395 随机森林回归模型的RMSE: 2.8109631609391226
时间: 2023-06-26 08:09:40 浏览: 237
Simple-unction-optimization.rar_遗传算法 _遗传算法 matlab
这段提示信息的意思是,函数load_boston已经被弃用了,在1.0版本中已经弃用,在1.2版本中将被删除。波士顿房价数据集存在伦理问题,因此强烈不建议在非研究和教育伦理问题的情况下使用该数据集。如果要研究和教育有关伦理问题的数据科学和机器学习,可以从原始来源获取数据集。此外,还提供了替代数据集,包括加利福尼亚房屋数据集和埃姆斯房屋数据集。最后,给出了三种模型的RMSE值。
阅读全文