Skip to content

Commit

Permalink
New Multivariate Drift Method: Classifier for Drift Detection (#355)
Browse files Browse the repository at this point in the history
* adding cdd

* flake8 and mypy fixes

* expose calculator

* filter categorical feature warnings

* CDD draft doc

* add cdd docs

* doc update

* py37 compatibility update

* update docs

* doc update

* doc update

* Break up the big chunk calculation block

* Formatting

---------

Co-authored-by: Niels Nuyttens <niels@nannyml.com>
  • Loading branch information
nikml and nnansters authored Feb 16, 2024
1 parent 808913c commit 3e11cd7
Show file tree
Hide file tree
Showing 31 changed files with 13,710 additions and 11,976 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,6 @@ config/*

# generated by docker build
requirements.txt

# dev debug folder
debug/
1 change: 0 additions & 1 deletion docs/_static/butterfly-multivariate-drift.svg

This file was deleted.

11,793 changes: 0 additions & 11,793 deletions docs/_static/butterfly-scatterplot.svg

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11,793 changes: 11,793 additions & 0 deletions docs/_static/how-it-works/butterfly-scatterplot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"metadata": {},
"outputs": [],
"source": [
"figure.savefig(\"../_static/butterfly-scatterplot.svg\")"
"figure.savefig(\"../_static/how-it-works/butterfly-scatterplot.svg\")"
]
},
{
Expand Down Expand Up @@ -153,7 +153,7 @@
"metadata": {},
"outputs": [],
"source": [
"figure.write_image('../_static/butterfly-univariate-drift-distributions.svg')"
"figure.write_image('../_static/how-it-works/butterfly-univariate-drift-distributions.svg')"
]
},
{
Expand All @@ -173,8 +173,8 @@
"rcerror_results = rcerror_calculator.calculate(data=analysis_df)\n",
"\n",
"# let's visualize results across all the dataset\n",
"figure = rcerror_results.plot()\n",
"figure.show()"
"figure1 = rcerror_results.plot()\n",
"figure1.show()"
]
},
{
Expand All @@ -184,7 +184,38 @@
"metadata": {},
"outputs": [],
"source": [
"figure.write_image('../_static/butterfly-multivariate-drift.svg')"
"figure1.write_image('../_static/how-it-works/butterfly-multivariate-drift-pca.svg')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2a9d81bd-90dd-42b2-a16e-39847e250041",
"metadata": {},
"outputs": [],
"source": [
"# Let's compute multivariate drift\n",
"drift_classifier = nml.DriftDetectionClassifierCalculator(\n",
" feature_column_names=feature_column_names,\n",
" timestamp_column_name='ordered',\n",
" chunk_size=DPP\n",
").fit(reference_data=reference_df)\n",
"# let's compute results for analysis period\n",
"drift_classifier_results = drift_classifier.calculate(data=analysis_df)\n",
"\n",
"# let's visualize results across all the dataset\n",
"figure2 = drift_classifier_results.plot()\n",
"figure2.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "dece03d8-69c3-4a54-893e-80aae8d0897d",
"metadata": {},
"outputs": [],
"source": [
"figure2.write_image('../_static/how-it-works/butterfly-multivariate-drift-cdd.svg')"
]
}
],
Expand All @@ -204,7 +235,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.11.7"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 3e11cd7

Please sign in to comment.