Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Article Fixes #121

Merged
merged 3 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions examples/hds/Example_Data_Anonymization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@
"# These lines are only for rendering in the docs, and are hidden through Jupyter tags\n",
"# Do not run if you're running the notebook seperately\n",
"\n",
"import os \n",
"import sys\n",
"sys.path.append('../../../')"
"\n",
"current_dir = os.getcwd() \n",
"base_dir = os.path.dirname(os.path.dirname(current_dir)) \n",
"sys.path.append(base_dir) "
]
},
{
Expand Down Expand Up @@ -56,7 +60,8 @@
"metadata": {},
"outputs": [],
"source": [
"pl.read_ndjson('../../../../data/SampleHDS.json')"
"json_file_path = os.path.join(base_dir, 'data', 'SampleHDS.json') \n",
"pl.read_ndjson(json_file_path)"
]
},
{
Expand All @@ -73,7 +78,8 @@
"metadata": {},
"outputs": [],
"source": [
"anon = DataAnonymization(hds_folder='../../../../data/')"
"hds_path = os.path.join(base_dir, 'data') \n",
"anon = DataAnonymization(hds_folder=hds_path, sample_percentage_schema_inferencing=0.99)"
]
},
{
Expand Down Expand Up @@ -154,7 +160,7 @@
"outputs": [],
"source": [
"anon = DataAnonymization(\n",
" hds_folder='../../../../data/',\n",
" hds_folder=hds_path,\n",
" mask_ih_names=False,\n",
" mask_outcome_values=False,\n",
" mask_context_key_values=False,\n",
Expand Down Expand Up @@ -235,7 +241,9 @@
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"metadata": {
"nbsphinx": "hidden"
},
"source": [
"## Advanced: Hash fuctions\n",
"\n",
Expand All @@ -253,7 +261,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [],
"source": [
"from hashlib import sha3_256\n",
Expand All @@ -278,7 +288,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.11.4"
},
"orig_nbformat": 4,
"vscode": {
Expand Down
2 changes: 1 addition & 1 deletion python/pdstools/plots/plot_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ def plotPredictorContribution(

def plotPredictorPerformanceHeatmap(
self,
top_n: int = 0,
top_n: int = 20,
by="Name",
active_only: bool = False,
query: Optional[Union[pl.Expr, str, Dict[str, list]]] = None,
Expand Down