Skip to content

Commit

Permalink
Merge pull request #5 from LDSSA/batch2
Browse files Browse the repository at this point in the history
Batch2
  • Loading branch information
hershaw authored Aug 11, 2018
2 parents 794e773 + ad34b66 commit 5923e12
Show file tree
Hide file tree
Showing 6 changed files with 315 additions and 201 deletions.
38 changes: 19 additions & 19 deletions Deserialize and use.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"source": [
"import pickle\n",
"import json\n",
"import pandas as pd"
"import pandas as pd\n",
"from sklearn.externals import joblib"
]
},
{
Expand All @@ -34,7 +35,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -46,34 +47,33 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let's get that pipeline un-pickled:"
"And now let's un-pickle the dtypes as well:"
]
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"with open('pipeline.pickle', 'rb') as fh:\n",
" pipeline = pickle.load(fh)"
"with open('dtypes.pickle', 'rb') as fh:\n",
" dtypes = pickle.load(fh)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And now let's un-pickle the dtypes as well:"
"Finally let's get reload the pipeline"
]
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"with open('dtypes.pickle', 'rb') as fh:\n",
" dtypes = pickle.load(fh)"
"pipeline = joblib.load('pipeline.pickle')"
]
},
{
Expand All @@ -96,7 +96,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -115,7 +115,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -170,7 +170,7 @@
"0 3 male 22.0 1 0 7.25 None S"
]
},
"execution_count": 14,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -188,16 +188,16 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[ 0.90735821, 0.09264179]])"
"array([[0.90499548, 0.09500452]])"
]
},
"execution_count": 15,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -223,14 +223,14 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"the observation has 0.09264179297127445 probability of survival\n"
"the observation has 0.09500452074453275 probability of survival\n"
]
}
],
Expand Down Expand Up @@ -262,7 +262,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
"version": "3.6.4"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 5923e12

Please sign in to comment.