This repository was archived by the owner on Aug 19, 2026. It is now read-only.

Latest commit

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

MLFLow and scikit-multiflow, a good match

  1. Generate abrupt drifts with scikit-multiflow (by changing the centroids in a Radial Basis Function stream)
  2. Send this data, containing drifts, into a kafka topic
  3. Listen to this kafka topic on another entry_point
  4. Detect drifts - again with scikit-multiflow - on this entrypoint and log them into MLFlow

Steps 1. and 2. are done in producer.py, while steps 3. and 4. are implemented in detector.py

producer.py is just a script to generate synthetic data. Real-life applications should only require something looking like detector.py

Install & Setup (OSX)

For OSX users:

brew install librdkafka
brew cask install homebrew/cask-versions/adoptopenjdk8
brew install kafka

Creating topics with kafka

kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic drift_detection

Start zookeeper and kafka

brew services start zookeeper # TODO zookeeper should only be required by confluent-kafka, REMOVE ME ?
brew services start kafka

small issues, big impact

You need to add conda-forge to install packages like scikit-multiflow directly from conda

conda config --add topics conda-forge

RUN

First make the producer send data though kafka Here we generate 100 concept drift, pushing 10 rows into kafka every 0.5 seconds

mlflow run https://github.com/Quantmetry/mlflow.git/examples/abrupt_drift_detection -e producer -P n_drifts=100 -P interval=0.5 -P batch_size=10 -P n_classes=3

Then we have the detector listening on the right kafka topic, crashing logs whenever a drift is detected

mlflow run https://github.com/Quantmetry/MLflow_example.git -e detect_drifts -P delta=0.001

Finally visualize all this in the MLFLow UI

mlfow ui

Deleting topics with kafka, (to rerun failed experiments)

kafka-server-start /usr/local/etc/kafka/server.properties --override delete.topic.enable=true
kafka-topics --zookeeper 127.0.0.1:2181 --delete --topic drift_detection

Further readings

About

a small example showing interactions between MLFlow and scikit-multiflow

Topics

Resources

Stars

10 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Aug 19, 2026. It is now read-only.

Latest commit

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

MLFLow and scikit-multiflow, a good match

  1. Generate abrupt drifts with scikit-multiflow (by changing the centroids in a Radial Basis Function stream)
  2. Send this data, containing drifts, into a kafka topic
  3. Listen to this kafka topic on another entry_point
  4. Detect drifts - again with scikit-multiflow - on this entrypoint and log them into MLFlow

Steps 1. and 2. are done in producer.py, while steps 3. and 4. are implemented in detector.py

producer.py is just a script to generate synthetic data. Real-life applications should only require something looking like detector.py

Install & Setup (OSX)

For OSX users:

brew install librdkafka
brew cask install homebrew/cask-versions/adoptopenjdk8
brew install kafka

Creating topics with kafka

kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic drift_detection

Start zookeeper and kafka

brew services start zookeeper # TODO zookeeper should only be required by confluent-kafka, REMOVE ME ?
brew services start kafka

small issues, big impact

You need to add conda-forge to install packages like scikit-multiflow directly from conda

conda config --add topics conda-forge

RUN

First make the producer send data though kafka Here we generate 100 concept drift, pushing 10 rows into kafka every 0.5 seconds

mlflow run https://github.com/Quantmetry/mlflow.git/examples/abrupt_drift_detection -e producer -P n_drifts=100 -P interval=0.5 -P batch_size=10 -P n_classes=3

Then we have the detector listening on the right kafka topic, crashing logs whenever a drift is detected

mlflow run https://github.com/Quantmetry/MLflow_example.git -e detect_drifts -P delta=0.001

Finally visualize all this in the MLFLow UI

mlfow ui

Deleting topics with kafka, (to rerun failed experiments)

kafka-server-start /usr/local/etc/kafka/server.properties --override delete.topic.enable=true
kafka-topics --zookeeper 127.0.0.1:2181 --delete --topic drift_detection

Further readings

About

a small example showing interactions between MLFlow and scikit-multiflow

Topics

Resources

Stars

10 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
This repository was archived by the owner on Aug 19, 2026. It is now read-only.

Latest commit

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

MLFLow and scikit-multiflow, a good match

  1. Generate abrupt drifts with scikit-multiflow (by changing the centroids in a Radial Basis Function stream)
  2. Send this data, containing drifts, into a kafka topic
  3. Listen to this kafka topic on another entry_point
  4. Detect drifts - again with scikit-multiflow - on this entrypoint and log them into MLFlow

Steps 1. and 2. are done in producer.py, while steps 3. and 4. are implemented in detector.py

producer.py is just a script to generate synthetic data. Real-life applications should only require something looking like detector.py

Install & Setup (OSX)

For OSX users:

brew install librdkafka
brew cask install homebrew/cask-versions/adoptopenjdk8
brew install kafka

Creating topics with kafka

kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic drift_detection

Start zookeeper and kafka

brew services start zookeeper # TODO zookeeper should only be required by confluent-kafka, REMOVE ME ?
brew services start kafka

small issues, big impact

You need to add conda-forge to install packages like scikit-multiflow directly from conda

conda config --add topics conda-forge

RUN

First make the producer send data though kafka Here we generate 100 concept drift, pushing 10 rows into kafka every 0.5 seconds

mlflow run https://github.com/Quantmetry/mlflow.git/examples/abrupt_drift_detection -e producer -P n_drifts=100 -P interval=0.5 -P batch_size=10 -P n_classes=3

Then we have the detector listening on the right kafka topic, crashing logs whenever a drift is detected

mlflow run https://github.com/Quantmetry/MLflow_example.git -e detect_drifts -P delta=0.001

Finally visualize all this in the MLFLow UI

mlfow ui

Deleting topics with kafka, (to rerun failed experiments)

kafka-server-start /usr/local/etc/kafka/server.properties --override delete.topic.enable=true
kafka-topics --zookeeper 127.0.0.1:2181 --delete --topic drift_detection

Further readings

About

a small example showing interactions between MLFlow and scikit-multiflow

Topics

Resources

Stars

10 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages