---
title: "Check if data diversity metrics exist"
method: GET
path: "/api/{projectId}/raw-data/data-quality/diversity/exists"
tags: ["Raw data"]
---

# Check if data diversity metrics exist

`GET /api/{projectId}/raw-data/data-quality/diversity/exists`

## Request

- Base URL: `https://studio.edgeimpulse.com/v1`
- URL: `https://studio.edgeimpulse.com/v1/api/{projectId}/raw-data/data-quality/diversity/exists`
- Auth: one of:
  - API key in header `x-api-key`
  - API key in cookie `jwt`
  - API key in header `x-jwt-token`
  - OAuth 2
    - Authorization code: `/v1/oauth/authorize`
    - Client credentials
    - Implicit: `/v1/oauth/authorize`
    - Password
    - Token URL: `/v1/oauth/token`
- TypeScript: <https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/docs/api/:projectId/raw-data/data-quality/diversity/exists/get.ts> (a function with typed inputs; its response is checked against the schema)

Determine if data diversity metrics have been calculated. To calculate these metrics, use the `calculateDataQualityMetrics` endpoint.

## Path parameters

- `projectId` integer, required

## Response `200`

OK

- HasDataExplorerFeaturesResponse
  - `success` boolean, required: Whether the operation succeeded
  - `error` string: Optional error description (set if 'success' was false)
  - `hasFeatures` boolean, required
  - `inputBlock` ImpulseInputBlock
    - `id` integer, required: Identifier for this block. Make sure to up this number when creating a new block via `getNewBlockId`, and don't re-use identifiers. If the block hasn't changed, keep the ID as-is. ID must be unique across the project and greather than zero (>0).
    - `type` 'time-series' | 'image' | 'features', required
    - `name` string, required: Block name, will be used in menus
    - `title` string, required: Block title, used in the impulse UI
    - `axes` string[]: Input axes, identified by the name in the name of the axis. If not set, then all axes are selected.
    - `windowSizeMs` integer: Size of the sliding window in milliseconds
    - `windowIncreaseMs` integer: We use a sliding window to go over the raw data. How many milliseconds to increase the sliding window with for each step.
    - `frequencyHz` number: (Input only) Frequency of the input data in Hz
    - `classificationWindowIncreaseMs` integer: We use a sliding window to go over the raw data. How many milliseconds to increase the sliding window with for each step in classification mode.
    - `padZeros` boolean: Whether to zero pad data when a data item is too short
    - `labelingMethodMultiLabel` object: Determines how a single label is assigned to each generated window when source samples contain multiple labels. Available options - end-of-window: use the label active at the end timestamp of the window. - anywhere-in-window: assign one of the configured `labels` when it appears anywhere in the window. - anywhere-in-window-min-percentage: assign one of the configured `labels` only when it covers at least `minPercentage` of the full window. - majority-in-window: assign the label with the highest prevalence across the full window. Tie-breaking: - For count-based modes (anywhere-in-window, anywhere-in-window-min-percentage, and majority-in-window), if two or more candidate labels have equal prevalence, the first encountered label in the window is used.
      - `type` 'end-of-window' | 'anywhere-in-window' | 'anywhere-in-window-min-percentage' | 'majority-in-window', required
      - `labels` string[]: Required when choosing "anywhere-in-window" or "anywhere-in-window-min-percentage". The list of classes that should trigger detection (e.g. "interference").
      - `minPercentage` number: Required when choosing "anywhere-in-window-min-percentage". A label is assigned only if it is present in at least this percentage of the full window.
    - `imageWidth` integer: Width all images are resized to before training
    - `imageHeight` integer: Width all images are resized to before training
    - `resizeMode` 'squash' | 'fit-short' | 'fit-long' | 'crop': Input images are resized automatically before training and testing, to match the impulse input shape. This determines the resize mode used when the aspect ratio of the input data is different to the aspect ratio of the impulse.
    - `resizeMethod` 'lanczos3' | 'nearest': Resize method to use when resizing images
    - `cropAnchor` 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right': If images are resized using a crop, choose where to anchor the crop
    - `createdBy` string: The system component that created the block version (createImpulse | clone | tuner). Cannot be set via API.
    - `createdAt` string, date-time: The datetime that the block version was created. Cannot be set via API.
    - `datasetSubset` ImpulseInputBlockDatasetSubset: Only generate features for samples where (sample_id + datasetSubsetSeed) % datasetSubset) == 0
      - `includePercentage` number, required: Number between 0 and 100, with the % of data that should be _included_
      - `seed` integer: Seed number (optional). If not specified, the seed is set to 0.

---

[API](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api.md) - [All operations](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/llms.txt) - [OpenAPI document](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/revisions/e2a976d38427?raw)
