3. 机器学习之实战 之 线性回归处理波士顿房价问题

阅读: 评论:0

3. 机器学习之实战 之 线性回归处理波士顿房价问题

3. 机器学习之实战 之 线性回归处理波士顿房价问题

波士顿房价问题

波士顿的房价为什么那么贵呢? 可以用什么方法预测房价呢? 这里的波士顿房价显然是连续变量,所以这个问题我们可以用回归来尝试解决。

今天我们就从最简单的线性回归来入门吧

数据加载与模型训练

波士顿房价的数据源Kaggle上也是免费开放的,Python的sklearn 数据集也可以直接load

from sklearn.datasets import load_boston
boston_dataset = load_boston()

我们一起来看一下这个数据集

print(boston_dataset.keys())
dict_keys(['data', 'target', 'feature_names', 'DESCR', 'filename'])print(boston_dataset.DESCR)
. _boston_dataset:Boston house prices dataset
---------------------------**Data Set Characteristics:**  :Number of Instances: 506 :Number of Attributes: 13 numeric/categorical predictive. Median Value (attribute 14) is usually the target.:Attribute Information (in order):- CRIM     per capita crime rate by town- ZN       proportion of residential land zoned for lots over 25,000 sq.ft.- INDUS    proportion of non-retail business acres per town- CHAS     Charles River dummy variable (= 1 if tract bounds river; 0 otherwise)- NOX      nitric oxides concentration (parts per 10 million)- RM       average number of rooms per dwelling- AGE      proportion of owner-occupied units built prior to 1940- DIS      weighted distances to five Boston employment centres- RAD      index of accessibility to radial highways- TAX      full-value property-tax rate per $10,000- PTRATIO  pupil-teacher ratio by town- B        1000(Bk - 0.63)^2 where Bk is the proportion of blacks by town- LSTAT    % lower status of the population- MEDV     Median valu

本文发布于:2024-02-02 03:46:44,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170681741741160.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:波士顿   线性   实战   房价   机器
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23