Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
axsaucedo committed Feb 8, 2021
1 parent b667890 commit 48a43bc
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions components/routers/case_study/credit_card_default.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,30 @@
" _ = send_feedback_rest('ts-experiment', 'seldon', request, ts_response, ts_reward, truth)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can see the model performance on the Grafana dashboard:\n",
"http://localhost:3000/dashboard/db/mab?refresh=5s&orgId=1 (refresh to update)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We note that both the Epsilon greedy and Thompson sampling allocate more traffic to the better performing model (XGBoost) over time, but Thompson Sampling does so at a quicker rate as evidenced by the superior metrics (F1 score in particular)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Persistent MAB\n",
"\n",
"We also show an example of a TS Router which uses Redis for persistence to ensure that the state is shared consistently across multiple replicas."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -908,7 +932,7 @@
" request = {'data':{'ndarray':x}}\n",
"\n",
" # send request to both deployments\n",
" ts_response = rest_request_ambassador('ts-experiment-persistent', 'seldon', request, endpoint=\"localhost:80\")\n",
" ts_response = rest_request_ambassador('ts-experiment-persistent', 'seldon', request)\n",
" \n",
" # extract predictions\n",
" ts_probs = ts_response.get('data').get('ndarray')[0]\n",
Expand All @@ -919,29 +943,7 @@
" ts_reward = int(ts_pred==truth_val)\n",
" truth = [truth_val]\n",
" \n",
" _ = send_feedback_rest('ts-experiment-persistent', 'seldon', request, ts_response, ts_reward, truth, endpoint=\"localhost:80\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can see the model performance on the Grafana dashboard:\n",
"http://localhost:3000/dashboard/db/mab?refresh=5s&orgId=1 (refresh to update)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We note that both the Epsilon greedy and Thompson sampling allocate more traffic to the better performing model (XGBoost) over time, but Thompson Sampling does so at a quicker rate as evidenced by the superior metrics (F1 score in particular)."
" _ = send_feedback_rest('ts-experiment-persistent', 'seldon', request, ts_response, ts_reward, truth)"
]
},
{
Expand Down

0 comments on commit 48a43bc

Please sign in to comment.