Skip to content
HALOWERK

Denkwerk

class balance

Counts labels (single-label or multi-label lists), computes shares, the ratio between the most and least frequent class, normalised Shannon entropy (1 = perfectly balanced), classes below a minimum count and balanced class weights n_samples / (n_classes × count) as used by common training libraries.

POST https://denk.halowerk.com/v1/class-balance

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
labelsarrayYes
min_countintegerNo
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "labels"
  ],
  "properties": {
    "labels": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1000000,
      "items": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 200
          },
          {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 200
            }
          }
        ]
      }
    },
    "min_count": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100000,
      "default": 20
    }
  }
}

Open original schema

Published input example

{
  "labels": [
    "spam",
    "ham",
    "ham",
    "ham"
  ]
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub →