Create a Project¶
In [1]:
Copied!
import driverlessai
dai = driverlessai.Client(address='http://localhost:12345', username='py', password='py')
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.
In [2]:
Copied!
dai.projects.list()
dai.projects.list()
Out[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.
In [3]:
Copied!
project = dai.projects.create(
name="Example",
description="For Driverless AI Python client documenation."
)
project = dai.projects.create(
name="Example",
description="For Driverless AI Python client documenation."
)
Now, we can see our new project on the server.
In [4]:
Copied!
dai.projects.list()
dai.projects.list()
Out[4]:
| Type | Key | Name ----+---------+--------------------------------------+--------- 0 | Project | 9e1599d6-17ef-11ec-817e-0242c0a8fe02 | Example
However, our project has no experiments attached.
In [5]:
Copied!
project.experiments
project.experiments
Out[5]:
| Type | Key | Name ----+--------+-------+--------
Lets attach the latest experiment on the server.
In [6]:
Copied!
experiment = dai.experiments.list()[0]
project.link_experiment(experiment=experiment)
experiment = dai.experiments.list()[0]
project.link_experiment(experiment=experiment)
Out[6]:
<driverlessai._projects.Project at 0x7fcd45a86eb8>
We can now see the experiment linked to the project.
In [7]:
Copied!
project.experiments
project.experiments
Out[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.
In [8]:
Copied!
project.datasets["train_datasets"]
project.datasets["train_datasets"]
Out[8]:
| Type | Key | Name ----+---------+--------------------------------------+---------- 0 | Dataset | ecbe2a46-fbeb-11eb-9e96-0242c0a8fe02 | cc_train
In [9]:
Copied!
project.datasets["test_datasets"]
project.datasets["test_datasets"]
Out[9]:
| Type | Key | Name ----+---------+--------------------------------------+--------- 0 | Dataset | ecbe98c8-fbeb-11eb-9e96-0242c0a8fe02 | cc_test