# Active Learning

### Execute Test:

The code snippet below outlines the steps to configure and execute an Active Learning Test, which intelligently selects the most representative samples from your dataset.

**Step 1: Define Active Learning Parameters**

Start by specifying the parameters that will guide the Active Learning process.

```python
active_learning_test = active_learning(test_session=test_session,
                                      dataset_name = dataset_name,
                                      test_name = "active_learning_5",
                                      type = "active_learning",
                                      output_type="curated_dataset",
                                      embed_col_name="hr_embedding",
                                      budget=budget)
                                      
test_session.add(active_learning_test)

test_session.run()
```

* `active_learning()`: Initialises the Active Learning Test.
* `test_session`: The session object associated with your RagaAI project.
* `dataset_name`: The name of the dataset you're looking to optimize.
* `test_name`: A name for this specific test iteration, such as "active\_learning\_5".
* `type`: The type of test, which is "active\_learning" in this case.
* `output_type`: The expected result of the test, "curated\_dataset"
* `embed_col_name`: The column name in your dataset that contains the embeddings, here it is "hr\_embedding" which suggests high-resolution image embeddings.
* `budget`: A variable that defines the limit on the number of data points to select.

`test_session.add()`: Registers the Active Learning Test with the session.

`test_session.run()`: Triggers the execution of all tests that have been added to the session, including your Active Learning Test.

By completing the steps above, you have successfully initiated an Active Learning Test in RagaAI.&#x20;

### Analysing Test Results

<figure><img src="/files/47ktKjfuWrxjptWuJ7FT" alt=""><figcaption></figcaption></figure>

* **Classification**: Each data point is marked as 'included' or 'excluded' based on its representativeness.
* **Inclusion**: The algorithm aims to include as many data points as your budget allows.

#### Reviewing Results

* **Embedding View**: Assess the overall dataset distribution and selected points.
* **Datagrid View**: Browse through individual data points categorised by the test.

#### Image Analysis and Adjustment

* **Image View**: Inspect specific images and their similar counterparts.
* **Manual Adjustment**: Use the include/exclude option to refine your dataset manually.

#### Finalising Dataset

* **Export**: Once satisfied, export the revised dataset as a CSV file.

This test will allow you to maximise the value of your dataset by ensuring that the most informative data points are used within the constraints of your specified budget.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.raga.ai/ragaai-prism/test-inventory/super-resolution/active-learning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
