How-To: Converting Existing ML Code to an MLRun Project
Overview
This demo demonstrates how to convert existing machine-learning (ML) code to an MLRun project.
The demo implements an MLRun project for taxi ride-fare prediction based on a Kaggle notebook with an ML Python script that uses data from the New York City Taxi Fare Prediction competition.
Running the Demo
To run the demo, simply open the mlrun-code.ipynb notebook from an environment with a running MLRun service and run the code cells.
Demo Flow
The code includes the following components:
- Data ingestion — ingest NYC taxi-rides data.
- Data cleaning and preparation — process the data to prepare it for the model training.
- Model training — train an ML model that predicts taxi-ride fares.
- Model serving — deploy a function for serving the trained model.
Pipeline Output
Notebooks and Code
- original-code.ipynb — contains the original ML script to be converted.
- mlrun-code.ipynb — the main demo notebook (“all in one”), which contains the MLRun equivalent of the code from the original-code.ipynb notebook.
- model-serving.ipynb — a model-serving function (used from mlrun-code-.ipynb).