Saving an AutoAI generated notebook (Beta)
If you want to view the code that created a particular model pipeline, or interact with the model programmatically, you can save a model pipeline as a notebook.
Note: this feature is offered as a tech preview and is subject to change.
The notebook allows you to review the Scikit-Learn source code for the trained model in a notebook.
To save a pipeline as a notebook:
- Complete your AutoAI experiment.
- Select the pipeline you want to save in the leaderboard, and choose Save from the action menu for the pipeline, then Save as notebook.
- Name your notebook, add an optional description, and save it.
- The notebook uses Python 3.7 and
ibm_watson_machine_learningsoftware development kit.
- Notebook code generated using AutoAI will execute successfully. If code is modified or reordered, there is no guarantee it will successfully execute.
Your notebook is added to the containing project as a new notebook asset. You can run, deploy, and score the notebook as you would any notebook model.
What is saved with the notebook
AutoAI saves a representation of the saved pipeline by replacing the optimization steps with the transformers that AutoAI has configured. The code is based on a Scikit-learn library. In the notebook, you can view:
- An authentication template so you can enter your own credentials.
- Annotated code with comments highlighting the pipeline hierarchy and the transformations applied for each step.
- Holdout scoring and cross-validation of the training data, with the underlying changes to some transformers in AutoAI libraries
- Markdown cells that you can edit in the notebook editor.
After you save a pipeline as a notebook, you can review the steps used to compose the pipeline. For more information on the estimators, or algorithms, and transformers that are applied to your data to create the pipeline, refer to Implementation details.
Create a sample notebook
To see for yourself what an AutoAI-generated notebook looks like:
- Follow the steps in AutoAI tutorial.
- After the experiment runs, choose a pipeline, then click Save and Save as notebook.
- Name and save the notebook.
- Open the resulting notebook in the notebook editor and review the code.
Reviewing the code
For details on the methods used in the code, see Autoai-libs.