# Composable ML Quickstart
URL: https://docs.datarobot.com/en/docs/classic-ui/modeling/special-workflows/cml/cml-quickstart.html

> This quickstart provides an example that walks you through testing and learning Composable ML so that you can then apply it against your own use case.

# Composable ML Quickstart

Composable ML gives you full flexibility to build a custom ML algorithm and then use it together with other built-in capabilities (like the model Leaderboard or MLOps) to streamline your end-to-end flow and improve productivity. This quickstart provides an example that walks you through testing and learning Composable ML so that you can then apply it to your own use case.

In the following sections, you will build a blueprint with a custom algorithm. Specifically, you will:

1. Create a project and open the blueprint editor.
2. Replace the missing values imputation task with a built-in alternative.
3. Create a custom missing values imputation task.
4. Add the custom task into a blueprint and train.
5. Evaluate the results and deploy.

## Create a project and open the blueprint editor

This example replaces a built-in Missing Values Imputed task with a custom imputation task. To begin, create a project and open the blueprint editor.

1. Start a project with the10K Lending Club Loansdataset. You can download it and import as a local file or provide the URL. Use the following parameters to configure a project:
2. When available, expand a model on the Leaderboard to open theDescribe > Blueprinttab. ClickCopy and editto open theblueprint editor, where you can add, replace, or remove tasks from the blueprint (as well as save the blueprint to the AI Catalog).

## Replace a task

Replace the Missing Values Imputed task within the blueprint with an alternate and save the new blueprint to the AI Catalog.

1. SelectMissing Values Imputedand then click the pencil icon () to edit the task.
2. In the resulting dialog,select an alternatemissing values imputation task. Once selected, clickUpdateto modify the task.
3. ClickAdd to AI Catalogto save it to theAI Catalogfor further editing, use in other projects, and sharing.
4. Evaluate potential issues by hovering on any highlighted task. When you have confirmed that all tasks are okay,train the model.

Once trained, the new model appears in the project’s Leaderboard where you can, for example, compare accuracy to other blueprints, explore insights, or deploy the model.

## Create a custom task

To use an algorithm that is not available among the built-in tasks, you can define a custom task using code. Once created, you then upload that code as a task and use it to define one or multiple blueprints. This part of the quickstart uses one of the [task templates](https://github.com/datarobot/datarobot-user-models/tree/master/task_templates) provided by DataRobot; however, you can also [create your own](https://docs.datarobot.com/en/docs/classic-ui/modeling/special-workflows/cml/cml-custom-tasks.html) custom task.

When you have finished writing task code (locally), making the custom task available within the DataRobot platform involves three steps:

1. Add a new custom task in the Model Registry.
2. Select the environment where the task runs.
3. Upload the task code into DataRobot.

### Add a new task

To create a new task, navigate to Model Registry > Custom Model Workshop > Tasks and select + Add new task.

1. Provide a name for the task, MVI in this example.
2. Select thetask type, eitherEstimatororTransform. This example creates a transform (since missing values imputation is a transformation). If you create a custom estimatorWhen creating an estimator task, select the target (project) type where the task will be used. As an estimator, it can only then be used with the identified project type.
3. ClickAdd Custom Task.

### Select the environment

Once the task type is created, select the container environment where the task will run. This example uses one of the environments provided by DataRobot but you can also create your own [custom environment](https://docs.datarobot.com/en/docs/classic-ui/mlops/deployment/custom-models/custom-model-environments/custom-environments.html#create-a-custom-environment).

Under Transform Environment, click Base Environment and select [DataRobot] Python 3 Scikit-Learn Drop-In.

### Upload task content

Once you select an environment, the option to load task content (code) becomes available. You can import it directly from your local machine or, as in this example, upload it from a remote repository. If you haven't added a remote repository, [add and authorize the DataRobot Model Runner repository in GitHub](https://docs.datarobot.com/en/docs/classic-ui/mlops/deployment/custom-models/custom-model-workshop/custom-model-repos.html#github-repository), providing `https://github.com/datarobot/datarobot-user-models` as the repository location.

To pull files from the DRUM repository:

1. UnderCreate Transform, in theTransformgroup box, clickSelect remote repository. If theTransformgroup box is empty, make sure you selected aBase Environmentfor the task.
2. In theSelect a remote repositorydialog box, select the DRUM repository from the list and clickSelect content. NoteIf you haven't added a remote repository, clickAdd repository > GitHub, andauthorize the GitHub app, providinghttps://github.com/datarobot/datarobot-user-modelsas theRepository location.
3. In thePull from GitHub repositorydialog box, navigate totask_templates/1_transforms/1_python_missing_valuesand select the checkbox for the entire directory you want to pull the task files into your custom task. NoteThis quickstart guide uses GitHub as an example; however, the process is the same for each repository type. TipYou can see how many files you have selected at the bottom of the dialog box (e.g.,+ 2 files will be added).
4. Once you select thetask_templates/1_transforms/1_python_missing_valuesfiles to pull into the custom task, clickPull. Once DataRobot processes the GitHub content, the new task version and the option to apply the task become available. The task version is also saved toModel Registry > Custom Model Workshop > Tasksunder theTransformheader as part of the custom task:

## Apply new task and train

To apply a new task:

1. Return to the Leaderboard and select any model. ClickCopy and Editto modify the blueprint.
2. Select the Missing Values Imputed or Numeric Data Cleansing task and click the pencil () icon tomodify it.
3. In the task window, click on the task name to replace it. UnderCustom, select the task you created. ClickUpdate.
4. ClickTrain(upper right) to open a window where you set training characteristics and create a new model from the Leaderboard.

> [!TIP] Tip
> Consider relabeling your customized blueprint so that it is easy to locate on the Leaderboard.

## Evaluate and deploy

Once trained, the model appears in the project Leaderboard where you can compare its accuracy with other custom and DataRobot models. The icon changes to indicate a user model. At this point, the model is treated like any other model, providing metrics and model-agnostic insights and it can be deployed and managed through MLOps.

Compare metrics:

View [Feature Impact](https://docs.datarobot.com/en/docs/classic-ui/modeling/analyze-models/understand/feature-impact-classic.html):

> [!NOTE] Note
> For models trained from customized blueprints, Feature Impact is always computed using the [permutation-based approach](https://docs.datarobot.com/en/docs/classic-ui/modeling/analyze-models/understand/feature-impact-classic.html#shared-permutation-based-feature-impact), regardless of the project settings.

Use [Model Comparison](https://docs.datarobot.com/en/docs/classic-ui/modeling/analyze-models/other/model-compare.html):

[Deploy the best model](https://docs.datarobot.com/en/docs/classic-ui/mlops/deployment/deploy-methods/deploy-model.html) in a few clicks.

For more information on using Composable ML, see the other available [learning resources](https://docs.datarobot.com/en/docs/classic-ui/modeling/special-workflows/cml/cml-overview.html#get-started-with-composable-ml).

---
