Skip to content

Commit 027189f

Browse files
committed
moved to SageMaker distribution kernel
1 parent 4324867 commit 027189f

18 files changed

+5368
-3718
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/.ipynb_checkpoints/
2+
.DS_Store
3+
**/__pycache__/

notebooks/MLA-NLP-Lecture1-BOW.ipynb

Lines changed: 52 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
{
2525
"cell_type": "code",
2626
"execution_count": 1,
27-
"metadata": {},
27+
"metadata": {
28+
"tags": []
29+
},
2830
"outputs": [
2931
{
3032
"data": {
@@ -53,7 +55,7 @@
5355
" "
5456
],
5557
"text/plain": [
56-
"<mluvisuals.BagOfWords at 0x7fdca12c4910>"
58+
"<mluvisuals.BagOfWords at 0x7f39e56dbf10>"
5759
]
5860
},
5961
"execution_count": 1,
@@ -79,23 +81,6 @@
7981
"4. <a href=\"#4\">Term Frequency-Inverse Document Frequencies</a>\n"
8082
]
8183
},
82-
{
83-
"cell_type": "code",
84-
"execution_count": 1,
85-
"metadata": {},
86-
"outputs": [
87-
{
88-
"name": "stdout",
89-
"output_type": "stream",
90-
"text": [
91-
"Note: you may need to restart the kernel to use updated packages.\n"
92-
]
93-
}
94-
],
95-
"source": [
96-
"%pip install -q -r ../requirements.txt"
97-
]
98-
},
9984
{
10085
"cell_type": "markdown",
10186
"metadata": {},
@@ -109,7 +94,9 @@
10994
{
11095
"cell_type": "code",
11196
"execution_count": 2,
112-
"metadata": {},
97+
"metadata": {
98+
"tags": []
99+
},
113100
"outputs": [],
114101
"source": [
115102
"from sklearn.feature_extraction.text import CountVectorizer\n",
@@ -135,7 +122,9 @@
135122
{
136123
"cell_type": "code",
137124
"execution_count": 3,
138-
"metadata": {},
125+
"metadata": {
126+
"tags": []
127+
},
139128
"outputs": [
140129
{
141130
"data": {
@@ -164,7 +153,9 @@
164153
{
165154
"cell_type": "code",
166155
"execution_count": 4,
167-
"metadata": {},
156+
"metadata": {
157+
"tags": []
158+
},
168159
"outputs": [
169160
{
170161
"data": {
@@ -199,26 +190,20 @@
199190
{
200191
"cell_type": "code",
201192
"execution_count": 5,
202-
"metadata": {},
193+
"metadata": {
194+
"tags": []
195+
},
203196
"outputs": [
204197
{
205198
"name": "stdout",
206199
"output_type": "stream",
207200
"text": [
208-
"['and', 'document', 'first', 'is', 'one', 'second', 'the', 'third', 'this']\n"
209-
]
210-
},
211-
{
212-
"name": "stderr",
213-
"output_type": "stream",
214-
"text": [
215-
"/home/ec2-user/anaconda3/envs/pytorch_p39/lib/python3.9/site-packages/sklearn/utils/deprecation.py:87: FutureWarning: Function get_feature_names is deprecated; get_feature_names is deprecated in 1.0 and will be removed in 1.2. Please use get_feature_names_out instead.\n",
216-
" warnings.warn(msg, category=FutureWarning)\n"
201+
"['and' 'document' 'first' 'is' 'one' 'second' 'the' 'third' 'this']\n"
217202
]
218203
}
219204
],
220205
"source": [
221-
"print(binary_vectorizer.get_feature_names())"
206+
"print(binary_vectorizer.get_feature_names_out())"
222207
]
223208
},
224209
{
@@ -231,7 +216,9 @@
231216
{
232217
"cell_type": "code",
233218
"execution_count": 6,
234-
"metadata": {},
219+
"metadata": {
220+
"tags": []
221+
},
235222
"outputs": [],
236223
"source": [
237224
"new_sentence = [\"This is the new sentence\"]\n",
@@ -242,7 +229,9 @@
242229
{
243230
"cell_type": "code",
244231
"execution_count": 7,
245-
"metadata": {},
232+
"metadata": {
233+
"tags": []
234+
},
246235
"outputs": [
247236
{
248237
"data": {
@@ -273,7 +262,9 @@
273262
{
274263
"cell_type": "code",
275264
"execution_count": 8,
276-
"metadata": {},
265+
"metadata": {
266+
"tags": []
267+
},
277268
"outputs": [
278269
{
279270
"data": {
@@ -304,7 +295,9 @@
304295
{
305296
"cell_type": "code",
306297
"execution_count": 9,
307-
"metadata": {},
298+
"metadata": {
299+
"tags": []
300+
},
308301
"outputs": [
309302
{
310303
"data": {
@@ -340,7 +333,9 @@
340333
{
341334
"cell_type": "code",
342335
"execution_count": 10,
343-
"metadata": {},
336+
"metadata": {
337+
"tags": []
338+
},
344339
"outputs": [
345340
{
346341
"data": {
@@ -371,7 +366,9 @@
371366
{
372367
"cell_type": "code",
373368
"execution_count": 11,
374-
"metadata": {},
369+
"metadata": {
370+
"tags": []
371+
},
375372
"outputs": [
376373
{
377374
"data": {
@@ -404,7 +401,9 @@
404401
{
405402
"cell_type": "code",
406403
"execution_count": 12,
407-
"metadata": {},
404+
"metadata": {
405+
"tags": []
406+
},
408407
"outputs": [
409408
{
410409
"data": {
@@ -439,7 +438,9 @@
439438
{
440439
"cell_type": "code",
441440
"execution_count": 13,
442-
"metadata": {},
441+
"metadata": {
442+
"tags": []
443+
},
443444
"outputs": [
444445
{
445446
"data": {
@@ -471,7 +472,9 @@
471472
{
472473
"cell_type": "code",
473474
"execution_count": 14,
474-
"metadata": {},
475+
"metadata": {
476+
"tags": []
477+
},
475478
"outputs": [
476479
{
477480
"data": {
@@ -492,7 +495,9 @@
492495
{
493496
"cell_type": "code",
494497
"execution_count": 15,
495-
"metadata": {},
498+
"metadata": {
499+
"tags": []
500+
},
496501
"outputs": [
497502
{
498503
"data": {
@@ -525,9 +530,9 @@
525530
],
526531
"metadata": {
527532
"kernelspec": {
528-
"display_name": "Python [conda env:conda_pytorch_p39] *",
533+
"display_name": "sagemaker-distribution:Python",
529534
"language": "python",
530-
"name": "conda-env-conda_pytorch_p39-py"
535+
"name": "conda-env-sagemaker-distribution-py"
531536
},
532537
"language_info": {
533538
"codemirror_mode": {
@@ -539,9 +544,9 @@
539544
"name": "python",
540545
"nbconvert_exporter": "python",
541546
"pygments_lexer": "ipython3",
542-
"version": "3.9.16"
547+
"version": "3.10.14"
543548
}
544549
},
545550
"nbformat": 4,
546-
"nbformat_minor": 2
551+
"nbformat_minor": 4
547552
}

notebooks/MLA-NLP-Lecture1-Final-Project.ipynb

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,6 @@
2727
"__You can use the KNN Classifier from here: https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KNeighborsClassifier.html__"
2828
]
2929
},
30-
{
31-
"cell_type": "code",
32-
"execution_count": 1,
33-
"metadata": {},
34-
"outputs": [
35-
{
36-
"name": "stdout",
37-
"output_type": "stream",
38-
"text": [
39-
"Note: you may need to restart the kernel to use updated packages.\n"
40-
]
41-
}
42-
],
43-
"source": [
44-
"%pip install -q -r ../requirements.txt"
45-
]
46-
},
4730
{
4831
"cell_type": "markdown",
4932
"metadata": {},
@@ -63,8 +46,10 @@
6346
},
6447
{
6548
"cell_type": "code",
66-
"execution_count": 2,
67-
"metadata": {},
49+
"execution_count": 1,
50+
"metadata": {
51+
"tags": []
52+
},
6853
"outputs": [
6954
{
7055
"data": {
@@ -130,7 +115,7 @@
130115
"4 No mention if Ann Rivers Siddons adapted the m... 0"
131116
]
132117
},
133-
"execution_count": 2,
118+
"execution_count": 1,
134119
"metadata": {},
135120
"output_type": "execute_result"
136121
}
@@ -151,8 +136,10 @@
151136
},
152137
{
153138
"cell_type": "code",
154-
"execution_count": 3,
155-
"metadata": {},
139+
"execution_count": 2,
140+
"metadata": {
141+
"tags": []
142+
},
156143
"outputs": [
157144
{
158145
"data": {
@@ -218,7 +205,7 @@
218205
"4 Dirty War is absolutely one of the best politi... 1"
219206
]
220207
},
221-
"execution_count": 3,
208+
"execution_count": 2,
222209
"metadata": {},
223210
"output_type": "execute_result"
224211
}
@@ -240,8 +227,10 @@
240227
},
241228
{
242229
"cell_type": "code",
243-
"execution_count": 4,
244-
"metadata": {},
230+
"execution_count": 3,
231+
"metadata": {
232+
"tags": []
233+
},
245234
"outputs": [],
246235
"source": [
247236
"# Implement this"
@@ -268,9 +257,9 @@
268257
],
269258
"metadata": {
270259
"kernelspec": {
271-
"display_name": "conda_pytorch_p39",
260+
"display_name": "sagemaker-distribution:Python",
272261
"language": "python",
273-
"name": "conda_pytorch_p39"
262+
"name": "conda-env-sagemaker-distribution-py"
274263
},
275264
"language_info": {
276265
"codemirror_mode": {
@@ -282,9 +271,9 @@
282271
"name": "python",
283272
"nbconvert_exporter": "python",
284273
"pygments_lexer": "ipython3",
285-
"version": "3.9.13"
274+
"version": "3.10.14"
286275
}
287276
},
288277
"nbformat": 4,
289-
"nbformat_minor": 2
278+
"nbformat_minor": 4
290279
}

0 commit comments

Comments
 (0)