ボストン住宅価格データ
sklearnにはdatasetもついているのかーtakker.icon
データの説明
table:captions
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
MEDV Median value of owner-occupied homes in $1000's
code:sh
といっても、boston.pyという名前のファイルは他になかったはずなんだけど……
原因がわからん
例えば、一旦pandasに読み込ませてみる
説明変数をPRICEという名前で追加している
code:script.py
from sklearn.datasets import load_boston
import pandas as pd
def boston_data():
data = load_boston()
df = pd.DataFrame(data.data, columns=data.feature_names)
return df