> For the complete documentation index, see [llms.txt](https://docs.bdb.ai/bdb-documentation/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/bdb-documentation/data-science-lab/various-tabs-to-work-with/notebook/notebook-page/notebook-operations/transforms.md).

# Transforms

{% hint style="info" %}
*Check out a walk-through on how to use the Transform script inside Notebook.*
{% endhint %}

![](/files/W3GVka7p3uluPVH03GKu)

You can write or upload a script containing transform function to a Notebook and save a model based on it. You can also register the model as an API service. This entire process gets completed in the below given steps:

1. [<mark style="color:blue;">**Saving and loading a Model with Transform script**</mark>](#saving-and-loading-a-model-with-transform-script)
2. [<mark style="color:blue;">**Registering a Transform Model**</mark>](#registering-a-transform-model)
3. [<mark style="color:blue;">**Publishing a Transform Model as API**</mark>](#publish-a-transform-model-as-api)

### Saving and loading a Model with Transform script

* Navigate to a Notebook.
* Add a Code cell (by default one cell gets added in a new Notebook).
* Write or provide a transform script to the cell.
* Run the cell.

![](/files/I4H2GRV0ZkJW5EhsqduC)

* Add a new Code cell.
* Click the ***Save Model*** option to generate the code to save the desired model.
* Specify the model name and model type in the auto-generated script.
* Run the cell.
* The model gets saved under the Transform tab.

![](/files/GawpParwcZjSVlgonPph)

* Add a new Code cell.
* Use the checkbox given next to the saved model to load it.
* Run the cell.

![](/files/CA9gUaB0t6hsYHoF5BCi)

* Add a new Code cell.
* Click the ***Transform*** option.
* Specify the train data.
* Run the cell.

![](/files/tRlebw17t6ZOmNXOPTIj)

* The data output appears below.

![](/files/lcUQM8YrPb1j7C0nClgP)

### Registering a Transform Model

* Open the ***Transforms*** tab inside a Notebook.
* Select the Register option for a listed transform.&#x20;

![](/files/Zl6aO0X8tEV5WTpGfEUk)

* The Register Model dialog box opens to confirm the action.
* Click the ***Yes*** option.

![](/files/8p4BRx4Fi41bDAAI0wWI)

* A confirmation message appears to inform completion of the action.

![](/files/C9BO1qPOkMjOav2ZTeS9)

* The model gets registered and lists under the ***Registered*** list of the models.

![](/files/V4ouNoZBczrufgFdA2NQ)

* Open a pipeline workflow with a DS Lab model runner component.
* The registered model gets listed under the Meta Information tab of the DS Lab model runner component.

![](/files/srJEfcuo5AZ5o8VkrPMD)

### Publishing a Transform Model as API

The Publish Model as API functionality gets completed in three steps:

1. [<mark style="color:blue;">**Register a Transform Model as API**</mark>](#register-a-transform-model-as-api)
2. [<mark style="color:blue;">**Register an API Client**</mark>](#register-an-api-client)
3. [<mark style="color:blue;">**Pass Model Values in Postman**</mark>](#pass-model-values-in-postman)

#### Register a Transform Model as API

* Navigate to the ***Model*** tab.
* Select a saved model from the model list.
* Click the ***Register as API*** option.

![](/files/oSBx3q6cMNaCOGrPQJzg)

* You will get directed to the ***Update Model*** page.
* Provide the ***Max Instance*** option.
* Click the ***Save and Register*** option.

![](/files/3ICHuUDYaPrM4FvjLhst)

* A confirmation message appears to indicate that the Model has been saved and registered (The icon for a registered model appears differently).

![](/files/d0pLfAOz57U56Xb5YPo8)

#### Register an API Client

* Navigate to the ***Admin Module*** from the ***Apps*** menu.

![](/files/LhIW2N6NcyXEi4hP53jE)

* Click on the ***API Client Registration*** option from the Admin panel.

#### ![](/files/lAHs3kFt83sZ2Co4UyvK)

* The ***API Client Registration*** form appears.
* Choose the ***Internal*** option from the ***Select*** drop-down.
* Provide the required details to register the API Client:
  * Client Name
  * Client Email
  * App Name
  * Request Per Hour
  * Request Per Day
  * Select App Type (Select ***Model As API*** option from the drop-down menu).
  * Select the saved model using the ***Select the Services Entitled*** option.
  * Click the ***Save*** option to save the client details.

![](/files/M44pEqETc0WuzBcMZzp4)

* A confirmation message appears to inform about the completion of the client registration action.

![](/files/ICZ8SDXTcukfqBNsUuy3)

* The API client gets registered. You can get the following details from the registered API Client Registration.
  * App Name
  * Client Id
  * Client Secret Key

![](/files/13yLvK0OlIjbEwNic3Sy)

#### Pass Model values in Postman

* Navigate to the Postman application and select POST service.
* Open the ***Headers*** tab.
* Provide the clientid, clientsecret, and appname from the API Client Registration form as explained in the previous step.&#x20;

![](/files/4c65WyCT53J8ROKEr7O2)

* Open the ***Body*** tab.
* Provide the input dataframe.
* Click the ***Send*** option.
* The response will appear below.
* You can save the response by using the ***Save Response*** option.

![](/files/kjq535QVuAfmDC590Lke)
