Skip to content

Commit

Permalink
df.as_matrix has been deprecated since 0.23.0
Browse files Browse the repository at this point in the history
  • Loading branch information
miku committed Aug 28, 2018
1 parent d8d8660 commit 68182ad
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions mlfromscratch/examples/bayesian_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def main():
# Load temperature data
data = pd.read_csv('mlfromscratch/data/TempLinkoping2016.txt', sep="\t")

time = np.atleast_2d(data["time"].as_matrix()).T
temp = np.atleast_2d(data["temp"].as_matrix()).T
time = np.atleast_2d(data["time"].values).T
temp = np.atleast_2d(data["temp"].values).T

X = time # fraction of the year [0, 1]
y = temp
Expand Down
4 changes: 2 additions & 2 deletions mlfromscratch/examples/decision_tree_regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def main():
# Load temperature data
data = pd.read_csv('mlfromscratch/data/TempLinkoping2016.txt', sep="\t")

time = np.atleast_2d(data["time"].as_matrix()).T
temp = np.atleast_2d(data["temp"].as_matrix()).T
time = np.atleast_2d(data["time"].values).T
temp = np.atleast_2d(data["temp"].values).T

X = standardize(time) # Time. Fraction of the year [0, 1]
y = temp[:, 0] # Temperature. Reduce to one-dim
Expand Down
4 changes: 2 additions & 2 deletions mlfromscratch/examples/elastic_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def main():
# Load temperature data
data = pd.read_csv('mlfromscratch/data/TempLinkoping2016.txt', sep="\t")

time = np.atleast_2d(data["time"].as_matrix()).T
temp = data["temp"].as_matrix()
time = np.atleast_2d(data["time"].values).T
temp = data["temp"].values

X = time # fraction of the year [0, 1]
y = temp
Expand Down
4 changes: 2 additions & 2 deletions mlfromscratch/examples/gradient_boosting_regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def main():
# Load temperature data
data = pd.read_csv('mlfromscratch/data/TempLinkoping2016.txt', sep="\t")

time = np.atleast_2d(data["time"].as_matrix()).T
temp = np.atleast_2d(data["temp"].as_matrix()).T
time = np.atleast_2d(data["time"].values).T
temp = np.atleast_2d(data["temp"].values).T

X = time.reshape((-1, 1)) # Time. Fraction of the year [0, 1]
X = np.insert(X, 0, values=1, axis=1) # Insert bias term
Expand Down
4 changes: 2 additions & 2 deletions mlfromscratch/examples/lasso_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def main():
# Load temperature data
data = pd.read_csv('mlfromscratch/data/TempLinkoping2016.txt', sep="\t")

time = np.atleast_2d(data["time"].as_matrix()).T
temp = data["temp"].as_matrix()
time = np.atleast_2d(data["time"].values).T
temp = data["temp"].values

X = time # fraction of the year [0, 1]
y = temp
Expand Down
4 changes: 2 additions & 2 deletions mlfromscratch/examples/polynomial_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def main():
# Load temperature data
data = pd.read_csv('mlfromscratch/data/TempLinkoping2016.txt', sep="\t")

time = np.atleast_2d(data["time"].as_matrix()).T
temp = data["temp"].as_matrix()
time = np.atleast_2d(data["time"].values).T
temp = data["temp"].values

X = time # fraction of the year [0, 1]
y = temp
Expand Down
4 changes: 2 additions & 2 deletions mlfromscratch/examples/ridge_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def main():
# Load temperature data
data = pd.read_csv('mlfromscratch/data/TempLinkoping2016.txt', sep="\t")

time = np.atleast_2d(data["time"].as_matrix()).T
temp = data["temp"].as_matrix()
time = np.atleast_2d(data["time"].values).T
temp = data["temp"].values

X = time # fraction of the year [0, 1]
y = temp
Expand Down

0 comments on commit 68182ad

Please sign in to comment.