From 3ca183076dd520ac155b400df225b163b276476a Mon Sep 17 00:00:00 2001 From: RomanBredehoft Date: Fri, 26 Apr 2024 11:28:29 +0200 Subject: [PATCH] chore: refresh DecisionTreeRegressor notebook --- .../DecisionTreeRegressor.ipynb | 91 +++++++++++++++---- 1 file changed, 74 insertions(+), 17 deletions(-) diff --git a/docs/advanced_examples/DecisionTreeRegressor.ipynb b/docs/advanced_examples/DecisionTreeRegressor.ipynb index 811d022f1..24fbb884d 100644 --- a/docs/advanced_examples/DecisionTreeRegressor.ipynb +++ b/docs/advanced_examples/DecisionTreeRegressor.ipynb @@ -81,7 +81,8 @@ "output_type": "stream", "text": [ "Using ConcreteML version 1.5.0\n", - "With Python version 3.10.11 (v3.10.11:7d4cc5aa85, Apr 4 2023, 19:05:19) [Clang 13.0.0 (clang-1300.0.29.30)]\n" + "With Python version 3.8.18 (default, Aug 28 2023, 08:26:46) \n", + "[GCC 9.4.0]\n" ] } ], @@ -248,7 +249,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Training on 5100 samples in 12.5982 seconds\n" + "Training on 5100 samples in 21.4460 seconds\n" ] } ], @@ -304,8 +305,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Best hyper parameters: {'criterion': 'absolute_error', 'max_depth': None, 'max_features': 5, 'min_samples_leaf': 2, 'min_samples_split': 2, 'n_bits': 7, 'random_state': 42}\n", - "Min lost: 44158.68$\n" + "Best hyper parameters: {'criterion': 'absolute_error', 'max_depth': 10, 'max_features': 5, 'min_samples_leaf': 2, 'min_samples_split': 2, 'n_bits': 7, 'random_state': 42}\n", + "Min lost: 43828.16$\n" ] } ], @@ -365,8 +366,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Error for n_bits=6 is 46599.48$\n", - "Error for n_bits=7 is 44158.68$\n" + "Error for n_bits=6 is 45585.76$\n", + "Error for n_bits=7 is 43828.16$\n" ] } ], @@ -438,8 +439,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Sklearn Mean Error: 41418.11$,-33.96% of baseline\n", - "Concrete Mean Error: 40695.02$,-35.12% of baseline\n" + "Sklearn Mean Error: 45960.28$,-26.72% of baseline\n", + "Concrete Mean Error: 46691.16$,-25.56% of baseline\n" ] } ], @@ -509,7 +510,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Compiled with 500 samples in 6.3428 seconds\n" + "Compiled with 500 samples in 1.2870 seconds\n" ] } ], @@ -531,8 +532,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "Generating a key for an 8-bit circuit\n", - "Key generation time: 0.64 seconds\n" + "Generating a key for an 8-bit circuit\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Key generation time: 0.48 seconds\n" ] } ], @@ -577,7 +584,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Execution time: 39.86 seconds per sample\n" + "Execution time: 1.55 seconds per sample\n" ] } ], @@ -610,11 +617,11 @@ "output_type": "stream", "text": [ "Cipher estimates:\n", - "293651.38$, 166667.00$, 126984.38$\n", + "293651.38$, 277778.33$, 126984.38$\n", "Plain estimates:\n", "290800.00$, 214600.00$, 102800.00$\n", "Differences:\n", - "2851.38$, -47933.00$, 24184.38$\n" + "2851.38$, 63178.33$, 24184.38$\n" ] } ], @@ -650,9 +657,59 @@ "output_type": "stream", "text": [ "N_BITS = 6\n", - "----------\n", - "Sklearn Mean Error: 41418.11$,-33.96% of baseline\n", - "Concrete Mean Error: 40695.02$,-35.12% of baseline\n" + "----------\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sklearn Mean Error: 45960.28$,-26.72% of baseline\n", + "Concrete Mean Error: 46691.16$,-25.56% of baseline\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Circuit compiled with 500 samples in 1.2834 seconds\n", + "Generating a key for an 8-bit circuit\n", + "Key generation time: 0.46 seconds\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Execution time: 1.58 seconds per sample\n", + "\n", + "N_BITS = 7\n", + "----------\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sklearn Mean Error: 45960.28$,-26.72% of baseline\n", + "Concrete Mean Error: 43046.38$,-31.37% of baseline\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Circuit compiled with 500 samples in 1.2975 seconds\n", + "Generating a key for an 9-bit circuit\n", + "Key generation time: 0.35 seconds\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Execution time: 1.41 seconds per sample\n", + "\n" ] } ],