From 5c9ec5c884453fba649edbba866d129eeee20563 Mon Sep 17 00:00:00 2001 From: Robin Straub Date: Tue, 21 Mar 2023 14:27:44 +0100 Subject: [PATCH] docs: remove outdated todo --- concrete-ml/svm.ipynb | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/concrete-ml/svm.ipynb b/concrete-ml/svm.ipynb index b575134..ac33a97 100644 --- a/concrete-ml/svm.ipynb +++ b/concrete-ml/svm.ipynb @@ -93,10 +93,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "88e9b7fc", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Scikit-learn Accuracy: 0.9833\n", + "Concrete-ML Quantized Accuracy: 0.6833\n", + "Concrete-ML FHE Accuracy: 0.6833\n" + ] + } + ], "source": [ "# Train a model with scikit-learn LinearSVC, perform prediction and compute the accuracy\n", "svm_sklearn = SklearnLinearSVC()\n", @@ -158,7 +168,7 @@ "svm_concrete = ConcreteLinearSVC()\n", "svm_concrete.fit(X_train, y_train)\n", "y_pred_concrete_clear = svm_concrete.predict(X_test)\n", - "accuracy_concrete_clear = accuracy_score(y_test, y_pred_sklearn)\n", + "accuracy_concrete_clear = accuracy_score(y_test, y_pred_concrete_clear)\n", "```\n", "\n", "One thing to note here is not only the model is trained using clear data, but the prediction are also performed in a *plain environment*, there is no encryption at this stage.\n", @@ -173,7 +183,7 @@ "circuit.client.keygen(force=False)\n", "# Now that a circuit is compiled, the svm_concrete can predict value with FHE\n", "y_pred_concrete_fhe = svm_concrete.predict(X_test, execute_in_fhe=True)\n", - "accuracy_concrete_fhe = accuracy_score(y_test, y_pred_sklearn)\n", + "accuracy_concrete_fhe = accuracy_score(y_test, y_pred_concrete_fhe)\n", "```\n", "\n", "Now that the model is compiled, computing predictions in with FHE is just a matter of passing a execution_in_fhe parameter set to True.\n", @@ -398,14 +408,6 @@ "accuracy = accuracy_score(y_test, y_pred)" ] }, - { - "cell_type": "markdown", - "id": "86cc8bee", - "metadata": {}, - "source": [ - "**[todo]: l'accuracy reste-t-elle la même?**" - ] - }, { "cell_type": "markdown", "id": "00a2461e",