Train an Unsupervised Model¶
First, initialize a client with your server credentials and store them in the variable dai
.
In [ ]:
Copied!
import driverlessai
dai = driverlessai.Client(address='http://mr-dl28:12353/', username='user', password='user')
import driverlessai
dai = driverlessai.Client(address='http://mr-dl28:12353/', username='user', password='user')
Loading Data¶
Import the iris.csv
file from S3 to the Driverless AI server and name the dataset 'iris-getting-started'.
In [ ]:
Copied!
ds = dai.datasets.create(
data='s3://h2o-public-test-data/smalldata/iris/iris.csv',
data_source='s3',
name='iris-getting-started'
)
ds = dai.datasets.create(
data='s3://h2o-public-test-data/smalldata/iris/iris.csv',
data_source='s3',
name='iris-getting-started'
)
Running Unsupervised Experiment¶
Next, create an experiment preview. To run an unsupervised experiment, you need to set task='unsupervised'
and specify which unsupervised algorithms to use. For example, models=['KMeans', ...]
In [ ]:
Copied!
dai.experiments.preview(
train_dataset=ds,
target_column=None,
task="unsupervised",
models=['KMeans'],
name='unsupervised_model_101'
)
dai.experiments.preview(
train_dataset=ds,
target_column=None,
task="unsupervised",
models=['KMeans'],
name='unsupervised_model_101'
)
Finally, run the experiment:
In [ ]:
Copied!
ex = dai.experiments.create(
train_dataset=ds,
target_column=None,
task="unsupervised",
models=['KMeans'],
name='unsupervised_model_101'
)
ex = dai.experiments.create(
train_dataset=ds,
target_column=None,
task="unsupervised",
models=['KMeans'],
name='unsupervised_model_101'
)