Create a Project

[1]:
import driverlessai

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

Using the client’s project attribute, we can work with projects on the Driverless AI server. Read more about the projects API here.

First, let’s see what projects are available on the server.

[2]:
dai.projects.list()
[2]:
    | Type   | Key   | Name
----+--------+-------+--------

There aren’t any yet! So, lets make one and save the server object to the variable project. Read more about the project object API here.

[3]:
project = dai.projects.create(
    name="Example",
    description="For Driverless AI Python client documenation."
)

Now, we can see our new project on the server.

[4]:
dai.projects.list()
[4]:
    | Type    | Key                                  | Name
----+---------+--------------------------------------+---------
  0 | Project | 9e1599d6-17ef-11ec-817e-0242c0a8fe02 | Example

However, our project has no experiments attached.

[5]:
project.experiments
[5]:
    | Type   | Key   | Name
----+--------+-------+--------

Lets attach the latest experiment on the server.

[6]:
experiment = dai.experiments.list()[0]
project.link_experiment(experiment=experiment)
[6]:
<driverlessai._projects.Project at 0x7fcd45a86eb8>

We can now see the experiment linked to the project.

[7]:
project.experiments
[7]:
    | Type       | Key                                  | Name
----+------------+--------------------------------------+----------
  0 | Experiment | 01ef979c-fbec-11eb-9e96-0242c0a8fe02 | fowopupa

We can also see the datasets from the experiment are attached to the project.

[8]:
project.datasets["train_datasets"]
[8]:
    | Type    | Key                                  | Name
----+---------+--------------------------------------+----------
  0 | Dataset | ecbe2a46-fbeb-11eb-9e96-0242c0a8fe02 | cc_train
[9]:
project.datasets["test_datasets"]
[9]:
    | Type    | Key                                  | Name
----+---------+--------------------------------------+---------
  0 | Dataset | ecbe98c8-fbeb-11eb-9e96-0242c0a8fe02 | cc_test