# Predictions and deployments
URL: https://docs.datarobot.com/en/docs/reference/robot-to-robot/rr-mlops.html

> Questions having to do with predictions and DataRobot's central hub to deploy, monitor, manage, and govern all your models in production.

# Predictions and deployments

## MLOps defined

> What is MLOps?

Machine learning operations (MLOps) is a derivative of DevOps; the thought being that there is an entire “Ops” (operations) industry that exists for normal software, and that such an industry needed to emerge for ML (machine learning) as well. Technology (including DataRobot AutoML) has made it easy for people to build predictive models, but to get value out of models, you have to deploy, monitor, and maintain them.  Very few people know how to do this and even fewer than know how to build a good model in the first place.

This is where DataRobot comes in. DataRobot offers a product that performs the "deploy, monitor, and maintain" component of ML (MLOps) in addition to the modeling (AutoML), which automates core tasks with built in best practices to achieve better cost, performance, scalability, trust, accuracy, and more.

> Who can benefit from MLOps?

MLOps can help AutoML users who have problems operating models, as well as organizations that do not want AutoML but do want a system to operationalize their existing models.

Key pieces of MLOps include the following:

- The Model Management piece in which DataRobot provides model monitoring and tracks performance statistics.
- The Custom Models piece makes it applicable to the 99.9% of existing models that weren’t created in DataRobot.
- The Tracking Agents piece makes it applicable even to models that are never brought into DataRobot—this makes it much easier to start monitoring existing models (no need to shift production pipelines).

Learn more about [MLOps](https://docs.datarobot.com/en/docs/api/dev-learning/python/mlops/index.html).

## Stacked predictions

> What are stacked predictions?

DataRobot produces predictions for training data rows by making "stacked predictions," which just means that for each row of data that is predicted on, DataRobot is careful to use a model that was trained with data that does not include the given row.

Learn more about [stacked predictions](https://docs.datarobot.com/en/docs/reference/pred-ai-ref/data-partitioning.html#what-are-stacked-predictions).

## Dedicated Prediction Server vs. Portable Prediction Server

> What is the difference between a Dedicated Prediction Server and a Portable Prediction Sever?

**ELI5:**
Dedicated Prediction Server (DPS)
: You have a garage attached to your house, allowing you to open the door to check in on your car whenever you want.
Portable Prediction Server (PPS)
: You have a garage but it's down the street from your house. You keep it down the street because you want more space to work and for your car collection to be safe from damage when your teenage driver tries to park. However, if you want to regularly check in on your collection, you must install cameras.

**Robot-to-robot:**
Dedicated Prediction Server (DPS)
: A service built into the DataRobot platform, allowing you to easily host and access your models. This type of prediction server provides the easiest path to MLOps monitoring since the platform is handling scoring directly.
Portable Prediction Server (PPS)
: A containerized service running outside of DataRobot, serving models exported from DataRobot. This type of prediction server allows more flexibility in terms of where you host your models, while still allowing monitoring when you configure
MLOps agents
. This can be helpful in cases where data segregation or network performance are barriers to more traditional scoring with a DPS. The PPS might be a good option if you're considering using scoring code but would benefit from the simplicity of the prediction API or if you have a requirement to collect Prediction Explanations.


## Serverless predictions

> What are serverless predictions?

**ELI5:**
You are at a huge concert and need to pick up your tickets at Will Call, along with many other concert attendees. There is a bank of people to hand out tickets, each one handles tickets associated with last names starting with a certain letter. In front of this bank of ticket issuers, there is a person who directs people to the correct ticket issuer based on your name. They take the first person in line, ask the name, then lead them to the correct issuer, then wait for that person to get their ticket before returning to the line and doing the same for the next person. In Serverless, you replace the director with a sign pointing people to the correct issuer, which they can all read at pretty much the same time without having to wait for the person ahead of them.

**Robot-to-Robot:**
In short, Serverless Predictions means that the DataRobot Prediction API is running on Kubernetes, allowing you to run multiple concurrent batch prediction jobs (previously they were queued) and enable or disable real-time predictions.


## Dynamic time warping (DTW)

`Robot 1`

It is my understanding that dynamic time warping attempts to align the endpoint of series that may not be entirely overlapping.

Consider my client's use case, which involves series of movie KPIs from upcoming releases. They get 10-20 weeks of KPIs leading up to a movie's opening weekend. Clearly many time series are not overlapping, but relatively they could be lined up (like 1 week from opening, 2 weeks from opening, etc.). They could do this in R/Python, but I was thinking time series clustering might be able to handle this.

What do I need to know—like series length limitations or minimal overlapping time periods, etc.? Is my understanding of dynamic time warping even correct?

`Robot 2`

Well it would be more about the points in the middle generally rather than the ends.

`Robot 3`

For running [time series clustering](https://docs.datarobot.com/en/docs/classic-ui/modeling/time/ts-clustering.html), you need:

- 10 or more series.
- If you wantKclusters, you need at leastKseries with 20+ time steps. (So if you specify 3 clusters, at least three of your series need to be of length 20 or greater.)
- If you took the union of all your series, the union needs to collectively span at least 35 time steps.

`Robot 3`

In DR, the process of DTW is handled during model building—it shouldn’t require any adjustment from the user. If it errors out, flag it for us so we can see why.

`Robot 3`

So, Robot 1, in more detail than you wanted (and almost surely way sloppier!), the starting and ending points get aligned but there’s additional imputation operations that happen inside that stretch the series.

`Robot 3`

And in DataRobot all this happens under the hood. So, thank a developer 😉

`Robot 1`

Hey Robot 3, the client was very appreciative of this information, so thank you! They did ask if there was any documentation on the guardrails/constraints around time series clustering. Do we have them published somewhere?

`Robot 4`

We have that information in the [documentation](https://docs.datarobot.com/en/docs/reference/pred-ai-ref/ts-reference/ts-consider.html#clustering-considerations)!

---
