Skip to content

Commit d24faf9

Browse files
authored
Merge pull request #2 from kylerobertchandler/master
Updated code to eliminate warnings, fixed comment typos
2 parents e9a1f9b + bfc3175 commit d24faf9

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

Recommendation-Engine/Collaborative filtering - User-User and Item-Item approach..ipynb

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,18 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": 2,
66
"metadata": {},
7-
"outputs": [],
7+
"outputs": [
8+
{
9+
"name": "stderr",
10+
"output_type": "stream",
11+
"text": [
12+
"/var/folders/5n/n97z4g557rs9lyv924z46dhc0000gn/T/ipykernel_30845/3479152577.py:7: DeprecationWarning: Please use `pearsonr` from the `scipy.stats` namespace, the `scipy.stats.stats` namespace is deprecated.\n",
13+
" from scipy.stats.stats import pearsonr\n"
14+
]
15+
}
16+
],
817
"source": [
918
"#import all required packages..\n",
1019
"\n",
@@ -18,7 +27,7 @@
1827
},
1928
{
2029
"cell_type": "code",
21-
"execution_count": 2,
30+
"execution_count": 3,
2231
"metadata": {},
2332
"outputs": [],
2433
"source": [
@@ -32,7 +41,7 @@
3241
},
3342
{
3443
"cell_type": "code",
35-
"execution_count": 3,
44+
"execution_count": 4,
3645
"metadata": {},
3746
"outputs": [
3847
{
@@ -111,7 +120,7 @@
111120
"4 12882 110 4.5 1147195239"
112121
]
113122
},
114-
"execution_count": 3,
123+
"execution_count": 4,
115124
"metadata": {},
116125
"output_type": "execute_result"
117126
}
@@ -122,21 +131,12 @@
122131
},
123132
{
124133
"cell_type": "code",
125-
"execution_count": 4,
134+
"execution_count": 10,
126135
"metadata": {},
127-
"outputs": [
128-
{
129-
"name": "stderr",
130-
"output_type": "stream",
131-
"text": [
132-
"/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:18: FutureWarning: 'movieId' is both an index level and a column label.\n",
133-
"Defaulting to column, but this will raise an ambiguity error in a future version\n"
134-
]
135-
}
136-
],
136+
"outputs": [],
137137
"source": [
138138
"#Get movie rating count so it will be easy at end to rank movie when 2 movie get same rating....\n",
139-
"#this is optional if you want can do it else skip this step.\n",
139+
"#this is optional if you want, you can do it, else skip this step.\n",
140140
"\n",
141141
"#1. take groupby with respect to movie and get mean avg of each movie. \n",
142142
"movie_rating_count = Ratings.groupby('movieId')['rating'].count()\n",
@@ -147,9 +147,9 @@
147147
"#3. change column name.\n",
148148
"movie_rating_count.columns = ['rating_count']\n",
149149
"\n",
150-
"#4. create new column movieIUd\n",
150+
"#4. create new column movieId\n",
151151
"movie_rating_count['movieId'] = movie_rating_count.index\n",
152-
"movie_rating_count.reset_index(drop=True)\n",
152+
"movie_rating_count.reset_index(drop=True, inplace=True)\n",
153153
"\n",
154154
"#merging to Rating dataframe so we have collectively all information together..\n",
155155
"Ratings = Ratings.merge(movie_rating_count,right_on='movieId',left_on='movieId')"
@@ -1814,6 +1814,7 @@
18141814
]
18151815
},
18161816
{
1817+
"attachments": {},
18171818
"cell_type": "markdown",
18181819
"metadata": {},
18191820
"source": [
@@ -2678,7 +2679,7 @@
26782679
"name": "python",
26792680
"nbconvert_exporter": "python",
26802681
"pygments_lexer": "ipython3",
2681-
"version": "3.6.7"
2682+
"version": "3.11.3"
26822683
}
26832684
},
26842685
"nbformat": 4,

0 commit comments

Comments
 (0)