Build Models with Autopilot

cancel
Showing results for 
Search instead for 
Did you mean: 


Build Models with Autopilot

Models are the main object you can create with DataRobot. You can use them to make predictions. You can build a model using curl commands from the REST API or using our Python SDK.

There are two steps to building a model.

  1. Create a project.
  2. Build a model.

Once you have built your models using Autopilot, you can create a deployment using the best model. Learn how to create a deployment here. Learn about evaluating models here. You can access the DataRobot Python documentation here.

You can get the sample code for this workflow and snippets in DataRobot Community GitHub.

Build Models with the REST API

Requirements

  • api_key—found in your profile in the platform.
  • Created project (learn here)
  • projectId—returned from above request or from project URL (first number).
    For example, app.datarobot.com/projects/<projectid>/models.
  • target_feature—the feature or column that you are trying to predict.

Terminal Request

 

curl -v \
-X PATCH \
-H 'Authorization: Bearer API_KEY' \
-H 'Content-Type: application/json' \
--data '{"target": TARGET_FEATURE}' 
YOUR_DR_URL/api/v2/projects/PROJECT_ID/aim/

 

Example Request

(cURL sample)

 

API_KEY=YOUR_API_KEY
PROJECT_ID=YOUR_PROJECT_ID
TARGET=YOUR_TARGET_FEATURE
ENDPOINT=YOUR_DR_URL/api/v2/projects/$PROJECT_ID/aim

curl -v \
-X PATCH \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
--data "{\"target\":\"$TARGET\"}" 
$ENDPOINT

 

Build Model using Python

Requirements

  • API Key—profile in the platform.
  • Import DataRobot Package and be connected to DataRobot (learn here)
  • Created project (learn here)
  • target— column that you want to predict
  • mode— run Autopilot

Code

 

import datarobot as dr 
project.set_target(target= <target>,mode= <mode>)

 

Example

(Python sample)

 

import datarobot as dr 
project.set_target(target=’readmitted’, mode=dr.AUTOPILOT_MODE.FULL_AUTO)

 

Labels (3)
Version history
Last update:
‎04-15-2020 04:53 PM
Updated by:
Contributors