# Definition

The Definition is responsible for providing the structure and types of generating your test data. It consists of a collection of Features, which represent individual data values in a given case.

# Object

definition = hypervector.Definition.get("DEFINITION_UUID")

After edits, you can ensure a local Definition is up-to-date with:

definition.refresh()

Endpoint

GET /v1/definition/<definition_uuid>

# Overview

{
  "definition_uuid": "f9bd49e3-8b2f-487d-848f-3855da2df162",
  "definition_name": "Example Definition",
  "project_uuid": "7239928c-5113-45dc-a6d2-247b03b06bb9",
  "added": "Mon, 08 Mar 2021 22:14:28 GMT",
  "features": [
    {
      "feature_name": "feature_A",
      "feature_uuid": "0ff04287-9aa5-45f5-9a2d-b6a1155357a0",
      "added": "2021-03-08 22:14:28.473646",
      "type": "FLOAT",
      "distribution": {
        "type": "gaussian",
        "mu": 10.5,
        "sigma": 1.5
      }
    },
    {
      "feature_name": "feature_B",
      "feature_uuid": "1727c14c-c6f0-4928-b715-b2362a4bec4b",
      "added": "2021-03-08 22:14:28.493369",
      "type": "INTEGER",
      "distribution": {
        "type": "uniform",
        "min": 49,
        "max": 99
      }
    },
    {
      "feature_name": "feature_C",
      "feature_uuid": "67c8e66e-50d6-4730-9ec3-899653eee302",
      "added": "2021-03-08 22:14:28.506143",
      "type": "STRING",
      "distribution": {
        "type": "categorical",
        "categories": [
          {
            "value": "TRUE",
            "probability": 0.2
          },
          {
            "value": "FALSE",
            "probability": 0.75
          },
          {
            "value": "null",
            "probability": 0.05
          }
        ]
      }
    }
  ],
  "ensembles": [
    {
      "ensemble_name": "eagle-top-arty-door",
      "ensemble_uuid": "0f3959db-9c42-4ca2-8c0f-a2064662c1f2",
      "definition_uuid": "f9bd49e3-8b2f-487d-848f-3855da2df162",
      "added": "Mon, 08 Mar 2021 22:14:56 GMT",
      "size": 1000,
      "benchmarks": [...]
    }
  ]
}

# Attributes

  • definition_uuid: Identifier of Definition
  • definition_name: Name of Definition
  • added: Datetime when Definition was created
  • features: List of Features in this Definition
  • ensembles: List of Ensembles generated by this Definition

# Methods

# All Definitions

hypervector.Definition.list()

Endpoint

GET /v1/definitions

Retrieves list of all Definitions associated with the provided API key

# New Definition

hypervector.Definition.new(
    definition="./path/to/definition/file.json",
    project_uuid="PROJECT_UUID"
)

You can also build a Definition from a dict

definition_dict = {
    "definition_name": "Example definition",
    "features": [...]
}

hypervector.Definition.new(
    definition=definition_dict,
    project_uuid="PROJECT_UUID"
)

Endpoint

POST /v1/definition/new

Creates a new Definition

# Parameters

  • definition: Definition JSON object
  • project_uuid: Identifier of Project to add Definition to

# Delete Definition

hypervector.Definition.delete("DEFINITION_UUID")

Endpoint

DELETE /v1/definition/<definition_uuid>/delete

Deletes an existing Definition