Use a Custom Model

First, we’ll initialize a client with our server credentials and store it in the variable dai.

import driverlessai

dai = driverlessai.Client(address='http://localhost:12345', username='py', password='py')

Here we grab a custom recipe from our recipe repo ( and upload it to the Driverless AI server.

Complete 100%

It’s also possible to use the same function to upload recipes that we have written locally.

Complete 100%

We can create a list of custom model recipe objects.

custom_models = [m for m in if m.is_custom]
[<class ''> CatBoost Model,
 <class ''> KNearestNeighbour Model,
 <class ''> LinearSVM Model]

For demonstration purposes, we’ll grab the first dataset available on the server. Then, we’ll use it to get an experiment preview. Note that CatBoost and KNearestNeighbour are now listed as ‘models to train’.

ds = dai.datasets.list()[0]
ACCURACY [7/10]:
- Training data size: *150 rows, 5 cols*
- Feature evolution: *[CatBoost, KNearestNeighbour]*, *3-fold CV**, 2 reps*
- Final pipeline: *Ensemble (3 models), 3-fold CV*

TIME [2/10]:
- Feature evolution: *8 individuals*, up to *42 iterations*
- Early stopping: After *5* iterations of no improvement

- Feature pre-pruning strategy: Permutation Importance FS
- Monotonicity constraints: enabled
- Feature engineering search space: [CVCatNumEncode, CVTargetEncode, CatOriginal, Cat, Frequent, Interactions, NumCatTE, Original, Text]

[CatBoost, KNearestNeighbour] models to train:
- Model and feature tuning: *192*
- Feature evolution: *288*
- Final pipeline: *3*

Estimated runtime: *minutes*
Auto-click Finish/Abort if not done in: *1 day*/*7 days*