{
  "source_file": "0930",
  "source_platform": "Medium",
  "author": "John Adeojo",
  "title_listed": "Build Deployable Machine Learning Pipelines",
  "keywords": "",
  "domain": "机器学习",
  "content_type": "深度技术解析",
  "is_paid_flag": "否",
  "url": "https://towardsdatascience.com/build-deployable-machine-learning-pipelines-a6d7035816a6/",
  "publish_date": "2023-06-30",
  "corpus_stage": "",
  "notes": "",
  "id": "d99a1f61df71",
  "collected_at": "2026-10-02T07:13:12",
  "title": "Build Deployable Machine Learning Pipelines | Towards Data Science",
  "body_markdown": "![Revisit consent button](../images/body-df29beacd7496220cc94.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](../images/body-2159bb67f3de8ad870eb.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Data Science](https://towardsdatascience.com/category/data-science/)\n# Build Deployable Machine Learning Pipelines\nLeverage Kedro to build production-ready machine learning pipelines\n[John Adeojo](https://towardsdatascience.com/author/johnadeojo/)\nJune 30, 20238 min read\n![Image by Author: Generated with Midjourney](../images/000.png)\nImage by Author: Generated with Midjourney\n## Background - Notebooks are not \"Deployable\"\nMany data scientists' initial encounters with coding take place through notebook-style user interfaces. Notebooks are indispensable for exploration - a critical aspect of our workflow. However, they're not designed to be production-ready. This is a key issue I've observed among numerous clients, some of whom inquire about ways to productionise their notebooks. Rather than productionising your notebooks, the optimal route to production readiness is to craft modular, maintainable, and reproducible code.\nIn this article, I present an example of a modular ML pipeline for training a model to classify fraudulent credit card transactions. By the conclusion of this article, I hope that you will:\n  1. Gain an appreciation and understanding of modular ML pipelines.\n  2. Feel inspired to build one for yourself.\n\n\nIf you want to reap the benefits of deploying your machine learning models for maximum effect, writing modular code is an important step to take.\nLearn this step by step with the interactive [AI and Data Scientist](https://roadmap.sh/ai-data-scientist), [Computer Science](https://roadmap.sh/computer-science) and [Machine Learning](https://roadmap.sh/machine-learning) roadmaps.\nFirst a quick definition of [modular](https://en.wikipedia.org/wiki/Modular_programming) code. Modular code is software design paradigm that emphasizes separating a program out into independent, interchangeable modules. We should aim to approach this state with our machine learning pipelines.\n### Quick Detour - The project, the Data, and Approach\nThe machine learning project is sourced from [Kaggle](https://www.kaggle.com/datasets/mlg-ulb/creditcardfraud). The dataset consists of 284,807 anonymised credit card transactions for which 492 are fraudulent. The task is to build a classifier to detect the fraudulent transactions.\nThe Data for this project is licensed for any purpose including commercial use under the [Open Data Commons](https://opendatacommons.org/licenses/dbcl/1-0/).\nI have used a deep learning approach leveraging the [Ludwig](https://ludwig.ai/latest/) , an open-source [framework](https://medium.com/towards-data-science/ludwig-a-friendlier-deep-learning-framework-946ee3d3b24) for declarative deep learning. I won't go into the details of Ludwig here, however I have previously written an article on the framework.\nThe Ludwig deep neural network is configured with a **.yaml** file. For those that are curious you can find this in the [model registry GitHub](https://github.com/john-adeojo/Credit-Card-Fraud-Model-Registry/blob/main/model%20yaml%20files/model_1a.yaml).\n* * *\n## Building Modular Pipelines with Kedro\nBuilding modular machine learning pipelines has been made easier with open-source tools, my favourite of these is [Kedro](https://kedro.org/). Not only because I have seen this used successfully in industry, but also because it helped me develop my software engineering skills.\nKedro is an open-source framework (licensed under Apache 2.0) for creating reproducible, maintainable and modular data science code. I came across it while I was developing the AI strategy for a bank, considering which tools my team could utilise to build production-ready code.\n_Disclaimer: I have no affiliation with Kedro or McKinsey's QuantumBlack, the creators of this open-source tool._\n* * *\n## The Model Training Pipeline\n![Image by Author: End-to-end model training pipeline generated with Kedro viz](../images/001.png)\nImage by Author: End-to-end model training pipeline generated with Kedro viz\nKedro conveniently allows you to visualise your pipelines, a fantastic feature that can help bring clarity to your code. The pipeline is standard for machine learning so I will only briefly touch on each aspect.\n  1. **Import Data** : Import the credit card transaction data from an external source.\n  2. **Split Data** : Use random split to split the data into training and holdout sets.\n  3. **Run Experiment** : Uses the Ludwig framework to train a deep neural network on the train data set. The Ludwig experiment API conveniently saves model artefacts for every experiment run.\n  4. **Run Predictions** : Uses the model trained in the previous step to run predictions on the holdout dataset.\n  5. **Model Diagnostics** : Produces two diagnostic charts. First, the tracking the cross-entropy loss over each epoch. Second, the [ROC curve](https://en.wikipedia.org/wiki/Receiver_operating_characteristic) measuring the model's performance on the holdout dataset.\n\n\n![Image by Author: Loss Curve from model training process](../images/002.png)\nImage by Author: Loss Curve from model training process\n![Image by Author: ROC Curve from model evaluation on the holdout dataset](../images/003.png)\nImage by Author: ROC Curve from model evaluation on the holdout dataset\n* * *\n## Core Components of the Pipeline\nNow that we have established a high-level view, let's get into some of the core components of this pipeline.\n### Project Structure\ntext\n\n```\nC:.\n├───conf\n│   ├───base\n│   │   └───parameters\n│   └───local\n├───data\n│   ├───01_raw\n│   ├───02_intermediate\n│   ├───03_primary\n│   ├───04_feature\n│   ├───05_model_input\n│   ├───06_models\n│   │   ├───experiment_run\n│   │   │   └───model\n│   │   │       ├───logs\n│   │   │       │   ├───test\n│   │   │       │   ├───training\n│   │   │       │   └───validation\n│   │   │       └───training_checkpoints\n│   │   └───experiment_run_0\n│   │       └───model\n│   │           ├───logs\n│   │           │   ├───test\n│   │           │   ├───training\n│   │           │   └───validation\n│   │           └───training_checkpoints\n│   ├───07_model_output\n│   └───08_reporting\n├───docs\n│   └───source\n│  \n└───src\n    ├───fraud_detection_model\n    │   ├───pipelines\n    │       ├───train_model\n    └───tests\n        └───pipelines\n```\n\nKedro provides a templated directory structure that is established when you initiate a project. From this base, you can programmatically add more pipelines to your directory structure. This standardised structure ensures that every machine learning project is identical and easy to document, thereby facilitating ease of maintenance.\n### Data Management\nData plays a crucial role in machine learning. The ability to track your data becomes even more essential when employing machine learning models in a commercial setting. You often find yourself facing audits, or the necessity to productionise or reproduce your pipeline on someone else's machine.\nKedro offers two methods for enforcing best practices in data management. The first is a directory structure, designed for machine learning workloads, providing distinct locations for the intermediate tables produced during data transformation and the model artefacts. The second method is the [data catalogue](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/conf/base/catalog.yml). As part of the Kedro workflow, you are required to register datasets within a .yaml configuration file, thereby enabling you to leverage these datasets in your pipelines. This approach may initially seem unusual, but it allows you and others working on your pipeline to track data with ease.\n### Orchestration - Nodes and Pipelines\nThis is really where the magic happens. Kedro provides you with pipeline functionality straight out of the box.\nThe initial building block of your [pipeline](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/src/fraud_detection_model/pipelines/train_model/pipeline.py) is the [nodes](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/src/fraud_detection_model/pipelines/train_model/nodes.py). Each executable piece of code can be encapsulated within a Node, which is simply a Python function that accepts an input and yields an output. You can then structure a pipeline as a series of nodes. Pipelines are easily constructed by invoking the node and specifying the inputs and outputs. Kedro determines the execution order.\nOnce pipelines are constructed, they are registered in the provided **pipeline_registry.py** file. The beauty of this approach is that you can create multiple pipelines. This is particularly beneficial in machine learning, where you might have a data processing pipeline, a model training pipeline, an inference pipeline, and so forth.\nOnce set up, it's straightforward enough to modify aspects of your pipeline.\n### Configuration\nKedro's best practices stipulate that all configurations should be handled through the provided [**parameters.yml**](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/conf/base/parameters.yml) file. From a machine learning perspective, hyperparameters fall into this category. This approach streamlines experimentation, as you can simply substitute one **parameters.yml** file with a set of hyperparameters for another, which is also much easier to track.\nI have also included the locations of my Ludwig deep neural network [**model.yaml**](https://github.com/john-adeojo/Credit-Card-Fraud-Model-Registry/blob/main/model%20yaml%20files/model_1a.yaml) and the data source within the **parameters.yml** configuration. Should the model or the location of the data change - for instance, when moving between developers' machines - it would be incredibly straightforward to adjust these settings.\n### Reproducibility\nKedro includes a [**requirements.txt**](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/src/requirements.txt) file as part of the templated structure. This makes it really straightforward to monitor your environment and exact library versions. However, should you prefer, you can employ other environment management methods, such as an **environment.yml** file.\n* * *\n## Establishing a Workflow\nIf you're developing machine learning pipelines and considering using Kedro, it can initially present a steep learning curve, but adopting a standard workflow will simplify the process. Here's my suggested workflow:\n  1. **Establish your working environment** : I prefer using Anaconda for this task. I typically use an [**environment.yml**](https://github.com/john-adeojo/kedro-project/blob/main/environment.yml) file, containing all the dependencies needed for my environment, and employ the Anaconda Powershell command line to [create](https://gist.github.com/john-adeojo/fa22082328e65d0260fefd9b149e4b69) my environment from this.\n  2. **Create a Kedro project** : Once you have Kedro installed - which should hopefully be declared in your **environment.yml** - you can [create](https://docs.kedro.org/en/stable/get_started/new_project.html) a Kedro project through the [Anaconda](https://www.anaconda.com/) command line interface.\n  3. **Explore in Jupyter Notebooks** : I construct an initial pipeline in Jupyter notebooks, a process familiar to most data scientists. The only difference is that, once your pipeline is built, you should tidy it up so that each cell could serve as one Node in your Kedro pipeline.\n  4. **Register your data** : Record the input and outputs for each data processing or data ingestion step in the data [catalogue](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/conf/base/catalog.yml).\n  5. **Add your pipeline** : After conducting your exploration in notebooks, you'll want to [create a pipeline](https://docs.kedro.org/en/stable/tutorial/create_a_pipeline.html#:~:text=Note,the%20starter%20project.). This is achieved through the command line interface. Running this command will add an additional folder to 'pipelines', bearing the name of the pipeline you've just created. It's within this folder that you'll construct your nodes and pipelines.\n  6. **Define your pipeline** : This is the stage where you start transferring the code from your Jupyter notebooks into the [**node.py**](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/src/fraud_detection_model/pipelines/train_model/nodes.py) file in your pipeline folder, ensuring that nodes you intend to be part of a pipeline have inputs and outputs. Once the nodes are set up, proceed to define your pipeline in the [**pipeline.py**](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/src/fraud_detection_model/pipelines/train_model/pipeline.py) file.\n  7. **Register your pipelines** : The [**pipeline_registry.py**](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/src/fraud_detection_model/pipeline_registry.py) file offers a template for you to register your newly created pipeline.\n  8. **Run your project** : Once established, you can [run](https://docs.kedro.org/en/stable/nodes_and_pipelines/run_a_pipeline.html) any pipeline through the CLI and also [visualise](https://docs.kedro.org/en/stable/visualisation/index.html) your project.\n\n\n* * *\nProduction-ready pipelines fit into a wider ecosystem of machine learning operations. Read my article on MLOps for a deeper dive.\n> [**Building Machine Learning Operations for Businesses**](https://towardsdatascience.com/building-machine-learning-operations-for-businesses-6d0bfbbf2139)\n## Conclusion\nKedro is an excellent framework for delivering production-ready machine learning pipelines. Beyond the functionality discussed in this article, there are numerous integrations with other open-source libraries, as well as packages for documentation and testing. Kedro doesn't solve every issue related to model deployment - for instance, model versioning is likely better handled by another tool such as DVC. However, it will assist data scientists in a commercial setting to produce more maintainable, modular, and reproducible code that is ready for production. There is a relatively steep learning curve for complete novices, but the documentation is clear and includes guided tutorials. As with any of these packages, the best way to learn is to dive in and experiment.\nLink to the full [GitHub repo](https://github.com/john-adeojo/kedro-project/tree/main)\n* * *\n_Follow me on_[ _LinkedIn_](https://www.linkedin.com/in/john-adeojo/)\n_Subscribe to medium to get more insights from me:_\n> [**Join Medium with my referral link - John Adeojo**](https://johnadeojo.medium.com/membership)\n_Should you be interested in integrating AI or data science into your business operations, we invite you to schedule a complimentary initial consultation with us:_\n> [**Book Online | Data-Centric Solutions**](https://www.data-centric-solutions.com/book-online)\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](../images/body-ead068aa953e7b688a96.png)\nWritten By\n## [John Adeojo](https://towardsdatascience.com/author/johnadeojo/)\n[See all from John Adeojo](https://towardsdatascience.com/author/johnadeojo/)\n[Data Science](https://towardsdatascience.com/tag/data-science/)[Kedro](https://towardsdatascience.com/tag/kedro/)[Machine Learning](https://towardsdatascience.com/tag/machine-learning/)[Machine Learning Pipeline](https://towardsdatascience.com/tag/machine-learning-pipeline/)[Programming](https://towardsdatascience.com/tag/programming/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fbuild-deployable-machine-learning-pipelines-a6d7035816a6%2F&title=Build%20Deployable%20Machine%20Learning%20Pipelines)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fbuild-deployable-machine-learning-pipelines-a6d7035816a6%2F&title=Build%20Deployable%20Machine%20Learning%20Pipelines)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fbuild-deployable-machine-learning-pipelines-a6d7035816a6%2F&text=Build%20Deployable%20Machine%20Learning%20Pipelines)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](../images/004.jpg)](https://towardsdatascience.com/whisper-transcribe-translate-audio-files-with-human-level-performance-df044499877/)\n## [Whisper: Transcribe & Translate Audio Files With Human-Level Performance](https://towardsdatascience.com/whisper-transcribe-translate-audio-files-with-human-level-performance-df044499877/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nAn AI model compatible with 97 languages - and how to use it\n[Nikos Kafritsas](https://towardsdatascience.com/author/nikoskafritsas/)\nOctober 7, 202210 min read\n  * [![](../images/005.jpg)](https://towardsdatascience.com/data-engineering-orm-and-odm-with-python-cff97532e464/)\n## [Data Engineering - ORM and ODM with Python](https://towardsdatascience.com/data-engineering-orm-and-odm-with-python-cff97532e464/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nManipulate database data leveraging an object-oriented programming paradigm\n[Marcello Politi](https://towardsdatascience.com/author/marcellopoliti/)\nJanuary 2, 20256 min read\n  * [![](../images/006.jpeg)](https://towardsdatascience.com/text-preprocessing-with-data-describe-7ba175cf8447/)\n## [Text Preprocessing with data-describe](https://towardsdatascience.com/text-preprocessing-with-data-describe-7ba175cf8447/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nCleaning up messy text using open-source EDA accelerator \"data-describe\"\n[Rishi Sheth](https://towardsdatascience.com/author/sheth108/)\nNovember 10, 20207 min read\n  * [![](../images/body-63beb50f664a055ed739.jpg)](https://towardsdatascience.com/a-function-that-makes-your-initial-eda-a-breeze-8e9549d69fb3/)\n## [A Function That Makes Your Initial EDA a Breeze](https://towardsdatascience.com/a-function-that-makes-your-initial-eda-a-breeze-8e9549d69fb3/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nThis function using Seaborn creates visuals for your project in no time.\n[Katie Sylvia](https://towardsdatascience.com/author/katiesylvia/)\nAugust 22, 20212 min read\n  * [![](../images/008.jpg)](https://towardsdatascience.com/lets-impute-missing-values-with-sql-e350c89d9e2a/)\n## [Let's Impute Missing Values with SQL](https://towardsdatascience.com/lets-impute-missing-values-with-sql-e350c89d9e2a/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nAutomated and easy-to-understand script to get the job done.\n[Dario Radečić](https://towardsdatascience.com/author/radecicdario/)\nAugust 25, 20207 min read\n  * [![](../images/009.jpg)](https://towardsdatascience.com/efficient-coding-in-data-science-easy-debugging-of-pandas-chained-operations-0089f6de920f/)\n## [Efficient Coding in Data Science: Easy Debugging of Pandas Chained Operations](https://towardsdatascience.com/efficient-coding-in-data-science-easy-debugging-of-pandas-chained-operations-0089f6de920f/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nHow to inspect Pandas data frames in chained operations without breaking the chain into separate statements\n[Marcin Kozak](https://towardsdatascience.com/author/nyggus/)\nNovember 15, 20239 min read\n  * [![](../images/010.jpeg)](https://towardsdatascience.com/the-world-of-sql-joins-c70ca7f36f04/)\n## [The World of SQL Joins](https://towardsdatascience.com/the-world-of-sql-joins-c70ca7f36f04/)\n[Programming](https://towardsdatascience.com/category/programming/)\nJoin Me on a Journey!\n[JB](https://towardsdatascience.com/author/josephburton06/)\nAugust 24, 20218 min read\n  * [![](../images/011.png)](https://towardsdatascience.com/simplifying-transformers-state-of-the-art-nlp-using-words-you-understand-part-5-decoder-and-cd2810c6ad40/)\n## [Simplifying Transformers: State of the Art NLP Using Words You Understand - part 5- Decoder and...](https://towardsdatascience.com/simplifying-transformers-state-of-the-art-nlp-using-words-you-understand-part-5-decoder-and-cd2810c6ad40/)\n[Deep Learning](https://towardsdatascience.com/category/artificial-intelligence/deep-learning/)\nLast part of the Transformer series\n[Chen Margalit](https://towardsdatascience.com/author/chenmargalit/)\nOctober 5, 20237 min read\n  * [![](../images/012.png)](https://towardsdatascience.com/sql-case-study-investigating-a-drop-in-user-engagement-510b27d0cbcc/)\n## [SQL Case Study: Investigating a Drop in User Engagement](https://towardsdatascience.com/sql-case-study-investigating-a-drop-in-user-engagement-510b27d0cbcc/)\n[Programming](https://towardsdatascience.com/category/programming/)\nA Real-Life Data Analyst Case Study\n[Terence Shin, MSc, MBA](https://towardsdatascience.com/author/terenceshin/)\nMay 21, 20209 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607686/image?etag=1782161464448&width=500&height=500) How Relevance Models Foreshadowed Transformers for NLP ](https://towardsdatascience.com/how-relevance-models-foreshadowed-transformers-for-nlp/ \"How Relevance Models Foreshadowed Transformers for NLP\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500) Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1 ](https://towardsdatascience.com/javascript-fatigue-you-dont-need-js-to-build-chatgpt/ \"Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ \"Does Your Company Have a Data Strategy?\")\n\n\n",
  "metadata": {
    "title": "Build Deployable Machine Learning Pipelines | Towards Data Science",
    "description": "Leverage Kedro to build production-ready machine learning pipelines",
    "keywords": null,
    "author": "John Adeojo",
    "og:locale": "en_US",
    "og:type": "article",
    "og:title": "Build Deployable Machine Learning Pipelines",
    "og:description": "Leverage Kedro to build production-ready machine learning pipelines",
    "og:url": "https://towardsdatascience.com/build-deployable-machine-learning-pipelines-a6d7035816a6/",
    "og:site_name": "Towards Data Science",
    "og:image": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/06/1c0Hu8ahZgeC-BC-kscotkA.png",
    "og:image:width": "1024",
    "og:image:height": "1024",
    "og:image:type": "image/png",
    "twitter:card": "summary_large_image",
    "twitter:site": "@TDataScience",
    "twitter:creator": "@TDataScience",
    "twitter:label1": "Written by",
    "twitter:data1": "John Adeojo",
    "twitter:label2": "Est. reading time",
    "twitter:data2": "8 min read",
    "article:published_time": "2023-06-30T16:51:13.000Z",
    "article:modified_time": "2023-06-30T16:51:13.000Z",
    "article:author": "https://towardsdatascience.com/author/johnadeojo/"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [
    {
      "language": "txt",
      "file": "attachments/d99a1f61df71/code/block_000.txt",
      "chars": 813
    }
  ],
  "images": [
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607686/image?etag=1782161464448&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607686/image?etag=1782161464448&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:47:33Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:47:33Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:47:33Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:47:33Z"
    }
  ],
  "audio": [],
  "videos": [
    {
      "url": "https://www.youtube.com/c/TowardsDataScience",
      "kind": "channel_reference",
      "status": "reference_only"
    }
  ],
  "links": [
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/latest/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/editors-pick/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/the-variable/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/shipai/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/submissions/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/category/data-science/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/johnadeojo/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/building-machine-learning-operations-for-businesses-6d0bfbbf2139"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/data-science/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/kedro/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/machine-learning/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/machine-learning-pipeline/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/programming/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/whisper-transcribe-translate-audio-files-with-human-level-performance-df044499877/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/category/artificial-intelligence/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/nikoskafritsas/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/data-engineering-orm-and-odm-with-python-cff97532e464/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/category/artificial-intelligence/machine-learning/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/marcellopoliti/"
    },
    {
      "type": "external",
      "href": "https://write.insightmediagroup.io"
    },
    {
      "type": "external",
      "href": "https://www.linkedin.com/company/towards-data-science/"
    },
    {
      "type": "external",
      "href": "https://x.com/TDataScience"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/ai-data-scientist"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/computer-science"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/machine-learning"
    },
    {
      "type": "external",
      "href": "https://en.wikipedia.org/wiki/Modular_programming"
    },
    {
      "type": "external",
      "href": "https://www.kaggle.com/datasets/mlg-ulb/creditcardfraud"
    },
    {
      "type": "external",
      "href": "https://opendatacommons.org/licenses/dbcl/1-0/"
    },
    {
      "type": "external",
      "href": "https://ludwig.ai/latest/"
    },
    {
      "type": "external",
      "href": "https://medium.com/towards-data-science/ludwig-a-friendlier-deep-learning-framework-946ee3d3b24"
    },
    {
      "type": "external",
      "href": "https://github.com/john-adeojo/Credit-Card-Fraud-Model-Registry/blob/main/model%20yaml%20files/model_1a.yaml"
    },
    {
      "type": "external",
      "href": "https://kedro.org/"
    },
    {
      "type": "external",
      "href": "https://en.wikipedia.org/wiki/Receiver_operating_characteristic"
    },
    {
      "type": "external",
      "href": "https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/conf/base/catalog.yml"
    },
    {
      "type": "external",
      "href": "https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/src/fraud_detection_model/pipelines/train_model/pipeline.py"
    },
    {
      "type": "external",
      "href": "https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/src/fraud_detection_model/pipelines/train_model/nodes.py"
    },
    {
      "type": "external",
      "href": "https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/conf/base/parameters.yml"
    },
    {
      "type": "external",
      "href": "https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/src/requirements.txt"
    },
    {
      "type": "external",
      "href": "https://github.com/john-adeojo/kedro-project/blob/main/environment.yml"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-20T17:26:15Z",
  "source_url": "https://towardsdatascience.com/build-deployable-machine-learning-pipelines-a6d7035816a6/",
  "delivery_status": "unverified",
  "discovery_status": "http_403",
  "missing_reason": "源页面未重新核验:http_403；已按保留正文补采图片",
  "repair_error": "",
  "actual_video_files": [
    {
      "local_path": "attachments/d99a1f61df71/videos/5aC4hruxBR4.f251.webm",
      "bytes": 7260088,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "492.661000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/5aC4hruxBR4.f298.mp4",
      "bytes": 21590071,
      "valid": true,
      "height": 720,
      "width": 1280,
      "duration": "492.650000",
      "status": "ok"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/9PMjEOPUTV8.f251.webm",
      "bytes": 44871030,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "3343.781000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/9PMjEOPUTV8.f299.mp4",
      "bytes": 558574353,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "3343.750000",
      "status": "ok"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/BaV698rqTVE.f251.webm",
      "bytes": 3215355,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "241.581000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/BaV698rqTVE.f399.mp4",
      "bytes": 6200916,
      "valid": true,
      "height": 1080,
      "width": 1888,
      "duration": "241.533333",
      "status": "ok"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/DDG7AZo-t0M.f251.webm",
      "bytes": 8717799,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "693.981000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/DDG7AZo-t0M.f399.mp4",
      "bytes": 18251759,
      "valid": true,
      "height": 1080,
      "width": 1662,
      "duration": "693.966667",
      "status": "ok"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/J76h5loFn1I.f137.mp4",
      "bytes": 325979873,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "2942.733333",
      "status": "ok"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/J76h5loFn1I.f251.webm",
      "bytes": 39403360,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "2942.721000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/c3SWUfqv4fQ.f137.mp4",
      "bytes": 364962992,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "2582.866667",
      "status": "ok"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/c3SWUfqv4fQ.f251.webm",
      "bytes": 34351110,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "2582.881000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/ckI21wSyhSY.f137.mp4",
      "bytes": 369085344,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "3107.566667",
      "status": "ok"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/ckI21wSyhSY.f251.webm",
      "bytes": 48981464,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "3107.581000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/dYSw-SV_fsI.f137.mp4",
      "bytes": 510118997,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "3502.466667",
      "status": "ok"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/dYSw-SV_fsI.f251.webm",
      "bytes": 50508020,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "3502.501000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/dw5Vff_fjoc.f251.webm",
      "bytes": 12502314,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "803.981000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/dw5Vff_fjoc.f399.mp4",
      "bytes": 33276990,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "803.966667",
      "status": "ok"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/r41UzkiR8Hw.f251.webm",
      "bytes": 38694049,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "2899.101000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/r41UzkiR8Hw.f299.mp4",
      "bytes": 465524987,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "2899.100000",
      "status": "ok"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/sRn-Q_mSjAM.f137.mp4",
      "bytes": 839095286,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "3283.300000",
      "status": "ok"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/sRn-Q_mSjAM.f251.webm",
      "bytes": 46074764,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "3283.321000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/wE7MG20VT8g.f251.webm",
      "bytes": 34123989,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "2494.421000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/wE7MG20VT8g.f299.mp4",
      "bytes": 405392900,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "2494.400000",
      "status": "ok"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/zQ84HXl_kDc.f251.webm",
      "bytes": 43526388,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "3081.881000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/d99a1f61df71/videos/zQ84HXl_kDc.f299.mp4",
      "bytes": 1084902539,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "3081.866667",
      "status": "ok"
    }
  ],
  "expected_saved_body_images": 4,
  "image_discovery": "saved_markdown",
  "source_body_markdown": "![Revisit consent button](https://cdn-cookieyes.com/assets/images/revisit.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](https://cdn-cookieyes.com/assets/images/close.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Data Science](https://towardsdatascience.com/category/data-science/)\n# Build Deployable Machine Learning Pipelines\nLeverage Kedro to build production-ready machine learning pipelines\n[John Adeojo](https://towardsdatascience.com/author/johnadeojo/)\nJune 30, 20238 min read\n![Image by Author: Generated with Midjourney](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/06/1c0Hu8ahZgeC-BC-kscotkA.png)\nImage by Author: Generated with Midjourney\n## Background - Notebooks are not \"Deployable\"\nMany data scientists' initial encounters with coding take place through notebook-style user interfaces. Notebooks are indispensable for exploration - a critical aspect of our workflow. However, they're not designed to be production-ready. This is a key issue I've observed among numerous clients, some of whom inquire about ways to productionise their notebooks. Rather than productionising your notebooks, the optimal route to production readiness is to craft modular, maintainable, and reproducible code.\nIn this article, I present an example of a modular ML pipeline for training a model to classify fraudulent credit card transactions. By the conclusion of this article, I hope that you will:\n  1. Gain an appreciation and understanding of modular ML pipelines.\n  2. Feel inspired to build one for yourself.\n\n\nIf you want to reap the benefits of deploying your machine learning models for maximum effect, writing modular code is an important step to take.\nLearn this step by step with the interactive [AI and Data Scientist](https://roadmap.sh/ai-data-scientist), [Computer Science](https://roadmap.sh/computer-science) and [Machine Learning](https://roadmap.sh/machine-learning) roadmaps.\nFirst a quick definition of [modular](https://en.wikipedia.org/wiki/Modular_programming) code. Modular code is software design paradigm that emphasizes separating a program out into independent, interchangeable modules. We should aim to approach this state with our machine learning pipelines.\n### Quick Detour - The project, the Data, and Approach\nThe machine learning project is sourced from [Kaggle](https://www.kaggle.com/datasets/mlg-ulb/creditcardfraud). The dataset consists of 284,807 anonymised credit card transactions for which 492 are fraudulent. The task is to build a classifier to detect the fraudulent transactions.\nThe Data for this project is licensed for any purpose including commercial use under the [Open Data Commons](https://opendatacommons.org/licenses/dbcl/1-0/).\nI have used a deep learning approach leveraging the [Ludwig](https://ludwig.ai/latest/) , an open-source [framework](https://medium.com/towards-data-science/ludwig-a-friendlier-deep-learning-framework-946ee3d3b24) for declarative deep learning. I won't go into the details of Ludwig here, however I have previously written an article on the framework.\nThe Ludwig deep neural network is configured with a **.yaml** file. For those that are curious you can find this in the [model registry GitHub](https://github.com/john-adeojo/Credit-Card-Fraud-Model-Registry/blob/main/model%20yaml%20files/model_1a.yaml).\n* * *\n## Building Modular Pipelines with Kedro\nBuilding modular machine learning pipelines has been made easier with open-source tools, my favourite of these is [Kedro](https://kedro.org/). Not only because I have seen this used successfully in industry, but also because it helped me develop my software engineering skills.\nKedro is an open-source framework (licensed under Apache 2.0) for creating reproducible, maintainable and modular data science code. I came across it while I was developing the AI strategy for a bank, considering which tools my team could utilise to build production-ready code.\n_Disclaimer: I have no affiliation with Kedro or McKinsey's QuantumBlack, the creators of this open-source tool._\n* * *\n## The Model Training Pipeline\n![Image by Author: End-to-end model training pipeline generated with Kedro viz](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/06/1L_i4EMfwHoHcXIcQLpRKmQ.png)\nImage by Author: End-to-end model training pipeline generated with Kedro viz\nKedro conveniently allows you to visualise your pipelines, a fantastic feature that can help bring clarity to your code. The pipeline is standard for machine learning so I will only briefly touch on each aspect.\n  1. **Import Data** : Import the credit card transaction data from an external source.\n  2. **Split Data** : Use random split to split the data into training and holdout sets.\n  3. **Run Experiment** : Uses the Ludwig framework to train a deep neural network on the train data set. The Ludwig experiment API conveniently saves model artefacts for every experiment run.\n  4. **Run Predictions** : Uses the model trained in the previous step to run predictions on the holdout dataset.\n  5. **Model Diagnostics** : Produces two diagnostic charts. First, the tracking the cross-entropy loss over each epoch. Second, the [ROC curve](https://en.wikipedia.org/wiki/Receiver_operating_characteristic) measuring the model's performance on the holdout dataset.\n\n\n![Image by Author: Loss Curve from model training process](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/06/18gE4vKcdlo0IkWnyYErnyg.png)\nImage by Author: Loss Curve from model training process\n![Image by Author: ROC Curve from model evaluation on the holdout dataset](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/06/1exjfkOnD2JPpkAaEOlTghw.png)\nImage by Author: ROC Curve from model evaluation on the holdout dataset\n* * *\n## Core Components of the Pipeline\nNow that we have established a high-level view, let's get into some of the core components of this pipeline.\n### Project Structure\ntext\n\n```\nC:.\n├───conf\n│   ├───base\n│   │   └───parameters\n│   └───local\n├───data\n│   ├───01_raw\n│   ├───02_intermediate\n│   ├───03_primary\n│   ├───04_feature\n│   ├───05_model_input\n│   ├───06_models\n│   │   ├───experiment_run\n│   │   │   └───model\n│   │   │       ├───logs\n│   │   │       │   ├───test\n│   │   │       │   ├───training\n│   │   │       │   └───validation\n│   │   │       └───training_checkpoints\n│   │   └───experiment_run_0\n│   │       └───model\n│   │           ├───logs\n│   │           │   ├───test\n│   │           │   ├───training\n│   │           │   └───validation\n│   │           └───training_checkpoints\n│   ├───07_model_output\n│   └───08_reporting\n├───docs\n│   └───source\n│  \n└───src\n    ├───fraud_detection_model\n    │   ├───pipelines\n    │       ├───train_model\n    └───tests\n        └───pipelines\n```\n\nKedro provides a templated directory structure that is established when you initiate a project. From this base, you can programmatically add more pipelines to your directory structure. This standardised structure ensures that every machine learning project is identical and easy to document, thereby facilitating ease of maintenance.\n### Data Management\nData plays a crucial role in machine learning. The ability to track your data becomes even more essential when employing machine learning models in a commercial setting. You often find yourself facing audits, or the necessity to productionise or reproduce your pipeline on someone else's machine.\nKedro offers two methods for enforcing best practices in data management. The first is a directory structure, designed for machine learning workloads, providing distinct locations for the intermediate tables produced during data transformation and the model artefacts. The second method is the [data catalogue](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/conf/base/catalog.yml). As part of the Kedro workflow, you are required to register datasets within a .yaml configuration file, thereby enabling you to leverage these datasets in your pipelines. This approach may initially seem unusual, but it allows you and others working on your pipeline to track data with ease.\n### Orchestration - Nodes and Pipelines\nThis is really where the magic happens. Kedro provides you with pipeline functionality straight out of the box.\nThe initial building block of your [pipeline](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/src/fraud_detection_model/pipelines/train_model/pipeline.py) is the [nodes](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/src/fraud_detection_model/pipelines/train_model/nodes.py). Each executable piece of code can be encapsulated within a Node, which is simply a Python function that accepts an input and yields an output. You can then structure a pipeline as a series of nodes. Pipelines are easily constructed by invoking the node and specifying the inputs and outputs. Kedro determines the execution order.\nOnce pipelines are constructed, they are registered in the provided **pipeline_registry.py** file. The beauty of this approach is that you can create multiple pipelines. This is particularly beneficial in machine learning, where you might have a data processing pipeline, a model training pipeline, an inference pipeline, and so forth.\nOnce set up, it's straightforward enough to modify aspects of your pipeline.\n### Configuration\nKedro's best practices stipulate that all configurations should be handled through the provided [**parameters.yml**](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/conf/base/parameters.yml) file. From a machine learning perspective, hyperparameters fall into this category. This approach streamlines experimentation, as you can simply substitute one **parameters.yml** file with a set of hyperparameters for another, which is also much easier to track.\nI have also included the locations of my Ludwig deep neural network [**model.yaml**](https://github.com/john-adeojo/Credit-Card-Fraud-Model-Registry/blob/main/model%20yaml%20files/model_1a.yaml) and the data source within the **parameters.yml** configuration. Should the model or the location of the data change - for instance, when moving between developers' machines - it would be incredibly straightforward to adjust these settings.\n### Reproducibility\nKedro includes a [**requirements.txt**](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/src/requirements.txt) file as part of the templated structure. This makes it really straightforward to monitor your environment and exact library versions. However, should you prefer, you can employ other environment management methods, such as an **environment.yml** file.\n* * *\n## Establishing a Workflow\nIf you're developing machine learning pipelines and considering using Kedro, it can initially present a steep learning curve, but adopting a standard workflow will simplify the process. Here's my suggested workflow:\n  1. **Establish your working environment** : I prefer using Anaconda for this task. I typically use an [**environment.yml**](https://github.com/john-adeojo/kedro-project/blob/main/environment.yml) file, containing all the dependencies needed for my environment, and employ the Anaconda Powershell command line to [create](https://gist.github.com/john-adeojo/fa22082328e65d0260fefd9b149e4b69) my environment from this.\n  2. **Create a Kedro project** : Once you have Kedro installed - which should hopefully be declared in your **environment.yml** - you can [create](https://docs.kedro.org/en/stable/get_started/new_project.html) a Kedro project through the [Anaconda](https://www.anaconda.com/) command line interface.\n  3. **Explore in Jupyter Notebooks** : I construct an initial pipeline in Jupyter notebooks, a process familiar to most data scientists. The only difference is that, once your pipeline is built, you should tidy it up so that each cell could serve as one Node in your Kedro pipeline.\n  4. **Register your data** : Record the input and outputs for each data processing or data ingestion step in the data [catalogue](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/conf/base/catalog.yml).\n  5. **Add your pipeline** : After conducting your exploration in notebooks, you'll want to [create a pipeline](https://docs.kedro.org/en/stable/tutorial/create_a_pipeline.html#:~:text=Note,the%20starter%20project.). This is achieved through the command line interface. Running this command will add an additional folder to 'pipelines', bearing the name of the pipeline you've just created. It's within this folder that you'll construct your nodes and pipelines.\n  6. **Define your pipeline** : This is the stage where you start transferring the code from your Jupyter notebooks into the [**node.py**](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/src/fraud_detection_model/pipelines/train_model/nodes.py) file in your pipeline folder, ensuring that nodes you intend to be part of a pipeline have inputs and outputs. Once the nodes are set up, proceed to define your pipeline in the [**pipeline.py**](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/src/fraud_detection_model/pipelines/train_model/pipeline.py) file.\n  7. **Register your pipelines** : The [**pipeline_registry.py**](https://github.com/john-adeojo/kedro-project/blob/main/fraud-detection/src/fraud_detection_model/pipeline_registry.py) file offers a template for you to register your newly created pipeline.\n  8. **Run your project** : Once established, you can [run](https://docs.kedro.org/en/stable/nodes_and_pipelines/run_a_pipeline.html) any pipeline through the CLI and also [visualise](https://docs.kedro.org/en/stable/visualisation/index.html) your project.\n\n\n* * *\nProduction-ready pipelines fit into a wider ecosystem of machine learning operations. Read my article on MLOps for a deeper dive.\n> [**Building Machine Learning Operations for Businesses**](https://towardsdatascience.com/building-machine-learning-operations-for-businesses-6d0bfbbf2139)\n## Conclusion\nKedro is an excellent framework for delivering production-ready machine learning pipelines. Beyond the functionality discussed in this article, there are numerous integrations with other open-source libraries, as well as packages for documentation and testing. Kedro doesn't solve every issue related to model deployment - for instance, model versioning is likely better handled by another tool such as DVC. However, it will assist data scientists in a commercial setting to produce more maintainable, modular, and reproducible code that is ready for production. There is a relatively steep learning curve for complete novices, but the documentation is clear and includes guided tutorials. As with any of these packages, the best way to learn is to dive in and experiment.\nLink to the full [GitHub repo](https://github.com/john-adeojo/kedro-project/tree/main)\n* * *\n_Follow me on_[ _LinkedIn_](https://www.linkedin.com/in/john-adeojo/)\n_Subscribe to medium to get more insights from me:_\n> [**Join Medium with my referral link - John Adeojo**](https://johnadeojo.medium.com/membership)\n_Should you be interested in integrating AI or data science into your business operations, we invite you to schedule a complimentary initial consultation with us:_\n> [**Book Online | Data-Centric Solutions**](https://www.data-centric-solutions.com/book-online)\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](https://assets.insightmediagroup.io/media/1787657091747_phu3q1.png)\nWritten By\n## [John Adeojo](https://towardsdatascience.com/author/johnadeojo/)\n[See all from John Adeojo](https://towardsdatascience.com/author/johnadeojo/)\n[Data Science](https://towardsdatascience.com/tag/data-science/)[Kedro](https://towardsdatascience.com/tag/kedro/)[Machine Learning](https://towardsdatascience.com/tag/machine-learning/)[Machine Learning Pipeline](https://towardsdatascience.com/tag/machine-learning-pipeline/)[Programming](https://towardsdatascience.com/tag/programming/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fbuild-deployable-machine-learning-pipelines-a6d7035816a6%2F&title=Build%20Deployable%20Machine%20Learning%20Pipelines)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fbuild-deployable-machine-learning-pipelines-a6d7035816a6%2F&title=Build%20Deployable%20Machine%20Learning%20Pipelines)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fbuild-deployable-machine-learning-pipelines-a6d7035816a6%2F&text=Build%20Deployable%20Machine%20Learning%20Pipelines)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/10/0yeZ0LAbrc9VFkWQB-scaled.jpg)](https://towardsdatascience.com/whisper-transcribe-translate-audio-files-with-human-level-performance-df044499877/)\n## [Whisper: Transcribe & Translate Audio Files With Human-Level Performance](https://towardsdatascience.com/whisper-transcribe-translate-audio-files-with-human-level-performance-df044499877/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nAn AI model compatible with 97 languages - and how to use it\n[Nikos Kafritsas](https://towardsdatascience.com/author/nikoskafritsas/)\nOctober 7, 202210 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2025/01/0O-LlRFpAIIY9XO-I-scaled.jpg)](https://towardsdatascience.com/data-engineering-orm-and-odm-with-python-cff97532e464/)\n## [Data Engineering - ORM and ODM with Python](https://towardsdatascience.com/data-engineering-orm-and-odm-with-python-cff97532e464/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nManipulate database data leveraging an object-oriented programming paradigm\n[Marcello Politi](https://towardsdatascience.com/author/marcellopoliti/)\nJanuary 2, 20256 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/11/1L5ZALW1StatGr_mb_D6cnw-scaled.jpeg)](https://towardsdatascience.com/text-preprocessing-with-data-describe-7ba175cf8447/)\n## [Text Preprocessing with data-describe](https://towardsdatascience.com/text-preprocessing-with-data-describe-7ba175cf8447/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nCleaning up messy text using open-source EDA accelerator \"data-describe\"\n[Rishi Sheth](https://towardsdatascience.com/author/sheth108/)\nNovember 10, 20207 min read\n  * [![](https://towardsdatascience.com/images/fallback-image.jpg)](https://towardsdatascience.com/a-function-that-makes-your-initial-eda-a-breeze-8e9549d69fb3/)\n## [A Function That Makes Your Initial EDA a Breeze](https://towardsdatascience.com/a-function-that-makes-your-initial-eda-a-breeze-8e9549d69fb3/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nThis function using Seaborn creates visuals for your project in no time.\n[Katie Sylvia](https://towardsdatascience.com/author/katiesylvia/)\nAugust 22, 20212 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/08/07q-IsQV-iJddOfgC-scaled.jpg)](https://towardsdatascience.com/lets-impute-missing-values-with-sql-e350c89d9e2a/)\n## [Let's Impute Missing Values with SQL](https://towardsdatascience.com/lets-impute-missing-values-with-sql-e350c89d9e2a/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nAutomated and easy-to-understand script to get the job done.\n[Dario Radečić](https://towardsdatascience.com/author/radecicdario/)\nAugust 25, 20207 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/11/0IeGVSkNtr7V7Lpwq-scaled.jpg)](https://towardsdatascience.com/efficient-coding-in-data-science-easy-debugging-of-pandas-chained-operations-0089f6de920f/)\n## [Efficient Coding in Data Science: Easy Debugging of Pandas Chained Operations](https://towardsdatascience.com/efficient-coding-in-data-science-easy-debugging-of-pandas-chained-operations-0089f6de920f/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nHow to inspect Pandas data frames in chained operations without breaking the chain into separate statements\n[Marcin Kozak](https://towardsdatascience.com/author/nyggus/)\nNovember 15, 20239 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/08/1cmXU8SzyY9_4xw3RZpQ2xQ-scaled.jpeg)](https://towardsdatascience.com/the-world-of-sql-joins-c70ca7f36f04/)\n## [The World of SQL Joins](https://towardsdatascience.com/the-world-of-sql-joins-c70ca7f36f04/)\n[Programming](https://towardsdatascience.com/category/programming/)\nJoin Me on a Journey!\n[JB](https://towardsdatascience.com/author/josephburton06/)\nAugust 24, 20218 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/10/1cgfP6rpOhtOmxCgricoo7A.png)](https://towardsdatascience.com/simplifying-transformers-state-of-the-art-nlp-using-words-you-understand-part-5-decoder-and-cd2810c6ad40/)\n## [Simplifying Transformers: State of the Art NLP Using Words You Understand - part 5- Decoder and...](https://towardsdatascience.com/simplifying-transformers-state-of-the-art-nlp-using-words-you-understand-part-5-decoder-and-cd2810c6ad40/)\n[Deep Learning](https://towardsdatascience.com/category/artificial-intelligence/deep-learning/)\nLast part of the Transformer series\n[Chen Margalit](https://towardsdatascience.com/author/chenmargalit/)\nOctober 5, 20237 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/05/1jiYA3NC1O3-x-80WlBy40w.png)](https://towardsdatascience.com/sql-case-study-investigating-a-drop-in-user-engagement-510b27d0cbcc/)\n## [SQL Case Study: Investigating a Drop in User Engagement](https://towardsdatascience.com/sql-case-study-investigating-a-drop-in-user-engagement-510b27d0cbcc/)\n[Programming](https://towardsdatascience.com/category/programming/)\nA Real-Life Data Analyst Case Study\n[Terence Shin, MSc, MBA](https://towardsdatascience.com/author/terenceshin/)\nMay 21, 20209 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607686/image?etag=1782161464448&width=500&height=500) How Relevance Models Foreshadowed Transformers for NLP ](https://towardsdatascience.com/how-relevance-models-foreshadowed-transformers-for-nlp/ \"How Relevance Models Foreshadowed Transformers for NLP\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500) Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1 ](https://towardsdatascience.com/javascript-fatigue-you-dont-need-js-to-build-chatgpt/ \"Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ \"Does Your Company Have a Data Strategy?\")\n\n\n",
  "body_base_path": "attachments/d99a1f61df71/pages/",
  "body_markdown_path": "attachments/d99a1f61df71/pages/archived-body.md",
  "local_html": "attachments/d99a1f61df71/pages/archived-body.html",
  "body_source": "prior_capture"
}