---
title: Getting started with bring your own data
source: https://docs.newrelic.com/docs/mlops/bring-your-own/getting-started-byo
---

This is a guide to getting started with New Relic's bring your own data. You'll learn how to install, run, and experiment with _bring your own data_ , or BYOD, and start monitoring the performance of your machine learning models.

## Quick start [#quick-start]

Using BYOD makes it easy to monitor your machine learning models in 3 main steps:

```python
# 1: Initialize the monitoring
ml_monitor = MLPerformanceMonitoring(...)

# 2: Add your algorithm
y = my_model.predict(X)

# 3: Record your data
ml_monitor.record_inference_data(X, y)
```

Use this example in [colab](https://colab.research.google.com/github/newrelic-experimental/ml-performance-monitoring/blob/main/examples/XGBoost_on_Boston_housing_prices_dataset.ipynb) and easily try an end-to-end example of model monitoring.

## Installation [#installation]

Installation is straightforward and similar to any python library

```python
pip install git+https://github.com/newrelic-experimental/ml-performance-monitoring.git
```

## Implementation [#implementation]

This guide will take you step by step for everything needed to start monitoring your Machine Learning models

### 1. Set Your Environment Variable

Get your license key (also referenced as `ingest - license`) and set it as environment variable: `NEW_RELIC_INSERT_KEY`. [Click here](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#license-key) for more details and instructions.
Are you reporting data to the New Relic EU or JP region? click [here](#EU-account-users) for more instructions.

### 2. Import package

```python
from ml_performance_monitoring.monitor import MLPerformanceMonitoring
```

### 3. Create model monitor

```python
metadata = {"environment": "notebook"}
model_version = "1.0"
features_columns, labels_columns = (
    ["feature_1", "feature_2", "feature_3", "feature_4"],
    ["target"],
)

ml_monitor = MLPerformanceMonitoring(
    insert_key=None,  # set the environment variable NEW_RELIC_INSERT_KEY or send your insert key here
    model_name="My stunning model",
    metadata=metadata,
    features_columns=features_columns,
    labels_columns=labels_columns,
    label_type="numeric",
    model_version=model_version
)
```

### 4. Run your model

```python
y = my_model.predict(X)
```

### 5. Record

```python
ml_performence_monitor_model.record_inference_data(X, y)
```

### 6. Monitor and alert

Done! To check your application go to **[one.newrelic.com](https://one.newrelic.com/all-capabilities)** and see real time data.

## Examples [#examples]

We created these notebooks in Google colab so you can try them out:

1.  [Try out](https://github.com/newrelic-experimental/ml-performance-monitoring/blob/main/examples/XGBoost_on_California_housing_prices_dataset.ipynb) an XGBoost model on [California housing prices](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.fetch_california_housing.html) dataset. Open in [colab](https://colab.research.google.com/github/newrelic-experimental/ml-performance-monitoring/blob/main/examples/XGBoost_on_California_housing_prices_dataset.ipynb).
2.  [Try out](https://github.com/newrelic-experimental/ml-performance-monitoring/blob/main/examples/sklearn.RandomForestClassifier_on_Iris_dataset.ipynb) how to simulate 24 hours of model inference data using New Relic MLOps. Open in [colab](https://colab.research.google.com/github/newrelic-experimental/ml-performance-monitoring/blob/main/examples/sklearn.RandomForestClassifier_on_Iris_dataset.ipynb)

## EU and JP Account Users [#EU-account-users]

If you are using an EU or JP account, send it as a parameter at the `MLPerformanceMonitoring` call if your environment variable is not set:

-   `EVENT_CLIENT_HOST` and `METRIC_CLIENT_HOST`
    -   US region account (default):
        -   `EVENT_CLIENT_HOST: insights-collector.newrelic.com`
        -   `METRIC_CLIENT_HOST: metric-api.newrelic.com`
    -   EU region account:
        -   `EVENT_CLIENT_HOST: insights-collector.eu01.nr-data.net`
        -   `METRIC_CLIENT_HOST: metric-api.eu.newrelic.com/metric/v1`
    -   JP region account:
        -   `EVENT_CLIENT_HOST: insights-collector.jp.nr-data.net`
        -   `METRIC_CLIENT_HOST: metric-api.jp.nr-data.net/metric/v1`

It can also be sent as parameters at the `MLPerformanceMonitoring` call.
