Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

16_week 4 web server with ML models #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45,212 changes: 45,212 additions & 0 deletions ML-Week4/6. evaluating recommendation systems/bank_full_w_dummy_vars.csv

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {
"collapsed": true
},
Expand All @@ -33,8 +33,10 @@
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# import data\n",
Expand All @@ -44,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -129,7 +131,7 @@
"4 U1068 135104 1 1 2"
]
},
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -141,7 +143,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -208,7 +210,7 @@
"4 135105 Fast_Food"
]
},
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -227,7 +229,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -293,7 +295,7 @@
"132834 25"
]
},
"execution_count": 6,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -304,14 +306,16 @@
"placeID = id of a restaurant\n",
"rating = count of all rating for each restaurant \n",
"'''\n",
">> \n",
" \n",
"# then use 'sort_values' to display rating in decending order\n",
">>"
"\n",
"rating_count = pd.DataFrame(frame.groupby('placeID')['rating'].count())\n",
"rating_count.sort_values('rating', ascending=False).head(5)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 20,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -390,7 +394,7 @@
"6 132834 Mexican"
]
},
"execution_count": 7,
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -402,14 +406,18 @@
"placeID = id of a restaurant\n",
"Rcuisine = restaurant cuisine from 'cuisine' dataframe\n",
"''' \n",
">>\n",
">>\n",
"'''\n",
"summary = pd.DataFrame(cuisine.loc[cuisine['placeID'].isin(['135085', '132825', '135032', '135052', '132834'])])\n",
"summary.head()\n",
"'''\n",
"most_rated_places = pd.DataFrame([135085, 132825, 135032, 135052, 132834], index=np.arange(5), columns=['placeID'])\n",
"summary = pd.merge(most_rated_places, cuisine, on='placeID')\n",
"summary"
]
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 18,
"metadata": {},
"outputs": [
{
Expand All @@ -422,15 +430,24 @@
"Name: Rcuisine, dtype: object"
]
},
"execution_count": 8,
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# describe cuisine['Rcuisine']\n",
">>"
"cuisine['Rcuisine'].describe()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -449,7 +466,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.2"
"version": "3.6.1"
}
},
"nbformat": 4,
Expand Down
Loading