tensorFlow 读取csv文件
哈里森和鲁宾菲尔德于 1978 年收集的波士顿房价数据集该数据集包括 506 个样本场景,每个房屋含 14 个特征
Variables 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 value of owner-occupied homes in $1000’s
房屋含 14 个特征
- CRIM:城镇人均犯罪率
- ZN:占地 25000 平方英尺(1 英尺=0.3048 米)以上的住宅用地比例
- INDUS:每个城镇的非零售商业用地比例
- CHAS:查尔斯河(Charles River)变量(若土地位于河流边界,则为 1;否则为 0)
- NOX:一氧化氮浓度(每千万)
- RM:每个寓所的平均房间数量
- AGE:1940 年以前建成的自住单元比例
- DIS:到 5 个波士顿就业中心的加权距离
- RAD:径向高速公路可达性指数
- TAX:每万美元的全价值物业税税率
- PTRATIO:镇小学老师比例
- B:1000(Bk-0.63)2,其中 Bk 是城镇黑人的比例
- LSTAT:低地位人口的百分比
- MEDV:1000 美元自有住房的中位值
代码
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 18 16:30:52 2020
@author: Administrator
"""
import tensorflow.compat.v1 as