blob: cb8ff6c3097d3d58d7052f83206d75f6dd075d0f [file] [log] [blame]
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Association rules\n",
"Apriori algorithm"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/fmcquillan/anaconda/lib/python2.7/site-packages/IPython/config.py:13: ShimWarning: The `IPython.config` package has been deprecated since IPython 4.0. You should import from traitlets.config instead.\n",
" \"You should import from traitlets.config instead.\", ShimWarning)\n",
"/Users/fmcquillan/anaconda/lib/python2.7/site-packages/IPython/utils/traitlets.py:5: UserWarning: IPython.utils.traitlets has moved to a top-level traitlets package.\n",
" warn(\"IPython.utils.traitlets has moved to a top-level traitlets package.\")\n"
]
}
],
"source": [
"%load_ext sql"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"u'Connected: gpadmin@madlib'"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Greenplum Database 5.x on GCP (PM demo machine) - direct external IP access\n",
"#%sql postgresql://gpadmin@34.67.65.96:5432/madlib\n",
"\n",
"# Greenplum Database 5.x on GCP - via tunnel\n",
"%sql postgresql://gpadmin@localhost:8000/madlib\n",
" \n",
"# PostgreSQL local\n",
"#%sql postgresql://fmcquillan@localhost:5432/madlib"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1 rows affected.\n"
]
},
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <th>version</th>\n",
" </tr>\n",
" <tr>\n",
" <td>MADlib version: 1.17-dev, git revision: rel/v1.16-54-gec5614f, cmake configuration time: Wed Dec 18 17:08:05 UTC 2019, build type: release, build system: Linux-3.10.0-1062.4.3.el7.x86_64, C compiler: gcc 4.8.5, C++ compiler: g++ 4.8.5</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[(u'MADlib version: 1.17-dev, git revision: rel/v1.16-54-gec5614f, cmake configuration time: Wed Dec 18 17:08:05 UTC 2019, build type: release, build system: Linux-3.10.0-1062.4.3.el7.x86_64, C compiler: gcc 4.8.5, C++ compiler: g++ 4.8.5',)]"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%sql select madlib.version();\n",
"#%sql select version();"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 1. Load data"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Done.\n",
"Done.\n",
"1 rows affected.\n",
"1 rows affected.\n",
"1 rows affected.\n",
"1 rows affected.\n",
"1 rows affected.\n",
"1 rows affected.\n",
"1 rows affected.\n",
"1 rows affected.\n",
"1 rows affected.\n",
"1 rows affected.\n",
"1 rows affected.\n",
"1 rows affected.\n",
"1 rows affected.\n",
"1 rows affected.\n",
"1 rows affected.\n",
"15 rows affected.\n"
]
},
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <th>trans_id</th>\n",
" <th>product</th>\n",
" </tr>\n",
" <tr>\n",
" <td>1</td>\n",
" <td>beer</td>\n",
" </tr>\n",
" <tr>\n",
" <td>1</td>\n",
" <td>chips</td>\n",
" </tr>\n",
" <tr>\n",
" <td>1</td>\n",
" <td>diapers</td>\n",
" </tr>\n",
" <tr>\n",
" <td>2</td>\n",
" <td>beer</td>\n",
" </tr>\n",
" <tr>\n",
" <td>2</td>\n",
" <td>diapers</td>\n",
" </tr>\n",
" <tr>\n",
" <td>3</td>\n",
" <td>beer</td>\n",
" </tr>\n",
" <tr>\n",
" <td>3</td>\n",
" <td>diapers</td>\n",
" </tr>\n",
" <tr>\n",
" <td>4</td>\n",
" <td>beer</td>\n",
" </tr>\n",
" <tr>\n",
" <td>4</td>\n",
" <td>chips</td>\n",
" </tr>\n",
" <tr>\n",
" <td>5</td>\n",
" <td>beer</td>\n",
" </tr>\n",
" <tr>\n",
" <td>6</td>\n",
" <td>diapers</td>\n",
" </tr>\n",
" <tr>\n",
" <td>6</td>\n",
" <td>chips</td>\n",
" </tr>\n",
" <tr>\n",
" <td>6</td>\n",
" <td>beer</td>\n",
" </tr>\n",
" <tr>\n",
" <td>7</td>\n",
" <td>beer</td>\n",
" </tr>\n",
" <tr>\n",
" <td>7</td>\n",
" <td>diapers</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[(1, u'beer'),\n",
" (1, u'chips'),\n",
" (1, u'diapers'),\n",
" (2, u'beer'),\n",
" (2, u'diapers'),\n",
" (3, u'beer'),\n",
" (3, u'diapers'),\n",
" (4, u'beer'),\n",
" (4, u'chips'),\n",
" (5, u'beer'),\n",
" (6, u'diapers'),\n",
" (6, u'chips'),\n",
" (6, u'beer'),\n",
" (7, u'beer'),\n",
" (7, u'diapers')]"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%%sql \n",
"DROP TABLE IF EXISTS test_data;\n",
"CREATE TABLE test_data (\n",
" trans_id INT,\n",
" product TEXT\n",
");\n",
"\n",
"INSERT INTO test_data VALUES (1, 'beer');\n",
"INSERT INTO test_data VALUES (1, 'diapers');\n",
"INSERT INTO test_data VALUES (1, 'chips');\n",
"INSERT INTO test_data VALUES (2, 'beer');\n",
"INSERT INTO test_data VALUES (2, 'diapers');\n",
"INSERT INTO test_data VALUES (3, 'beer');\n",
"INSERT INTO test_data VALUES (3, 'diapers');\n",
"INSERT INTO test_data VALUES (4, 'beer');\n",
"INSERT INTO test_data VALUES (4, 'chips');\n",
"INSERT INTO test_data VALUES (5, 'beer');\n",
"INSERT INTO test_data VALUES (6, 'beer');\n",
"INSERT INTO test_data VALUES (6, 'diapers');\n",
"INSERT INTO test_data VALUES (6, 'chips');\n",
"INSERT INTO test_data VALUES (7, 'beer');\n",
"INSERT INTO test_data VALUES (7, 'diapers');\n",
"\n",
"SELECT * FROM test_data ORDER BY trans_id;"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 2. Generate rules\n",
"Let min(support)=.25 and min(confidence)=.5, and the output schema is set to NULL indicating output to the current schema. In this example we set verbose to TRUE so that we have some insight into progress of the function. We can now generate association rules as follows:"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1 rows affected.\n"
]
},
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <th>output_schema</th>\n",
" <th>output_table</th>\n",
" <th>total_rules</th>\n",
" <th>total_time</th>\n",
" </tr>\n",
" <tr>\n",
" <td>public</td>\n",
" <td>assoc_rules</td>\n",
" <td>7</td>\n",
" <td>0:00:00.926710</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[(u'public', u'assoc_rules', 7, datetime.timedelta(0, 0, 926710))]"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%%sql\n",
"SELECT * FROM madlib.assoc_rules( .25, -- Support\n",
" .5, -- Confidence\n",
" 'trans_id', -- Transaction id col\n",
" 'product', -- Product col\n",
" 'test_data', -- Input data\n",
" NULL, -- Output schema\n",
" TRUE -- Verbose output\n",
" );"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The association rules are stored in the assoc_rules table:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"7 rows affected.\n"
]
},
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <th>ruleid</th>\n",
" <th>pre</th>\n",
" <th>post</th>\n",
" <th>count</th>\n",
" <th>support</th>\n",
" <th>confidence</th>\n",
" <th>lift</th>\n",
" <th>conviction</th>\n",
" </tr>\n",
" <tr>\n",
" <td>1</td>\n",
" <td>[u'diapers']</td>\n",
" <td>[u'beer']</td>\n",
" <td>5</td>\n",
" <td>0.714285714286</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>6</td>\n",
" <td>[u'beer']</td>\n",
" <td>[u'diapers']</td>\n",
" <td>5</td>\n",
" <td>0.714285714286</td>\n",
" <td>0.714285714286</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>4</td>\n",
" <td>[u'chips']</td>\n",
" <td>[u'beer']</td>\n",
" <td>3</td>\n",
" <td>0.428571428571</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>2</td>\n",
" <td>[u'diapers', u'chips']</td>\n",
" <td>[u'beer']</td>\n",
" <td>2</td>\n",
" <td>0.285714285714</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>7</td>\n",
" <td>[u'chips']</td>\n",
" <td>[u'diapers']</td>\n",
" <td>2</td>\n",
" <td>0.285714285714</td>\n",
" <td>0.666666666667</td>\n",
" <td>0.933333333333</td>\n",
" <td>0.857142857143</td>\n",
" </tr>\n",
" <tr>\n",
" <td>3</td>\n",
" <td>[u'beer', u'chips']</td>\n",
" <td>[u'diapers']</td>\n",
" <td>2</td>\n",
" <td>0.285714285714</td>\n",
" <td>0.666666666667</td>\n",
" <td>0.933333333333</td>\n",
" <td>0.857142857143</td>\n",
" </tr>\n",
" <tr>\n",
" <td>5</td>\n",
" <td>[u'chips']</td>\n",
" <td>[u'diapers', u'beer']</td>\n",
" <td>2</td>\n",
" <td>0.285714285714</td>\n",
" <td>0.666666666667</td>\n",
" <td>0.933333333333</td>\n",
" <td>0.857142857143</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[(1, [u'diapers'], [u'beer'], 5, 0.714285714285714, 1.0, 1.0, 0.0),\n",
" (6, [u'beer'], [u'diapers'], 5, 0.714285714285714, 0.714285714285714, 1.0, 1.0),\n",
" (4, [u'chips'], [u'beer'], 3, 0.428571428571429, 1.0, 1.0, 0.0),\n",
" (2, [u'diapers', u'chips'], [u'beer'], 2, 0.285714285714286, 1.0, 1.0, 0.0),\n",
" (7, [u'chips'], [u'diapers'], 2, 0.285714285714286, 0.666666666666667, 0.933333333333333, 0.857142857142857),\n",
" (3, [u'beer', u'chips'], [u'diapers'], 2, 0.285714285714286, 0.666666666666667, 0.933333333333333, 0.857142857142857),\n",
" (5, [u'chips'], [u'diapers', u'beer'], 2, 0.285714285714286, 0.666666666666667, 0.933333333333333, 0.857142857142857)]"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%%sql\n",
"SELECT * FROM assoc_rules\n",
"ORDER BY support DESC, confidence DESC;"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 3. Limit max itemset size\n",
"Limit association rules generated from itemsets of size at most 2. This parameter is a good way to reduce long run times."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1 rows affected.\n"
]
},
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <th>output_schema</th>\n",
" <th>output_table</th>\n",
" <th>total_rules</th>\n",
" <th>total_time</th>\n",
" </tr>\n",
" <tr>\n",
" <td>public</td>\n",
" <td>assoc_rules</td>\n",
" <td>4</td>\n",
" <td>0:00:00.746039</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[(u'public', u'assoc_rules', 4, datetime.timedelta(0, 0, 746039))]"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%%sql \n",
"SELECT * FROM madlib.assoc_rules( .25, -- Support\n",
" .5, -- Confidence\n",
" 'trans_id', -- Transaction id col\n",
" 'product', -- Product col\n",
" 'test_data', -- Input data\n",
" NULL, -- Output schema\n",
" TRUE, -- Verbose output\n",
" 2 -- Max itemset size\n",
" );"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The association rules are again stored in the assoc_rules table:"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"4 rows affected.\n"
]
},
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <th>ruleid</th>\n",
" <th>pre</th>\n",
" <th>post</th>\n",
" <th>count</th>\n",
" <th>support</th>\n",
" <th>confidence</th>\n",
" <th>lift</th>\n",
" <th>conviction</th>\n",
" </tr>\n",
" <tr>\n",
" <td>2</td>\n",
" <td>[u'diapers']</td>\n",
" <td>[u'beer']</td>\n",
" <td>5</td>\n",
" <td>0.714285714286</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>3</td>\n",
" <td>[u'beer']</td>\n",
" <td>[u'diapers']</td>\n",
" <td>5</td>\n",
" <td>0.714285714286</td>\n",
" <td>0.714285714286</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>1</td>\n",
" <td>[u'chips']</td>\n",
" <td>[u'beer']</td>\n",
" <td>3</td>\n",
" <td>0.428571428571</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>4</td>\n",
" <td>[u'chips']</td>\n",
" <td>[u'diapers']</td>\n",
" <td>2</td>\n",
" <td>0.285714285714</td>\n",
" <td>0.666666666667</td>\n",
" <td>0.933333333333</td>\n",
" <td>0.857142857143</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[(2, [u'diapers'], [u'beer'], 5, 0.714285714285714, 1.0, 1.0, 0.0),\n",
" (3, [u'beer'], [u'diapers'], 5, 0.714285714285714, 0.714285714285714, 1.0, 1.0),\n",
" (1, [u'chips'], [u'beer'], 3, 0.428571428571429, 1.0, 1.0, 0.0),\n",
" (4, [u'chips'], [u'diapers'], 2, 0.285714285714286, 0.666666666666667, 0.933333333333333, 0.857142857142857)]"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%%sql\n",
"SELECT * FROM assoc_rules\n",
"ORDER BY support DESC, confidence DESC;"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 4. Filter rules\n",
"Post-processing can now be done on the output table in the case that you want to filter the results. For example, if you want any single item on the left hand side and a particular item on the right hand side:"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2 rows affected.\n"
]
},
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <th>ruleid</th>\n",
" <th>pre</th>\n",
" <th>post</th>\n",
" <th>count</th>\n",
" <th>support</th>\n",
" <th>confidence</th>\n",
" <th>lift</th>\n",
" <th>conviction</th>\n",
" </tr>\n",
" <tr>\n",
" <td>1</td>\n",
" <td>[u'chips']</td>\n",
" <td>[u'beer']</td>\n",
" <td>3</td>\n",
" <td>0.428571428571</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>2</td>\n",
" <td>[u'diapers']</td>\n",
" <td>[u'beer']</td>\n",
" <td>5</td>\n",
" <td>0.714285714286</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[(1, [u'chips'], [u'beer'], 3, 0.428571428571429, 1.0, 1.0, 0.0),\n",
" (2, [u'diapers'], [u'beer'], 5, 0.714285714285714, 1.0, 1.0, 0.0)]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%%sql\n",
"SELECT * FROM assoc_rules WHERE array_upper(pre,1) = 1 AND post = array['beer'];"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 5. Limit RHS\n",
"Limit the size of right hand side to 1. This parameter is a good way to reduce long run times."
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1 rows affected.\n"
]
},
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <th>output_schema</th>\n",
" <th>output_table</th>\n",
" <th>total_rules</th>\n",
" <th>total_time</th>\n",
" </tr>\n",
" <tr>\n",
" <td>public</td>\n",
" <td>assoc_rules</td>\n",
" <td>6</td>\n",
" <td>0:00:00.830826</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[(u'public', u'assoc_rules', 6, datetime.timedelta(0, 0, 830826))]"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%%sql\n",
"SELECT * FROM madlib.assoc_rules( .25, -- Support\n",
" .5, -- Confidence\n",
" 'trans_id', -- Transaction id col\n",
" 'product', -- Product col\n",
" 'test_data', -- Input data\n",
" NULL, -- Output schema\n",
" TRUE, -- Verbose output\n",
" NULL, -- Max itemset size\n",
" NULL, -- Max LHS size\n",
" 1 -- Max RHS size\n",
" );"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The association rules are again stored in the assoc_rules table:"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"6 rows affected.\n"
]
},
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <th>ruleid</th>\n",
" <th>pre</th>\n",
" <th>post</th>\n",
" <th>count</th>\n",
" <th>support</th>\n",
" <th>confidence</th>\n",
" <th>lift</th>\n",
" <th>conviction</th>\n",
" </tr>\n",
" <tr>\n",
" <td>1</td>\n",
" <td>[u'diapers']</td>\n",
" <td>[u'beer']</td>\n",
" <td>5</td>\n",
" <td>0.714285714286</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>5</td>\n",
" <td>[u'beer']</td>\n",
" <td>[u'diapers']</td>\n",
" <td>5</td>\n",
" <td>0.714285714286</td>\n",
" <td>0.714285714286</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>4</td>\n",
" <td>[u'chips']</td>\n",
" <td>[u'beer']</td>\n",
" <td>3</td>\n",
" <td>0.428571428571</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>2</td>\n",
" <td>[u'diapers', u'chips']</td>\n",
" <td>[u'beer']</td>\n",
" <td>2</td>\n",
" <td>0.285714285714</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>6</td>\n",
" <td>[u'chips']</td>\n",
" <td>[u'diapers']</td>\n",
" <td>2</td>\n",
" <td>0.285714285714</td>\n",
" <td>0.666666666667</td>\n",
" <td>0.933333333333</td>\n",
" <td>0.857142857143</td>\n",
" </tr>\n",
" <tr>\n",
" <td>3</td>\n",
" <td>[u'chips', u'beer']</td>\n",
" <td>[u'diapers']</td>\n",
" <td>2</td>\n",
" <td>0.285714285714</td>\n",
" <td>0.666666666667</td>\n",
" <td>0.933333333333</td>\n",
" <td>0.857142857143</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[(1, [u'diapers'], [u'beer'], 5, 0.714285714285714, 1.0, 1.0, 0.0),\n",
" (5, [u'beer'], [u'diapers'], 5, 0.714285714285714, 0.714285714285714, 1.0, 1.0),\n",
" (4, [u'chips'], [u'beer'], 3, 0.428571428571429, 1.0, 1.0, 0.0),\n",
" (2, [u'diapers', u'chips'], [u'beer'], 2, 0.285714285714286, 1.0, 1.0, 0.0),\n",
" (6, [u'chips'], [u'diapers'], 2, 0.285714285714286, 0.666666666666667, 0.933333333333333, 0.857142857142857),\n",
" (3, [u'chips', u'beer'], [u'diapers'], 2, 0.285714285714286, 0.666666666666667, 0.933333333333333, 0.857142857142857)]"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%%sql\n",
"SELECT * FROM assoc_rules\n",
"ORDER BY support DESC, confidence DESC;"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.10"
}
},
"nbformat": 4,
"nbformat_minor": 1
}