Skip to content

Commit eead572

Browse files
committed
Створено в Colaboratory
1 parent fffc1dd commit eead572

File tree

1 file changed

+32
-39
lines changed

1 file changed

+32
-39
lines changed

goit_python_ds_hw_07.ipynb

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,33 @@
3434
},
3535
{
3636
"cell_type": "code",
37-
"execution_count": 25,
37+
"execution_count": 2,
3838
"metadata": {
3939
"colab": {
4040
"base_uri": "https://localhost:8080/"
4141
},
4242
"id": "IQlrrC64Ei_D",
43-
"outputId": "06ca648c-0b09-4203-d0a6-ba1ca6210125"
43+
"outputId": "6c836d7b-a418-4857-f20d-eb1f835ef759"
4444
},
4545
"outputs": [
4646
{
4747
"output_type": "stream",
4848
"name": "stdout",
4949
"text": [
50-
"Requirement already satisfied: scikit-surprise in /usr/local/lib/python3.10/dist-packages (1.1.3)\n",
50+
"Collecting scikit-surprise\n",
51+
" Downloading scikit-surprise-1.1.3.tar.gz (771 kB)\n",
52+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m772.0/772.0 kB\u001b[0m \u001b[31m6.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
53+
"\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
5154
"Requirement already satisfied: joblib>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from scikit-surprise) (1.3.2)\n",
5255
"Requirement already satisfied: numpy>=1.17.3 in /usr/local/lib/python3.10/dist-packages (from scikit-surprise) (1.25.2)\n",
53-
"Requirement already satisfied: scipy>=1.3.2 in /usr/local/lib/python3.10/dist-packages (from scikit-surprise) (1.11.4)\n"
56+
"Requirement already satisfied: scipy>=1.3.2 in /usr/local/lib/python3.10/dist-packages (from scikit-surprise) (1.11.4)\n",
57+
"Building wheels for collected packages: scikit-surprise\n",
58+
" Building wheel for scikit-surprise (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
59+
" Created wheel for scikit-surprise: filename=scikit_surprise-1.1.3-cp310-cp310-linux_x86_64.whl size=3163002 sha256=6077747674f48e2f38f3fe6d531fb529b7f5e775b20c9013bf1124cac961757e\n",
60+
" Stored in directory: /root/.cache/pip/wheels/a5/ca/a8/4e28def53797fdc4363ca4af740db15a9c2f1595ebc51fb445\n",
61+
"Successfully built scikit-surprise\n",
62+
"Installing collected packages: scikit-surprise\n",
63+
"Successfully installed scikit-surprise-1.1.3\n"
5464
]
5565
}
5666
],
@@ -60,7 +70,7 @@
6070
},
6171
{
6272
"cell_type": "code",
63-
"execution_count": 26,
73+
"execution_count": 3,
6474
"metadata": {
6575
"id": "m63KlyHSprCX"
6676
},
@@ -75,7 +85,7 @@
7585
},
7686
{
7787
"cell_type": "code",
78-
"execution_count": 27,
88+
"execution_count": 4,
7989
"metadata": {
8090
"id": "8_JhmJld6eFR"
8191
},
@@ -86,7 +96,7 @@
8696
},
8797
{
8898
"cell_type": "code",
89-
"execution_count": 28,
99+
"execution_count": 5,
90100
"metadata": {
91101
"id": "6SaBHI8tEE-8"
92102
},
@@ -99,7 +109,7 @@
99109
},
100110
{
101111
"cell_type": "code",
102-
"execution_count": 29,
112+
"execution_count": 6,
103113
"metadata": {
104114
"id": "T0DErstIgFzd"
105115
},
@@ -111,7 +121,7 @@
111121
},
112122
{
113123
"cell_type": "code",
114-
"execution_count": 30,
124+
"execution_count": 7,
115125
"metadata": {
116126
"id": "z-K7JzgVjES4"
117127
},
@@ -131,7 +141,7 @@
131141
},
132142
{
133143
"cell_type": "code",
134-
"execution_count": 31,
144+
"execution_count": 12,
135145
"metadata": {
136146
"id": "oVTS5xZsmyJS"
137147
},
@@ -140,8 +150,8 @@
140150
" latest_url = \"https://files.grouplens.org/datasets/movielens/ml-latest-small.zip\"\n",
141151
" latest_zip_file = Path(\"ml-latest-small.zip\")\n",
142152
" if not latest_zip_file.exists():\n",
143-
" !wget $latest_url\n",
144-
" !unzip $latest_zip_file\n",
153+
" !wget -q $latest_url\n",
154+
" !unzip -q $latest_zip_file\n",
145155
" base_path = Path(\"/content/ml-latest-small/\")\n",
146156
" rating_csv = base_path.joinpath(\"ratings.csv\")\n",
147157
" tags_csv = base_path.joinpath(\"tags.csv\")\n",
@@ -150,7 +160,7 @@
150160
},
151161
{
152162
"cell_type": "code",
153-
"execution_count": 32,
163+
"execution_count": 13,
154164
"metadata": {
155165
"id": "dNYxkIYrpWZE"
156166
},
@@ -163,7 +173,7 @@
163173
},
164174
{
165175
"cell_type": "code",
166-
"execution_count": 33,
176+
"execution_count": 10,
167177
"metadata": {
168178
"id": "NEEvbfqBquBr"
169179
},
@@ -181,14 +191,14 @@
181191
},
182192
{
183193
"cell_type": "code",
184-
"execution_count": 34,
194+
"execution_count": 14,
185195
"metadata": {
186196
"colab": {
187197
"base_uri": "https://localhost:8080/",
188-
"height": 228
198+
"height": 156
189199
},
190200
"id": "zk4mZ2b0cx7F",
191-
"outputId": "e0f1747d-03d8-451b-cbf0-fe693fdb0127"
201+
"outputId": "4e86c800-c489-4d49-8478-9eb1f6c87b14"
192202
},
193203
"outputs": [
194204
{
@@ -238,7 +248,7 @@
238248
]
239249
},
240250
"metadata": {},
241-
"execution_count": 34
251+
"execution_count": 14
242252
}
243253
],
244254
"source": [
@@ -367,31 +377,16 @@
367377
"Для оцінки що базується на спільній інформації про користувачів та їхню взаємодію з об'єктами (Collaborative Filtering) вибранно модель матричної факторизації (Matrix Factorization)."
368378
]
369379
},
370-
{
371-
"cell_type": "code",
372-
"execution_count": 36,
373-
"metadata": {
374-
"id": "djCv_xDbDPFc"
375-
},
376-
"outputs": [],
377-
"source": [
378-
"# uid = 6\n",
379-
"# iid = 258\n",
380-
"# ur = 2.0\n",
381-
"# dater = \"1997-12-28\""
382-
]
383-
},
384380
{
385381
"cell_type": "markdown",
386382
"metadata": {
387383
"id": "yzuccKchc2ji"
388384
},
389385
"source": [
390-
"Ми використовуємо об'єкт ***DatasetAutoFolds*** у Surprise, це означає, що ми працюємо з набором даних, який вже було розбито на файли (folds) для перехресної перевірки.\n",
386+
"Ми використовуємо об'єкт ***DatasetAutoFolds*** у Surprise.\n",
391387
"\n",
392388
"\n",
393-
"\n",
394-
"Мета цього методу - охопити загальний випадок використання, коли набір даних вже розбито на попередньо визначені складові, наприклад, набір даних movielens-100k ('ml-100k'), який визначає файли u1.base, u1.test, u2.base, u2.test і т.д... Його також можна використовувати, коли ми не хочемо виконувати перехресну перевірку, але все одно хочемо вказати наші навчальні та тестові дані (що в будь-якому випадку зводиться до 1-кратної перехресної перевірки)."
389+
"Якщо використаний метод **load_builtin** то Ми можемо працювати з набором даних, який вже було розбито на файли (folds) для перехресної перевірки. Мета цього методу - охопити загальний випадок використання, коли набір даних вже розбито на попередньо визначені складові, наприклад, набір даних movielens-100k ('ml-100k'), який визначає файли u1.base, u1.test, u2.base, u2.test і т.д... Його також можна використовувати, коли ми не хочемо виконувати перехресну перевірку, але все одно хочемо вказати наші навчальні та тестові дані (що в будь-якому випадку зводиться до 1-кратної перехресної перевірки)."
395390
]
396391
},
397392
{
@@ -411,9 +406,7 @@
411406
"source": [
412407
"### Algorithm SVD.\n",
413408
"\n",
414-
"Метод SVD може бути адаптований до наборів даних з неявним зворотним зв'язком (implicit feedback).\n",
415-
"\n",
416-
"Додаткові внутрішні фактори користувача та фільмів ініціалізуються випадковим чином відповідно до нормального розподілу."
409+
"Метод SVD може бути адаптований до наборів даних з неявним зворотним зв'язком (implicit feedback)."
417410
]
418411
},
419412
{
@@ -2549,7 +2542,7 @@
25492542
"t9xezE86PB4A"
25502543
],
25512544
"provenance": [],
2552-
"authorship_tag": "ABX9TyNB1kQ7TOQY4CLnA/MWxLP1",
2545+
"authorship_tag": "ABX9TyPiYqe58RmpDg4A42fuZbtC",
25532546
"include_colab_link": true
25542547
},
25552548
"kernelspec": {

0 commit comments

Comments
 (0)