Skip to content
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
4 changes: 2 additions & 2 deletions docs/source/examples/data_drift/MMD_advance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@
" mmd, callbacks_logs = detector.compare(X=sample)\n",
" permutation_test_logs[type_] = copy.copy(callbacks_logs[\"permutation_test\"])\n",
" mmd, p_value = mmd.distance, callbacks_logs[\"permutation_test\"][\"p_value\"]\n",
" print(f\"{type_}:\\n MMD statistic={round(mmd, 4)}, p-value={round(p_value, 4)}, drift={p_value < alpha}\")"
" print(f\"{type_}:\\n MMD statistic={round(mmd, 4)}, p-value={round(p_value, 4)}, drift={p_value <= alpha}\")"
],
"metadata": {
"collapsed": false,
Expand Down Expand Up @@ -1014,7 +1014,7 @@
" ax.plot(xs, permutation_tests_density, label=\"KDE\")\n",
" ax.axvline(observed_statistic, color=\"green\", linestyle=\"--\", label=\"Observed distance\")\n",
" ax.set_title(type_)\n",
" drift = p_value < alpha\n",
" drift = p_value <= alpha\n",
" ax.text(0.88, 0.15, \"Drift\" if drift else \"No drift\", transform=ax.transAxes, fontsize=12, bbox={\"boxstyle\": \"round\", \"facecolor\": \"red\" if drift else \"green\", \"alpha\":0.5})\n",
"\n",
" # Get the y limit\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/data_drift/MMD_simple.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
],
"source": [
"print(f\"MMD statistic={round(mmd.distance, 3)}, p-value={round(p_value, 3)}\")\n",
"if p_value < alpha:\n",
"if p_value <= alpha:\n",
" print(\"Drift detected. We can reject H0, so both samples come from different distributions.\")\n",
"else:\n",
" print(\"No drift detected. We fail to reject H0, so both samples come from the same distribution.\")"
Expand Down
4 changes: 2 additions & 2 deletions docs/source/examples/data_drift/multivariate_detector.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
"_, callback_logs = detector.compare(X=X_test)\n",
"p_value = callback_logs[\"permutation_test\"][\"p_value\"]\n",
"print(f\"p-value: {round(p_value, 4)}\")\n",
"if p_value < alpha:\n",
"if p_value <= alpha:\n",
" print(\"Data drift detected\")\n",
"else:\n",
" print(\"No data drift detected\")\n",
Expand Down Expand Up @@ -352,7 +352,7 @@
"_, callback_logs = detector.compare(X=X_test_noise)\n",
"p_value = callback_logs[\"permutation_test\"][\"p_value\"]\n",
"print(f\"p-value: {round(p_value, 4)}\")\n",
"if p_value < alpha:\n",
"if p_value <= alpha:\n",
" print(\"Data drift detected\")\n",
"else:\n",
" print(\"No data drift detected\")\n",
Expand Down
6 changes: 3 additions & 3 deletions docs/source/examples/data_drift/univariate_detector.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
" print(f\"Feature {i+1}:\")\n",
" p_value = detector.compare(X=X_test[:, i])[0].p_value\n",
" print(f\"\\tp-value: {round(p_value, 4)}\")\n",
" if p_value < alpha:\n",
" if p_value <= alpha:\n",
" print(\"\\tData drift detected\\n\")\n",
" else:\n",
" print(\"\\tNo data drift detected\\n\")\n",
Expand Down Expand Up @@ -265,7 +265,7 @@
" print(f\"Feature {i}:\")\n",
" p_value = detector.compare(X=X_test_noise[:, i])[0].p_value\n",
" print(f\"\\tp-value: {round(p_value, 4)}\")\n",
" if p_value < alpha:\n",
" if p_value <= alpha:\n",
" print(\"\\tData drift detected\\n\")\n",
" else:\n",
" print(\"\\tNo data drift detected\\n\")\n",
Expand Down Expand Up @@ -335,7 +335,7 @@
" print(f\"Feature {i}:\")\n",
" p_value = detector.compare(X=X_test_noise[:, i])[0].p_value\n",
" print(f\"\\tp-value: {round(p_value, 4)}\")\n",
" if p_value < alpha:\n",
" if p_value <= alpha:\n",
" print(\"\\tData drift detected\\n\")\n",
" else:\n",
" print(\"\\tNo data drift detected\\n\")\n",
Expand Down