From 3df8080df731b5b191394fa94bb72fbd9377f3cc Mon Sep 17 00:00:00 2001 From: "Uyanik, Yusuf" Date: Wed, 20 Sep 2023 15:21:28 +0200 Subject: [PATCH 1/2] set default top_n to 20 for heatmap --- python/pdstools/plots/plot_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pdstools/plots/plot_base.py b/python/pdstools/plots/plot_base.py index ed1ca5f3..01e7c604 100644 --- a/python/pdstools/plots/plot_base.py +++ b/python/pdstools/plots/plot_base.py @@ -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, From 4778866fe4697fa5f3b215ff55a8357e6fa13ad4 Mon Sep 17 00:00:00 2001 From: "Uyanik, Yusuf" Date: Wed, 20 Sep 2023 16:51:12 +0200 Subject: [PATCH 2/2] Hide Advanced: Hash fuctions in Data Anonymization notebook - Hide the last 2 cells for now because they don't work as expected (maps all predictors as symbolic) - Changed the way we get the path of SampleHDS.json. I think this way it is more understandable. --- examples/hds/Example_Data_Anonymization.ipynb | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/examples/hds/Example_Data_Anonymization.ipynb b/examples/hds/Example_Data_Anonymization.ipynb index a0c11d9a..0c1815c5 100644 --- a/examples/hds/Example_Data_Anonymization.ipynb +++ b/examples/hds/Example_Data_Anonymization.ipynb @@ -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) " ] }, { @@ -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)" ] }, { @@ -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)" ] }, { @@ -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", @@ -235,7 +241,9 @@ { "attachments": {}, "cell_type": "markdown", - "metadata": {}, + "metadata": { + "nbsphinx": "hidden" + }, "source": [ "## Advanced: Hash fuctions\n", "\n", @@ -253,7 +261,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "nbsphinx": "hidden" + }, "outputs": [], "source": [ "from hashlib import sha3_256\n", @@ -278,7 +288,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.0" + "version": "3.11.4" }, "orig_nbformat": 4, "vscode": {