Run an interpretation¶
Initialize a client with the 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')
Loading Data¶
Import the file creditcard.csv
from S3 to the Driverless AI server and name the dataset 'creditcard-mli-interpretation'.
In [2]:
Copied!
ds = dai.datasets.create(
data='s3://h2o-public-test-data/mli-testing/manual-test/small-dataset/binomial/creditcard.csv',
data_source='s3',
name='creditcard-mli-interpretation'
)
ds = dai.datasets.create(
data='s3://h2o-public-test-data/mli-testing/manual-test/small-dataset/binomial/creditcard.csv',
data_source='s3',
name='creditcard-mli-interpretation'
)
Complete 100.00% - [4/4] Computed stats for column default payment next month
Create an experiment¶
Create a binomial classification experiment using Driverless AI.
The dai.experiments.create()
function waits for the experiment to complete, and then returns an experiment object that can be used to run an interpretation.
In [3]:
Copied!
ex = dai.experiments.create(train_dataset=ds,
target_column='default payment next month',
task='classification',
accuracy=1,
time=1,
interpretability=1,
name='creditcard-mli-interpretation')
ex = dai.experiments.create(train_dataset=ds,
target_column='default payment next month',
task='classification',
accuracy=1,
time=1,
interpretability=1,
name='creditcard-mli-interpretation')
Experiment launched at: http://localhost:12345/#/experiment?key=8810c64a-bf61-11ed-863e-d83bbfdbe6ce Complete 100.00% - Status: Complete
Create Interpretation¶
Interpret the experiment using the default explainers.
In [4]:
Copied!
interpretation = dai.mli.create(
experiment=ex,
name="creditcard-mli-interpretation"
)
interpretation = dai.mli.create(
experiment=ex,
name="creditcard-mli-interpretation"
)
Complete 100.00% - Interpretation successfully finished.
Explainer graphs must be viewed through the GUI.
In [5]:
Copied!
interpretation.gui()
interpretation.gui()
In [ ]:
Copied!