Skip to content

Commit

Permalink
Added zip file
Browse files Browse the repository at this point in the history
  • Loading branch information
menicgiulia authored Mar 6, 2023
1 parent aeea6b0 commit f9a9775
Showing 1 changed file with 41 additions and 38 deletions.
79 changes: 41 additions & 38 deletions Open_Food_Facts_SISection6.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"id": "df8dac46",
"execution_count": 12,
"id": "e18d139a",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -15,6 +15,7 @@
"import joblib\n",
"import matplotlib\n",
"import operator\n",
"from zipfile import ZipFile\n",
"# Set \n",
"matplotlib.rcParams['font.serif'] = 'Times New Roman'\n",
"matplotlib.rcParams['font.family'] = \"serif\"\n",
Expand All @@ -26,8 +27,8 @@
},
{
"cell_type": "code",
"execution_count": 4,
"id": "dc2d945d",
"execution_count": 13,
"id": "e9b9cb68",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -39,16 +40,16 @@
},
{
"cell_type": "markdown",
"id": "5ee07c54",
"id": "267994f6",
"metadata": {},
"source": [
"# Load Data"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "bd61b473",
"execution_count": 18,
"id": "4d40a822",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -57,8 +58,8 @@
},
{
"cell_type": "code",
"execution_count": 6,
"id": "08d4a7b1",
"execution_count": 19,
"id": "58610a77",
"metadata": {
"scrolled": true
},
Expand Down Expand Up @@ -472,7 +473,7 @@
"[233831 rows x 25 columns]"
]
},
"execution_count": 6,
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -483,16 +484,16 @@
},
{
"cell_type": "markdown",
"id": "55d99365",
"id": "60843900",
"metadata": {},
"source": [
"# Missing Data in Nutrition Facts"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "cc1321c3",
"execution_count": 20,
"id": "f077ef2b",
"metadata": {},
"outputs": [
{
Expand All @@ -514,7 +515,7 @@
"dtype: int64"
]
},
"execution_count": 7,
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -538,16 +539,16 @@
},
{
"cell_type": "markdown",
"id": "89c1573d",
"id": "f5f8f81d",
"metadata": {},
"source": [
"# Keep 11 nutrients including Trans-Fats"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "46f43497",
"execution_count": 21,
"id": "0c99130a",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -583,8 +584,8 @@
},
{
"cell_type": "code",
"execution_count": 9,
"id": "41f05700",
"execution_count": 22,
"id": "4d1bddda",
"metadata": {},
"outputs": [
{
Expand All @@ -608,20 +609,22 @@
},
{
"cell_type": "code",
"execution_count": 10,
"id": "ab6334c1",
"execution_count": 23,
"id": "00dd1eab",
"metadata": {},
"outputs": [],
"source": [
"# zip file\n",
"with ZipFile(pathdir2+'OpenFoodFacts11p_Performance.pkl.zip', 'r') as zObject:\n",
" zObject.extractall(path=pathdir2)"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "847c8adc",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/giulia/anaconda/lib/python3.6/site-packages/sklearn/base.py:315: UserWarning: Trying to unpickle estimator DecisionTreeClassifier from version 0.23.2 when using version 0.24.2. This might lead to breaking code or invalid results. Use at your own risk.\n",
" UserWarning)\n",
"/Users/giulia/anaconda/lib/python3.6/site-packages/sklearn/base.py:315: UserWarning: Trying to unpickle estimator RandomForestClassifier from version 0.23.2 when using version 0.24.2. This might lead to breaking code or invalid results. Use at your own risk.\n",
" UserWarning)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
Expand All @@ -647,7 +650,7 @@
},
{
"cell_type": "markdown",
"id": "abe4947c",
"id": "bc3c1be8",
"metadata": {},
"source": [
"# Including Additives Information"
Expand All @@ -656,7 +659,7 @@
{
"cell_type": "code",
"execution_count": 11,
"id": "2b98cd81",
"id": "18f4e736",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -668,7 +671,7 @@
{
"cell_type": "code",
"execution_count": 12,
"id": "d37d6468",
"id": "eca1ce17",
"metadata": {},
"outputs": [
{
Expand All @@ -690,7 +693,7 @@
{
"cell_type": "code",
"execution_count": 13,
"id": "1c039feb",
"id": "243cdff5",
"metadata": {},
"outputs": [
{
Expand All @@ -710,7 +713,7 @@
},
{
"cell_type": "markdown",
"id": "08a11251",
"id": "0b467541",
"metadata": {},
"source": [
"# Using just the Number of Additives"
Expand All @@ -719,7 +722,7 @@
{
"cell_type": "code",
"execution_count": 14,
"id": "e381bf68",
"id": "7cde3081",
"metadata": {},
"outputs": [
{
Expand All @@ -741,7 +744,7 @@
{
"cell_type": "code",
"execution_count": 15,
"id": "0ac64460",
"id": "d3efbb21",
"metadata": {},
"outputs": [
{
Expand Down

0 comments on commit f9a9775

Please sign in to comment.