Skip to content

Commit 9a85cc8

Browse files
author
Yury Kashnitsky
committed
resolve dependencies; re-run topic 9 notebooks
1 parent fd89891 commit 9a85cc8

File tree

7 files changed

+830
-175
lines changed

7 files changed

+830
-175
lines changed

jupyter_english/topic09_time_series/topic9_part1_time_series_python.ipynb

Lines changed: 771 additions & 124 deletions
Large diffs are not rendered by default.

mlcourse_ai_jupyter_book/book/topic09/assignment09_time_series.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ DATA_PATH = "https://raw.githubusercontent.com/Yorko/mlcourse.ai/main/data/"
7777
df = pd.read_csv(DATA_PATH + "wiki_machine_learning.csv", sep=" ")
7878
df = df[df["count"] != 0]
7979
df.head()
80+
8081
```
8182

8283

mlcourse_ai_jupyter_book/book/topic09/assignment09_time_series_solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ train_df = df[:-predictions].copy()
119119

120120
```{code-cell} ipython3
121121
m = Prophet()
122-
m.fit(train_df);
122+
m.fit(train_df)
123123
```
124124

125125

mlcourse_ai_jupyter_book/book/topic09/topic9_part1_time_series_python.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ currency = pd.read_csv(
8787
```
8888

8989
```{code-cell} ipython3
90-
plt.figure(figsize=(12, 6))
90+
plt.figure(figsize=(12, 8))
9191
plt.plot(ads.Ads)
9292
plt.title("Ads watched (hourly data)")
9393
plt.grid(True)
@@ -1099,7 +1099,6 @@ def plotSARIMA(series, model, n_steps):
10991099
11001100
# forecasting on n_steps forward
11011101
forecast = model.predict(start=data.shape[0], end=data.shape[0] + n_steps)
1102-
forecast = data.arima_model.append(forecast)
11031102
# calculate error, again having shifted on s+d steps from the beginning
11041103
error = mean_absolute_percentage_error(
11051104
data["actual"][s + d :], data["arima_model"][s + d :]
@@ -1530,7 +1529,7 @@ plotModelResults(
15301529
X_train=X_train_scaled,
15311530
X_test=X_test_scaled,
15321531
plot_intervals=True,
1533-
plot_anomalies=True,
1532+
plot_anomalies=True
15341533
)
15351534
```
15361535

mlcourse_ai_jupyter_book/book/topic09/topic9_part2_facebook_prophet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ Let's sort the dataframe by time and take a look at what we've got:
216216

217217

218218
```{code-cell} ipython3
219-
df.sort_values(by=["published"]).head(n=3)
219+
df.sort_values(by=["published"]).head(n=2)
220220
```
221221

222222
Medium's public release date was August 15, 2012. But, as you can see from the data above, there are at least several rows with much earlier publication dates. They have somehow turned up in our dataset, but they are hardly legitimate ones. We will just trim our time series to keep only those rows that fall onto the period from August 15, 2012 to June 25, 2017:

poetry.lock

Lines changed: 52 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ pydotplus = "^2.0.2"
2323
pytesseract = "^0.3.10"
2424
reverse-geocoder = "^1.5.1"
2525
seaborn = "^0.13.2"
26-
scikit-learn = "^1.6.0"
26+
scikit-learn = "1.5.2"
2727
scipy = "^1.15.0"
2828
statsmodels = "^0.14.4"
2929
ua-parser = "^0.16.1"
3030
user_agents = "^2.2.0"
3131
wordcloud = "^1.9.1"
32-
xgboost = "^2.1.3"
32+
xgboost = "2.1.0"
3333

3434
[tool.poetry.dev-dependencies]
3535
black = {version = "^21.12b0", allow-prereleases = true}

0 commit comments

Comments
 (0)