Skip to content

Commit c6d5ccb

Browse files
authored
Update datasets.py
trying to resolve install mglearn errors, related to deprecated boston housing data. Replacing boston housing requests with california_housing.
1 parent a84f45c commit c6d5ccb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mglearn/datasets.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import pandas as pd
33
import os
44
from scipy import signal
5-
from sklearn.datasets import load_boston
5+
from sklearn.datasets import fetch_california_housing
66
from sklearn.preprocessing import MinMaxScaler, PolynomialFeatures
77
from sklearn.datasets import make_blobs
88

@@ -27,13 +27,13 @@ def make_wave(n_samples=100):
2727
return x.reshape(-1, 1), y
2828

2929

30-
def load_extended_boston():
31-
boston = load_boston()
32-
X = boston.data
30+
def load_extended_california_housing():
31+
california_housing = fetch_california_housing()
32+
X = california_housing.data
3333

34-
X = MinMaxScaler().fit_transform(boston.data)
34+
X = MinMaxScaler().fit_transform(california_housing.data)
3535
X = PolynomialFeatures(degree=2, include_bias=False).fit_transform(X)
36-
return X, boston.target
36+
return X, california_housing.target
3737

3838

3939
def load_citibike():

0 commit comments

Comments
 (0)