Skip to content

Commit

Permalink
update poetry; rerun all notebooks (#762)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yorko authored Jun 27, 2024
1 parent e780f81 commit a1638e7
Show file tree
Hide file tree
Showing 19 changed files with 2,205 additions and 2,100 deletions.
Empty file modified mlcourse_ai_jupyter_book/CNAME
100644 → 100755
Empty file.
Empty file modified mlcourse_ai_jupyter_book/_config.yml
100644 → 100755
Empty file.
Empty file modified mlcourse_ai_jupyter_book/_toc.yml
100644 → 100755
Empty file.
Binary file modified mlcourse_ai_jupyter_book/book/topic03/topic3_decision_tree1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mlcourse_ai_jupyter_book/book/topic03/topic3_decision_tree2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mlcourse_ai_jupyter_book/book/topic03/topic3_decision_tree3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mlcourse_ai_jupyter_book/book/topic03/topic3_decision_tree4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mlcourse_ai_jupyter_book/book/topic03/topic3_decision_tree5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ plt.scatter(
edgecolor="none",
alpha=0.7,
s=40,
cmap=plt.cm.get_cmap("nipy_spectral", 10),
cmap=plt.get_cmap("nipy_spectral", 10),
)
plt.colorbar()
plt.title("MNIST. PCA projection");
Expand All @@ -253,7 +253,7 @@ plt.scatter(
edgecolor="none",
alpha=0.7,
s=40,
cmap=plt.cm.get_cmap("nipy_spectral", 10),
cmap=plt.get_cmap("nipy_spectral", 10),
)
plt.colorbar()
plt.title("MNIST. t-SNE projection");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ Shell is the main interface for VW.


```{code-cell} ipython3
!vw --help | head
#!vw --help | head
```

Vowpal Wabbit reads data from files or from standard input stream (stdin) with the following format:
Expand Down Expand Up @@ -720,8 +720,8 @@ with open(os.path.join(PATH_TO_WRITE_DATA, "movie_reviews_test.vw"), "w") as vw_


```{code-cell} ipython3
!vw -d $PATH_TO_WRITE_DATA/movie_reviews_train.vw --loss_function hinge \
-f $PATH_TO_WRITE_DATA/movie_reviews_model.vw --quiet
#!vw -d $PATH_TO_WRITE_DATA/movie_reviews_train.vw --loss_function hinge \
#-f $PATH_TO_WRITE_DATA/movie_reviews_model.vw --quiet
```

Next, make the hold-out prediction with the following VW arguments:
Expand All @@ -732,8 +732,8 @@ Next, make the hold-out prediction with the following VW arguments:


```{code-cell} ipython3
!vw -i $PATH_TO_WRITE_DATA/movie_reviews_model.vw -t \
-d $PATH_TO_WRITE_DATA/movie_reviews_valid.vw -p $PATH_TO_WRITE_DATA/movie_valid_pred.txt --quiet
#!vw -i $PATH_TO_WRITE_DATA/movie_reviews_model.vw -t \
#-d $PATH_TO_WRITE_DATA/movie_reviews_valid.vw -p $PATH_TO_WRITE_DATA/movie_valid_pred.txt --quiet
```

Read the predictions from the text file and estimate the accuracy and ROC AUC. Note that VW prints probability estimates of the +1 class. These estimates are distributed from -1 to 1, so we can convert these into binary answers, assuming that positive values belong to class 1.
Expand All @@ -759,9 +759,9 @@ Again, do the same for the test set.


```{code-cell} ipython3
!vw -i $PATH_TO_WRITE_DATA/movie_reviews_model.vw -t \
-d $PATH_TO_WRITE_DATA/movie_reviews_test.vw \
-p $PATH_TO_WRITE_DATA/movie_test_pred.txt --quiet
#!vw -i $PATH_TO_WRITE_DATA/movie_reviews_model.vw -t \
#-d $PATH_TO_WRITE_DATA/movie_reviews_test.vw \
#-p $PATH_TO_WRITE_DATA/movie_test_pred.txt --quiet
```


Expand All @@ -787,14 +787,14 @@ Let's try to achieve a higher accuracy by incorporating bigrams.


```{code-cell} ipython3
!vw -d $PATH_TO_WRITE_DATA/movie_reviews_train.vw \
--loss_function hinge --ngram 2 -f $PATH_TO_WRITE_DATA/movie_reviews_model2.vw --quiet
#!vw -d $PATH_TO_WRITE_DATA/movie_reviews_train.vw \
# --loss_function hinge --ngram 2 -f $PATH_TO_WRITE_DATA/movie_reviews_model2.vw --quiet
```


```{code-cell} ipython3
!vw -i$PATH_TO_WRITE_DATA/movie_reviews_model2.vw -t -d $PATH_TO_WRITE_DATA/movie_reviews_valid.vw \
-p $PATH_TO_WRITE_DATA/movie_valid_pred2.txt --quiet
#!vw -i$PATH_TO_WRITE_DATA/movie_reviews_model2.vw -t -d $PATH_TO_WRITE_DATA/movie_reviews_valid.vw \
#-p $PATH_TO_WRITE_DATA/movie_valid_pred2.txt --quiet
```


Expand All @@ -817,8 +817,8 @@ print("AUC: {}".format(round(roc_auc_score(valid_labels, valid_prediction), 3)))


```{code-cell} ipython3
!vw -i $PATH_TO_WRITE_DATA/movie_reviews_model2.vw -t -d $PATH_TO_WRITE_DATA/movie_reviews_test.vw \
-p $PATH_TO_WRITE_DATA/movie_test_pred2.txt --quiet
#!vw -i $PATH_TO_WRITE_DATA/movie_reviews_model2.vw -t -d $PATH_TO_WRITE_DATA/movie_reviews_test.vw \
#-p $PATH_TO_WRITE_DATA/movie_test_pred2.txt --quiet
```


Expand Down Expand Up @@ -857,5 +857,4 @@ This section has been moved to Kaggle, please explore [this Notebook](https://ww
- ["Convex Optimization" by Stephen Boyd](https://www.amazon.com/Convex-Optimization-Stephen-Boyd/dp/0521833787)
- "Command-line Tools can be 235x Faster than your Hadoop Cluster" [post](https://adamdrake.com/command-line-tools-can-be-235x-faster-than-your-hadoop-cluster.html)
- Benchmarking various ML algorithms on Criteo 1TB dataset on [GitHub](https://github.com/rambler-digital-solutions/criteo-1tb-benchmark)
- [VW on FastML.com](http://fastml.com/blog/categories/vw/)
q
- [VW on FastML.com](http://fastml.com/blog/categories/vw/)
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ df.date = pd.to_datetime(df.date)


```{code-cell} ipython3
plotly_df(df.set_index("date")[["count"]])
plotly_df(df=df.set_index("date")[["count"]], title="assign9_plot")
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ df.date = pd.to_datetime(df.date)


```{code-cell} ipython3
plotly_df(df.set_index("date")[["count"]])
plotly_df(df=df.set_index("date")[["count"]], title="assign9_plot")
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def plotExponentialSmoothing(series, alphas):
alphas - list of floats, smoothing parameters
"""
with plt.style.context("seaborn-white"):
with plt.style.context("bmh"):
plt.figure(figsize=(15, 7))
for alpha in alphas:
plt.plot(
Expand Down Expand Up @@ -437,7 +437,7 @@ def plotDoubleExponentialSmoothing(series, alphas, betas):
betas - list of floats, smoothing parameters for trend
"""
with plt.style.context("seaborn-white"):
with plt.style.context("bmh"):
plt.figure(figsize=(20, 8))
for alpha in alphas:
for beta in betas:
Expand Down
Empty file modified mlcourse_ai_jupyter_book/prerequisites.html
100644 → 100755
Empty file.
Empty file modified mlcourse_ai_jupyter_book/rating.html
100644 → 100755
Empty file.
Empty file modified mlcourse_ai_jupyter_book/roadmap.html
100644 → 100755
Empty file.
Empty file modified mlcourse_ai_jupyter_book/tutorials.html
100644 → 100755
Empty file.
Loading

0 comments on commit a1638e7

Please sign in to comment.