Term Deposit Prediction with MLflow and scikit-learn
Optimieren Sie ein Festgeld-Modell mit GridSearchCV und sehen Sie jeden Kandidaten in MLflow: ein Elternlauf, ein Kindlauf für jeden der besten und ein ehrlicher Test-Score.
- Python
- uv
- MLflow
- scikit-learn
- pandas
Bildschirmfotos
Einmaliger Preis
- 149 ₹zzgl. GST, insgesamt 175,82 ₹
- 3 $
- Laden Sie es aus Ihrer Bibliothek herunter, sobald Ihre Zahlung bestätigt ist.
- Alle künftigen Releases dieses Projekts sind ohne Aufpreis enthalten.
- Neuestes Release
- 1.0.0 · 28.11.2026
- Lizenz
- Source Code Licence
Überblick
Der vollständige Quellcode einer Hyperparameter-Suche in Python, aufgezeichnet vom Autologging in MLflow 3.18. Ein Befehl testet 9 Einstellungskombinationen eines Gradient-Boosting-Modells, bewertet jede mit 5-facher Kreuzvalidierung, legt die 5 besten als Kindläufe unter einem Elternlauf ab und bewertet den Sieger an Kunden, die die Suche nie gesehen hat.
Hyperparameter-Suchen erzeugen Dutzende Zahlen und kaum Erinnerung. Term Deposit Prediction with MLflow and scikit-learn führt eine Grid Search von scikit-learn mit den öffentlichen Bank-Marketing-Daten aus und lässt das Autologging von MLflow jeden Kandidaten aufbewahren, damit Sie sehen, warum der Sieger gewonnen hat.
Was eine Suche festhält
- Den Elternlauf. Die Einstellungen der Suche selbst, die besten Einstellungen, den besten Kreuzvalidierungs-Score, die vollständigen Ergebnisse jedes Kandidaten in jedem Fold als
cv_results.csvund Diagramme der Konfusionsmatrix, der ROC-Kurve und der Precision-Recall-Kurve des besten Modells auf seinen Trainingsdaten. - Einen Kindlauf pro Kandidat. Die 5 besten Kandidaten bekommen jeweils einen Lauf, mit ihren Einstellungen und ihrem Mittelwert, ihrer Streuung und ihrem Rang über die Folds.
- Einen ehrlichen Score. 20 % der Anrufe bleiben außerhalb der Suche, und der Sieger wird daran bewertet: ein Test-ROC-AUC von 0,8145 bei der ersten Suche.
- Den Code dahinter. Den Git-Commit des Codes, der die Suche ausgeführt hat.
Ein Modell, das wirklich einsetzbar wäre
- Kein Datenleck. Die Anrufdauer bleibt draußen, weil sie erst nach dem Anruf bekannt ist.
- Eine saubere Pipeline. Textspalten werden One-Hot-kodiert, dann sagt ein
HistGradientBoostingClassifiervoraus, alles in einer scikit-learn-Pipeline. - Ein geprüfter Download. Die Daten werden einmal heruntergeladen, und ihr SHA-256-Fingerabdruck wird vor dem Lesen geprüft.
Code, auf dem Sie aufbauen können
- Ein sauberes Python-Paket. Eine
src-Struktur, verwaltet mit uv, mit einem Befehl:tune. - Einstellungen an einem Ort. pydantic-settings liest
.env, und.env.exampledokumentiert jede Einstellung. - Exakte Versionen.
uv.locklegt jedes Paket fest: MLflow 3.18.0, scikit-learn 1.9.1, pandas 3.1.1 und Python 3.15. - Keine Daten im Archiv. Das Projekt lädt den öffentlichen Datensatz beim ersten Lauf herunter.
Was nicht enthalten ist
- Kein gespeichertes Modell. Bei der Suche geht es um die Wahl der Einstellungen, deshalb speichert das Autologging keine Modelle.
- Kein Hosting. Es läuft auf Ihrem eigenen Rechner, mit einem MLflow-Tracking-Server, den Sie mit einem Befehl starten.
- Kein Testprojekt. Die Ergebnisse oben stammen aus echten Läufen, nicht aus automatisierten Tests im Archiv.
In sechs Schritten zum Laufen bringen
- Entpacken Sie das Archiv.
- Starten Sie einen MLflow-Tracking-Server.
- Kopieren Sie
.env.examplenach.env. - Installieren Sie die Pakete mit
uv sync. - Legen Sie das Projekt in Git an.
- Starten Sie die Suche mit
uv run tune.
Die README enthält jeden Befehl, für macOS und Linux und für PowerShell. How to Set Up and Run the Term Deposit Prediction Project (öffnet in einem neuen Tab) (auf Englisch) zeigt jeden Schritt mit seiner Ausgabe. Getestet wurde mit einer frischen Kopie des Archivs unter macOS.
So wurde es gebaut
Teil 5 der kostenlosen Tutorial-Reihe MLflow Tutorial for Machine Learning in Python (öffnet in einem neuen Tab) (auf Englisch) erklärt anhand dieses Codes Autologging, verschachtelte Läufe und Hyperparameter-Tuning.
Kostenlose Tutorial-Reihe
MLflow Tutorial for Machine Learning in Python
Sie lernen lieber beim Nachbauen? Diese kostenlose Schritt-für-Schritt-Anleitung in unserem Blog zeigt, wie das Projekt entsteht.
Das bekommen Sie
Alles im Archiv, auf einen Blick.
- Version 1.0.0 des vollständigen Quellcodes: ein mit uv verwaltetes Python-Paket
- Der Befehl tune: eine Grid Search über 9 Einstellungskombinationen mit 5-facher Kreuzvalidierung
- MLflow-Autologging der Suche als Elternlauf mit einem Kindlauf für jeden der besten Kandidaten
- Der ROC-AUC des besten Modells auf Testdaten, die die Suche nie sieht, im Elternlauf festgehalten
- Eine scikit-learn-Pipeline, die die Textspalten vor einem Gradient-Boosting-Klassifikator One-Hot-kodiert
- Ein geprüfter Download der öffentlichen Bank-Marketing-Daten, ohne die Anrufdauer
- Einstellungen in .env über pydantic-settings, mit einer dokumentierten .env.example
- uv.lock mit der exakten Version jedes Pakets
- Eine README mit der Einrichtung für macOS, Linux und PowerShell, der Suche, jeder Einstellung und der Quellenangabe des Datensatzes
Gebaut mit
Die genauen Laufzeitumgebungen und Versionen, mit denen gebaut und getestet wurde.
- Python3.15.2
- uv0.13.10
- MLflow3.18.0
- scikit-learn1.9.1
- pandas3.1.1
- NumPy2.5.5
- pydantic-settings2.16.3
Was im Archiv liegt
Der Dateibaum, den Sie nach dem Entpacken vor sich haben.
term-deposit-prediction-mlflow-scikit-learn/
- src/
- term_deposit_prediction/
- __init__.py
- code_version.py
- config.py
- data.py
- model.py
- tune.py
- term_deposit_prediction/
- .env.example
- .gitignore
- .python-version
- pyproject.toml
- uv.lock
- README.md
Was es von Ihnen braucht
Die Konten und Dienste, die es voraussetzt, damit Sie später nichts überrascht.
- uv, das Python 3.15 und die Pakete für Sie installiert
- Git, damit jeder Lauf den Commit seines Codes festhält
- Einen MLflow-Tracking-Server: Die README startet einen auf Ihrem Rechner mit einem Befehl
- Eine Internetverbindung für die erste Installation, rund 550 MB Pakete, und die erste Suche, die die Daten herunterlädt
Versionen
Alle bisherigen Versionen, die neueste zuerst.
1.0.0Neueste
Erstes Release des vollständigen Quellcodes.
- Führt eine Grid Search über 9 Einstellungskombinationen für einen Gradient-Boosting-Klassifikator mit den Bank-Marketing-Daten aus.
- Zeichnet die Suche mit dem Autologging von MLflow 3.18.0 auf: ein Elternlauf und ein Kindlauf für jeden der 5 besten Kandidaten.
- Bewertet das beste Modell auf Testdaten, die die Suche nie sieht.
- Enthält eine README, die Sie vom Archiv bis zu Ihrer ersten aufgezeichneten Suche führt.
Source Code Licence
Was Sie damit tun dürfen
What you may and may not do with the source code you buy.
Vollständige Lizenz lesen
- What this licence covers
This licence governs every file included in a product you buy from Dewiride Store: source code, configuration, database scripts, sample data, documentation and any other file in the download. It takes effect when your payment is confirmed and applies to every release of that product that reaches your library. Files that reach your library through an annual updates membership are governed in exactly the same way.
It forms part of the Terms of Sale and Use. Where a product page states different or additional licence terms for that product, those terms prevail for that product. The membership page may likewise state different or additional licence terms for the files a membership carries, and those terms then prevail for those files.
- The licence we grant you
We grant you a perpetual, worldwide, non-exclusive, non-transferable licence to use, reproduce, adapt, translate and modify the files, and to include the result in your own work, on the conditions set out below.
Perpetual means it does not expire. Worldwide means it is not limited to any country. Non-exclusive means we license the same product to other customers. Non-transferable means you cannot pass it on to someone else.
The licence is granted to you — either you personally, or the organisation you identified when buying. Everyone working within that organisation may use the files for that organisation’s projects. Nobody outside it may.
- What you may do
- Use and change the files in your own projects, commercial or otherwise, with no limit on the number of projects.
- Build a product or a service on them and charge your own customers for it.
- Deploy the result for a client, as part of work you are doing for that client.
- Distribute the result in compiled, deployed or otherwise non-source form.
- Keep as many back-up copies as you reasonably need.
- Study, observe and test how the code works, and obtain the information you need to make it work with your own software.
The last two are yours by law under sections 52(1)(aa) to (ac) of the Indian Copyright Act, 1957, and nothing in this licence is intended to take them away.
- What you may not do
- Resell, sublicense, redistribute or publish the files themselves, in whole or in substantial part, in source form.
- Include them in a template, starter kit, course, tutorial repository or component library that you sell or give away, where the code is the thing being supplied.
- Share your account, your download links or your invoices with anyone outside your organisation.
- Publish the files in a public repository, or in any other place where they can be obtained without buying them.
- Remove or obscure the copyright and attribution notices in the source files.
- Use the files to build something whose main purpose is to compete with Dewiride Store as a supplier of the same code.
The distinction that matters is simple: you may sell what you build with the code; you may not sell the code.
- Third-party components
Our products depend on open-source libraries, frameworks and services that we did not write. Those remain under their own licences, which we do not and cannot change. Where a product includes or requires such a component, its licence is named in the product’s documentation, and complying with it is your responsibility.
- Releases
Every release of a product you own is covered by this same licence and appears in your library at no extra cost. A release you have already downloaded remains licensed to you even if we later stop publishing the product. A release that reached your library through an annual updates membership is licensed to you on these same terms, and stays licensed after the period that carried it has ended.
- Ownership
We keep ownership of the files and of the copyright in them. You own whatever you create with them: your changes, your additions and the product you build are yours.
- If this licence ends
This licence ends if you materially breach it and do not put the breach right within thirty days of us asking you to in writing. It also ends if your payment is reversed or refunded, because the purchase it depends on no longer stands. Where a membership period is refunded or reversed, the licence ends for the releases that period carried and for nothing else: anything you bought separately, or that another period carried, is unaffected.
If it ends, you must stop using the files and delete the copies you hold. Work you had already delivered to a client before that point may continue in use, so that ending this licence never breaks something your own customer relies on.
- No warranty beyond the description
The warranties and limits in section 19 and section 20 of the Terms of Sale and Use apply to this licence as well.
- Governing law
This licence is governed by the law of India, and section 24 of the Terms of Sale and Use applies to any dispute about it. If a translation and the English version differ in meaning, the English version governs.
Term Deposit Prediction with MLflow and scikit-learn
- 149 ₹zzgl. GST, insgesamt 175,82 ₹
- 3 $