Saving a Model

This section aims to step down the process of creating, saving, and loading a Data Science model using the notebook infrastructure provided inside the Data Science Lab module.

The Data Science Lab provides an integrated Notebook environment where users can build, train, and operationalize machine learning models. This section describes the end-to-end workflow for creating, saving, and loading a Data Science model using Notebook infrastructure.

Defining & Saving a Data Science Lab Model

  • Navigate to a Data Science Notebook.

  • Write code using the following sequence:

    • Read DataFrame

    • Define test and train data

    • Create a model

  • Execute the script by running the code cell.

  • Get a new code cell.

  • Click the Save model option using the Vertical Ellipsis () icon.

  • A code gets generated in the newly added code cell.

    • Give a model name to specify the model and model type as ml.

    • Execute the code cell.

  • After the code gets executed, the Model gets saved under the Models tab.

Note: The newly saved model gets saved under the unregistered category inside the Models tab.

Function Parameters

  • model - Trained model variable name.

  • modelName - The desired name given by the user for the trained model.

  • modelType - Type in which the model can be saved.

  • X - This array contains the input features or predictors used to train the model. Each row in the X_train array represents a sample or observation in the training set, and each column represents a feature or variable.

  • Y - This array contains the corresponding output or response variable for each sample in the training set. It is also called the target variable, dependent variable, or label. The Y_train array has the same number of rows as the X_train array.

  • estimator_type - The estimator_type of a data science model refers to the type of estimator used.

Loading a Data Science Lab Model

  • Open the Models tab.

  • The saved model will be available under the Models tab (under the All or Unregistered category).

  • Insert a new code cell into the Notebook where you want to load the saved model.

  • Please select the model by using the given checkbox to load it.

  • The model gets loaded into a new cell.

  • Run the cell.

This streamlined workflow enables reproducible model development, convenient version management, and seamless integration into downstream Data Science pipelines.

The saved models will also be listed under the Models page.

Notes: You can register the saved models to be used within the Data Pipeline module, or you can export them as API services.

Last updated