Transform dataset using trained model¶
First, initialize a client with your server credentials and store them in the variable dai
.
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')
Next, get the experiment that you want to use to transform the dataset.
In [2]:
Copied!
experiments = dai.experiments.list()
ex = experiments[0]
experiments = dai.experiments.list()
ex = experiments[0]
Then get the dataset that you want to transform.
In [3]:
Copied!
datasets = dai.datasets.list()
datasets
datasets = dai.datasets.list()
datasets
Out[3]:
| Type | Key | Name ----+---------+--------------------------------------+-------------------------- 0 | Dataset | 089a771c-9aef-11ed-a571-18c04d3b1abd | CreditCard_Cat-train.csv 1 | Dataset | 0897f88e-9aef-11ed-a571-18c04d3b1abd | CreditCard_Cat-test.csv
In [4]:
Copied!
ds = datasets[1]
ds = datasets[1]
Transform the dataset.
In [5]:
Copied!
transformed_data = ex.transform(ds)
transformed_data = ex.transform(ds)
Complete
Finally, download the transformed dataset.
In [6]:
Copied!
transformed_data.download(dst_dir="./", dst_file="transformed_data.csv")
transformed_data.download(dst_dir="./", dst_file="transformed_data.csv")
Downloaded 'transformed_data.csv'
Out[6]:
'transformed_data.csv'