Skip to content

Main content

Class Weight Rebalancing Multiplier Tool

Calculate class weight rebalancing multiplier from explicit caller-supplied inputs.

Loading tool…

Description

Return one class's balanced weighting multiplier.

Class prevalence, probability mass and training weights describe different distributions. Removing a class, changing class weights or correcting prior odds changes a particular numerical basis; none of those operations by itself estimates population shift or establishes calibrated predictions.

Return one class's balanced weighting multiplier.

When to use this tool

Use Class Weight Rebalancing Multiplier when checking the stated probability-mass, prior-odds or weighting convention.

How to use the tool and how it works

  1. Enter total, classes, classCount. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read weight. Use the output convention below.

Return one class's balanced weighting multiplier. Require whole total >= classes >= 2 and classCount in [1,total]; weight = total/(classes*classCount).1

Input fieldMeaning and unitsAccepted input
totalTotalRequired. Safe integer; minimum 1.
classesClassesRequired. Safe integer; minimum 2.
classCountClass CountRequired. Safe integer; minimum 1.
Output fieldInterpretationReturned shape
weighttotal/(classes*classCount), the stated inverse-frequency class-weight convention.Required. Finite number.
json
{
  "input": {
    "total": 100,
    "classes": 2,
    "classCount": 25
  },
  "output": {
    "weight": 2
  }
}

Limitations and assumptions

  • This matches the stated inverse-frequency convention; no complete class-count vector or suitable training policy is validated.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Check the complete class distribution and its sampling basis; use a justified shift model or fitted calibration method when adapting predictions to a new population.

References

  1. Calculation and input contract: classification/class-weight-rebalancing-multiplier — tool.io

Similar or alternative tools