forked from pegasystems/pega-datascientist-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/yusufuyanik1/pega-datasci…
- Loading branch information
Showing
29 changed files
with
1,258 additions
and
1,126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from pdstools import IH\n", | ||
"\n", | ||
"import plotly.io as pio\n", | ||
"import plotly as plotly\n", | ||
"\n", | ||
"plotly.offline.init_notebook_mode()\n", | ||
"pio.renderers.default = \"vscode\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Conversion Results\n", | ||
"\n", | ||
"Visualization of conversion modeling results from IH data." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from pathlib import Path\n", | ||
"import polars as pl\n", | ||
"\n", | ||
"ih_export_file = Path(\n", | ||
" \"./Data-pxStrategyResult_InteractionFiles_20241213T091932_GMT.zip\"\n", | ||
")\n", | ||
"\n", | ||
"if not ih_export_file.exists():\n", | ||
" ih = IH.from_mock_data()\n", | ||
"else:\n", | ||
" ih = IH.from_ds_export(\n", | ||
" ih_export_file,\n", | ||
" query=pl.col.ExperimentGroup.is_not_null() & (pl.col.ExperimentGroup != \"\"),\n", | ||
" )\n", | ||
"\n", | ||
"ih.aggregates.summary_success_rates(by=[\"ExperimentGroup\", \"Channel\"]).drop(\n", | ||
" \"Outcomes\"\n", | ||
").collect().to_pandas().style.hide()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"ih.plot.overall_gauges(\n", | ||
" metric=\"Conversion\",\n", | ||
" condition=\"ExperimentGroup\",\n", | ||
" by=\"Channel\",\n", | ||
" reference_values={\"Web\": 0.055, \"Email\": 0.09},\n", | ||
")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Detailed View \n", | ||
"\n", | ||
"Showing conversion rates for all actions." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"ih.plot.success_rates_tree_map(metric=\"Conversion\")\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Conversion Rate Trends\n", | ||
"\n", | ||
"side-by-side bars and lines (separate methods) with error bars" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"ih.plot.success_rates_trend_bar(\n", | ||
" metric=\"Conversion\",\n", | ||
" condition=\"ExperimentGroup\",\n", | ||
" every=\"1w\",\n", | ||
")\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"ih.plot.success_rates_trend(metric=\"Conversion\", every=\"1d\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Engagement" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"ih.plot.overall_gauges(\n", | ||
" condition=\"ExperimentGroup\",\n", | ||
" by=\"Channel\",\n", | ||
" reference_values={\"Web\": 0.20, \"Email\": 0.20},\n", | ||
")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"ih.plot.success_rates_trend(\n", | ||
" by=\"Channel\"\n", | ||
")" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": ".venv", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Oops, something went wrong.