> For the complete documentation index, see [llms.txt](https://docs.bdb.ai/data-science-lab-4/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-4/project/tabs-for-a-data-science-lab-project/tabs-for-tensorflow-and-pytorch-environment/notebook/notebook-page/notebook-operations/algorithms.md).

# Algorithms

Get steps on how to do Algorithm Settings and Project level access to use Algorithms inside Notebook.​

{% hint style="info" %}
*<mark style="color:green;">Pre-requisite:</mark>*

1. ***Configure the Algorithms** using the* [***Admin module***](https://docs.bdb.ai/7.6/core-platform/platform-administration/admin-panel-options/configurations/ds-lab-settings) *to access them under the* [***Data Science Lab Project***](https://docs.bdb.ai/7.6/data-science-lab/project/creating-a-project) *creation.*
2. *The user must select Algorithms while creating a Project to make them accessible for a Notebook within the Project.*
   {% endhint %}

{% hint style="success" %}
*Check-out the walk through on how to apply Algorithms inside Notebook.*
{% endhint %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBLGYLEkBUnc8nVEBAuEI%2Fuploads%2FQWxsv68o6GvJd6W21vXp%2FAlgorithms.mp4?alt=media&token=421bd9d1-cb72-4356-ac6d-e41f4abc36cf>" %}
***Using Algorithms in Notebook***
{% endembed %}

The entire process to access the Algorithms option inside the DS Lab and actually create a model based on the Algorithm is a three-step process:

1. ​[**Admin Settings for Algorithms​**](#admin-settings-for-algorithms)
2. [**​Project Level Algorithm Selection​**](#project-level-algorithm-selection)
3. **​**[**Using Algorithm inside a Notebook​**](#using-algorithms-inside-a-notebook)

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark> The first two steps are pre-requisites for the user to avail desired Algorithms inside their DS Lab Projects.*
{% endhint %}

## Admin Settings for Algorithms <a href="#admin-settings-for-algorithms" id="admin-settings-for-algorithms"></a>

* Navigate to the ***Admin*** module.
* Open the ***Notebook Settings*** option from the ***Configuration*** section of the ***Admin*** panel.
* The Notebook Settings page opens.
* Select the ***Algorithms*** using the drop-down option.
* Click the ***Save*** option.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/nhd03pvic85he1jcTpSY/image.png" alt=""><figcaption></figcaption></figure>

* A confirmation message appears to inform about the Notebook details updates.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/cptd7mJO3AprZ1rGRNlO/image.png" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark>*

* ***Regression & Classification** - Default Algorithm types that will be enabled by Admin for each Data Science Lab module user.*
* ***Forecasting, Unsupervised, Natural Language Processing** - These algorithms will be disabled by default. As per user request, they will be enabled by the Admin.*
  {% endhint %}

## Project Level Algorithm Selection <a href="#project-level-algorithm-selection" id="project-level-algorithm-selection"></a>

Once the ***Algorithm settings*** is configured in the ***Admin module***, and the required Algorithms are selected while creating a Data Science Project, the user can access those Algorithms within a Notebook created under the same DSL Project.

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark> Once the Algorithm configuration is completed from the Admin and Project level the same set of Algorithms will be available for all the Notebooks which are part of that DSL Project.*
{% endhint %}

* Navigate to the ***Data Science Lab***.
* Click the ***Create Project*** option.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/WPjvzE4AnPqQfWE2E0yI/image.png" alt=""><figcaption></figcaption></figure>

* Together with the other required fields select the algorithms using the given checkboxes from the drop-down menu.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/UMlfCvEFdLyac3QDO7Xo/image.png" alt=""><figcaption></figcaption></figure>

* The selected Algorithms appear on the field separated by comma.
* ***Save*** the project.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/fKu5Y4SVCrJrtU7wEmsM/image.png" alt=""><figcaption></figcaption></figure>

## Using Algorithms inside a Notebook <a href="#using-algorithms-inside-a-notebook" id="using-algorithms-inside-a-notebook"></a>

Once the Algorithms are selected while creating a Project, those algorithms will be available for all the Notebooks created inside that project.&#x20;

{% hint style="info" %}
*<mark style="color:green;">Prerequisite:</mark> Please activate the Project to access the Notebook functionality inside it.*
{% endhint %}

* Navigate to the ***Notebook tab*** inside the same ***Project.***
* Add a dataset and run it.&#x20;
* Click the ***Algorithms*** tab.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/NF24MzrqGwMeyE65SzlH/image.png" alt=""><figcaption></figcaption></figure>

* The Algorithms tab opens, and the user can see ***the selected Algorithms at the project level*** get listed under the right-side panel of the Notebook.
* Select an algorithm type.
* Add a new code cell in the Notebook.
* Select a sub-algorithm by using the checkbox.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/0BPpFEV1ANRAFjmbvvoO/image.png" alt=""><figcaption></figcaption></figure>

* Define the ***DataFrame*** using another code cell.
* Run the code cell.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/E33SQoiFZcBFt5tQAw2b/image.png" alt=""><figcaption></figcaption></figure>

* After the code cell run gets completed.
* The test data predictions based on the train data appears below.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/gA9urfdnvX684QPhiSXq/image.png" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note</mark>: You can run the cell containing the data frame details to see the data output below:​​​*

![](https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/78EZenIjAeDC5xioqRDC/image.png)
{% endhint %}

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark>*&#x20;

* *The model based on the **Algorithm** can be saved under the **Models** tab.*&#x20;
* *The algorithm based models can be **registered** to be accessed inside the **Data Pipeline** module.*
* *The model based on an Algorithm script can be registered as an API service. You can refer to the **Register a Model as an API Service** section for more details.*
* *Refer the* [***Data Science Lab Quick Start Flow***](https://docs.bdb.ai/data-science-lab-4/data-science-lab-quick-start-flow) *page to get an overview of the **Data Science Lab** module in nutshell.*&#x20;
  {% endhint %}
