> For the complete documentation index, see [llms.txt](https://docs.bdb.ai/data-science-lab-1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bdb.ai/data-science-lab-1/project/tabs-for-a-data-science-lab-project/tabs-for-tensorflow-and-pytorch-environment/notebook/notebook-page/notebook-operations/models.md).

# Models

{% hint style="info" %}
*Check-out the walk-through on how to save and load a DSL Model.*
{% endhint %}

<figure><img src="https://859511478-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2Fb9vQbnff4mSVi90V6A1h%2FTurn%20your%20Script%20into%20a%20%20Model.gif?alt=media&#x26;token=2528704f-9c6e-4da9-b52c-56835b8b34f4" alt=""><figcaption><p>Saving and loading a model</p></figcaption></figure>

Once the Notebook script is executed successfully, the users can save them as a model. The saved model can be loaded into the Notebook.

## Saving a Data Science Lab Model <a href="#saving-a-dsl-model" id="saving-a-dsl-model"></a>

* Navigate to a Notebook.
* Write code using the following sequence:
  * Read DataFrame
  * Define test and train data
  * Create a model
* Execute the script.

<figure><img src="/files/EtWOkt3bQj65FduRNHzJ" alt=""><figcaption><p><em><strong>Sample Script for a Data Science Model</strong></em></p></figcaption></figure>

* Get a new cell.
* Give a model name to specify the model.
* Execute the cell.
* After the code gets executed, click the ***Save Model*** notebook in a new cell.
* The saved model gets listed under the ***Models*** list.

### **Function Parameters**

* Model - Trained model variable name.
* ModelName - Desired name given by user for the trained model.
* ModelType - Type in which 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 use.

<figure><img src="/files/eh9HXo5IpVOTX0KSNJdt" alt=""><figcaption><p><em><strong>Specify a Data Science Lab Model by giving a name</strong></em></p></figcaption></figure>

## Loading a Data Science Lab Model <a href="#loading-a-dsl-model" id="loading-a-dsl-model"></a>

* Click on a new cell and select the model by using the given checkbox to load it.
* The model gets loaded into a new cell.

<figure><img src="/files/2VNTbPbLH9odo4Rx8aNd" alt=""><figcaption><p><em><strong>Loading a saved Data Science Lab Model</strong></em></p></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark> Refer the **Data Science Lab Quick Start Flow** page to get an overview of the **Data Science Lab** module in nutshell.* [***Click here***](/data-science-lab-1/data-science-lab-quick-start-flow.md) *to get redirected to the quick start flow page.*
{% endhint %}
