Elixir Consulting Group

Published October 29, 2026 ยท Independent educational guide

Read Canberra Distance Through Coordinate Ratios and Zero Rules

Canberra distance compares corresponding coordinates through their absolute difference divided by the sum of their absolute magnitudes, then adds those coordinate contributions. That denominator makes the comparison different from simply adding absolute differences. An AI-written report can preserve every input number and still misexplain the result if it drops the coordinate denominator, changes zero handling or treats an unknown value as zero.

This guide uses six original fictional groups of finite real-valued coordinates. Their small calculations are teaching examples, not measured model vectors, client data or observed search results. No SciPy function, embedding model or production evaluator was executed. The purpose is to make a named distance calculation readable while keeping questions about semantic relevance, population behavior and business usefulness separate from its arithmetic.

Read the coordinate fraction before reading the total

For each declared paired coordinate, first calculate the absolute difference in the numerator. Then calculate the sum of the absolute magnitudes in the denominator. Divide that numerator by that denominator and retain the resulting contribution. Add the contributions only after each position has been paired and its zero status resolved. This exposes the operation that the final scalar would otherwise hide.

The official SciPy Canberra documentation, read October 29, 2026, gives this formula for two one-dimensional arrays, describes optional coordinate weights and specifies a zero contribution when both values at a position are zero. This guide uses that stated both-zero convention for its authored examples. It checks its own exact arithmetic rather than claiming general SciPy implementation conformance or numerical behavior on arbitrary inputs.

Write the coordinate labels or representation order beside the values. Corresponding positions must refer to the same declared coordinate system. A distance function does not establish that the source records use compatible meanings, model versions or units. Those relationships must come from the representation contract, not from the fact that two lists have the same length.

A useful calculation table has five fields: the paired inputs, their absolute difference, their absolute-magnitude sum, the convention applied if needed, and the contribution. Keep the final sum in a separate line. That structure helps a reviewer identify whether a disputed result comes from pairing, arithmetic, an optional weight or a change in the meaning assigned to the output.

Case A: the same absolute difference can contribute differently

Fictional Case A compares the pairs 1 and 2, then 100 and 101. Each pair has an absolute difference of 1. Their denominators differ: 3 for the first pair and 201 for the second. The contributions are therefore 1/3 and 1/201. If those are the two coordinates of the paired vectors, their Canberra sum is 68/201, approximately 0.338308.

An unweighted sum of the absolute differences would instead be 2. That is a separate operation. It does not reproduce the Canberra result merely because it starts from the same differences. If an AI explanation says every one-unit change contributes equally here, the coordinate fractions directly contradict that description. The denominator is doing substantive mathematical work.

This example does not say that the smaller-valued feature is more important to a business or that a one-unit change has a particular practical consequence. The formula gives it a larger numerical contribution under the declared representation. Whether that representation and metric suit a task requires separate judgment and evidence. A distance's sensitivity should not be rewritten as an established ranking of real-world importance.

When asking AI to explain the calculation, require it to show both equal numerators and unequal denominators. Then ask it to distinguish the mathematical result from any task-specific interpretation. A reader can use that distinction to investigate feature design without claiming that the example identifies the correct metric for a real system.

Case B: zero, both zero and unknown are different states

Case B first compares 0 with 5. The numerator and denominator are both 5, so the contribution is 1. It then compares 0 with 0. The raw fraction would be 0/0; under the explicitly named both-zero convention used here, that coordinate contributes 0. These two supplied pairs have different meanings within the calculation even though each includes a zero.

The convention does not make every zero denominator in every business formula valid. It is a stated rule for this particular distance calculation. Nor does it mean that a zero coordinate is absent from the representation. A supplied numeric zero is an input value. An unknown coordinate is a missing input whose actual value has not been established.

An explanation should state the both-zero rule beside the affected row rather than silently substituting zero in every uncertain case. If a source provides null or omits a coordinate, the reviewer must obtain the actual value or an explicitly justified separate missing-data policy. The fact that a distance has a both-zero convention supplies no general permission to impute missing values.

In a practical review note, label numeric zero, both-zero contribution and unknown input separately. This prevents a tidy sum from masking a data availability problem. If the calculation is used in a real report, also identify which source field and transformation created each zero. That question concerns provenance and preprocessing; it is not answered by the local fraction alone.

Case C: common positive scaling within a coordinate preserves its fraction

Fictional Case C starts from the pair 2 and 6. The contribution is 4/8, or 1/2. Multiplying both values by 10 gives 20 and 60, whose contribution is 40/80, again 1/2. The positive common factor multiplies both numerator and denominator, so it cancels in this finite nonzero-denominator example.

This property can help explain a compatible unit conversion applied to both members of a paired coordinate. It does not license multiplying only one member or changing a value without preserving its dimensional role. If one table uses a different quantity or transformation, the same-looking unit label cannot establish that the two values are comparable.

For comparison, adding 10 to both original values gives 12 and 16. The difference stays 4, but the denominator becomes 28, making the contribution 1/7. A shared offset is therefore different from common positive scaling. An AI explanation that says normalization never matters because this metric is scale independent has overgeneralized beyond the stated transformation.

Preserve the exact transformation in the review. Say both paired values were multiplied by the same positive factor, or say a common offset was added; do not use a vague word such as standardized to cover both. The authored arithmetic establishes the local invariance and noninvariance described here. It is not an evaluation of an actual preprocessing pipeline or a recommendation about how that pipeline should operate.

Case D: signs affect the denominator and the difference

Case D compares -2 with 2. Their absolute difference is 4 and their absolute-magnitude sum is also 4, so the contribution is 1. It separately compares -2 with -6, producing an absolute difference of 4 over an absolute-magnitude sum of 8, or 1/2. Equal absolute differences again do not force equal contributions.

Using the plain signed sum as the denominator would break the declared operation. For -2 and 2 that signed sum would be zero, even though the actual Canberra denominator is 4. Retain the absolute value around each input before addition. The parentheses and bars in the formula are part of its meaning rather than decorative mathematical notation.

A contribution of 1 in the opposite-sign example is a statement about these paired numbers under this formula. It is not a universal assertion that their represented objects are maximally different in every relevant sense. Coordinate contributions and full-vector totals also have different ranges and must not be interchanged in a report's prose.

A useful review prompt asks the assistant to show the signed input values, the absolute difference and each absolute magnitude before addition. That makes the sign treatment visible without requiring the reader to infer it from a final decimal. If a report claims all inputs are nonnegative but displays a negative value, preserve the inconsistency as a source question instead of silently deleting or replacing the value.

Case E: coordinate weighting changes the declared total

In fictional Case E, the paired vectors are [1, 4] and [2, 4]. Their coordinate contributions are 1/3 and 0, so the unweighted Canberra sum is 1/3. Under separately invented coordinate weights [3, 1], the weighted sum of those contributions is 1. The difference comes from the explicit multiplier on the first coordinate.

These invented weights are not fitted model parameters, measured business priorities or recommended settings. They show why a report should preserve weights whenever it names a weighted metric. A scalar from a weighted calculation cannot be reconstructed from unweighted contributions alone if the weights are omitted. Likewise, changing a weight can change a comparison without changing either input vector.

A weighted sum is not automatically a weighted average. Dividing the weighted sum of 1 by the sum of the invented weights, 4, would give 1/4, a different statistic from the weighted sum used here. If an evaluator defines a normalized form, that definition must be stated separately. Do not add a denominator merely because the word weighted appears in the method name.

For an actual comparison, ask who or what supplied the weights, what coordinate each weight belongs to, whether the same weights were used across candidates, and which aggregation rule was applied. The local checks verify only the supplied fictional multiplication and summation. They do not establish that the weights improve retrieval, represent a population or reflect an authorized operational decision.

Case F: a partial distance is not the full original distance

Case F compares u [1, 4, 0] with v [2, 4, unknown]. The first two contributions are 1/3 and 0, leaving a known subtotal of 1/3. Two of three coordinate pairs are available, a fraction of 2/3 by position count. The third contribution cannot be determined from an absent value.

If the unknown third value were hypothetically 0, the both-zero convention would make its contribution 0, leaving a full sum of 1/3. If it were hypothetically 5, the third pair would contribute 1, producing a full sum of 4/3. These conditional alternatives are original teaching cases, not estimates of the missing input or observed completions.

The full distance therefore remains unresolved. Dropping the third coordinate and presenting the subtotal as complete changes the represented comparison. Filling the missing value with zero also changes the evidence state, because the source did not supply zero. A numerical function's ability to accept an imputed input does not establish that the imputation is appropriate for the task.

Keep the unresolved coordinate in the explanation and label the known sum as partial. If a later source supplies the value, preserve that source's version and recompute all affected results. Availability of 2/3 of positions should remain a count of known pairs. It does not measure semantic coverage, output accuracy or the fraction of an actual decision that has been justified.

Keep totals separate from per-coordinate bounds

For a finite nonzero-denominator real pair, the absolute difference is no larger than the sum of the absolute magnitudes, so its unweighted contribution lies between zero and one. A full sum across multiple coordinates can exceed one. Case F's hypothetical full sum of 4/3 illustrates this without introducing any model or measured dataset.

A report that describes the full distance as a percentage because each coordinate contribution is bounded has confused two levels of aggregation. To turn a sum into an average would require an additional declared operation and denominator. Even that average would be a numerical summary of the supplied representation, not automatically an empirical probability or an error rate.

Preserve the number of compared coordinates and any weights near the result. Comparisons across differently defined feature sets can change simply because the set of terms changed. That does not prove that one object moved farther away in a stable representation. First check whether the representation, coordinate count, pairing and aggregation remained fixed.

Do not invent an acceptance threshold from the examples. A task may require a metric with particular properties, a carefully defined candidate frame and independent outcome judgments. The examples here establish arithmetic relationships and interpretation boundaries only. They offer no calibrated cutoff, reference validation, uncertainty interval or evidence of production usefulness.

Distinguish Canberra from neighboring distance explanations

A Manhattan calculation adds absolute coordinate differences without these coordinate denominators. A Chebyshev calculation selects the largest absolute coordinate difference. Canberra instead adds the stated coordinate ratios. Naming these operations separately helps a reader explain why the same paired lists can produce different numbers without treating one report as inherently wrong merely because its metric differs.

A metric comparison becomes useful when it identifies what question each operation answers under the declared representation. It becomes misleading when it assumes that one is universally best for text embeddings, human judgments or business priorities. Such claims would require evidence beyond small authored vectors. The relevant next step is to obtain the actual task and evaluation protocol.

If AI drafts a comparison paragraph, have it identify the numerator, denominator and aggregation in plain language before giving an interpretation. This catches a common kind of substitution: describing a ratio-based sum with the language of raw coordinate differences. A correct metric name in a heading does not guarantee that the prose below it preserves the formula.

Prepare the source material for an AI-assisted reading note

Supply the ordered vectors, any declared coordinate labels, the both-zero convention, the optional weights and the intended output name. State whether the result is complete or based on a known subset. Keep a copy of the original values before any transformations. If the source does not establish their relationship, ask the assistant to list that gap rather than resolve it through a plausible story.

An original teaching instruction might read: Show the absolute difference and absolute-magnitude denominator for each paired coordinate; apply the named both-zero convention only to two supplied zeros; retain missing inputs; state the known subtotal separately; make no claims about measured model quality. This is a proposed explanation request, not a prompt whose behavior has been tested on a language model.

Review the resulting draft at two levels. First verify the arithmetic and preservation of input states. Then inspect whether the explanation has introduced unprovided judgments about importance, relevance, fairness, reliability or future outcomes. Both levels matter because a paragraph can calculate 68/201 correctly while incorrectly calling it a measured success rate.

The downloadable CSV retains six fictional groups and their bounded results. Narrow local checks use exact fractions and supplied labels to reproduce the stated arithmetic. They do not execute SciPy, validate arbitrary arrays, assess numerical stability or certify semantic correctness. The file is a teaching worksheet rather than an executable utility or a substitute for an actual evaluation dataset.

Use a short handoff that preserves the unresolved question

A reviewable handoff can state the representation version, pair order, coordinate fractions, zero convention, weights, total and interpretation boundary. If a value is missing, identify the affected coordinate and request the source needed to resolve it. That gives the next reviewer a concrete action without implying that a fluent explanation has completed the evidence work.

When the question is only arithmetic, keep the request focused on arithmetic. When the question concerns an actual system's usefulness, add the real candidate frame, references and evaluation design before claiming a result. This sequence keeps a mathematical teaching example useful while preventing it from becoming an unsupported story about a model, client or production workflow.

Frequently asked questions

Does Canberra distance just add absolute differences?

No. Each difference is divided by the sum of the paired absolute magnitudes before contributions are added. Case A has two absolute differences of 1, but contributions 1/3 and 1/201. Their sum is 68/201, whereas a separate sum of raw absolute differences is 2. Keep the denominator visible in the explanation.

How is a pair of supplied zeros handled here?

The examples use the explicitly named convention described by the SciPy documentation: a both-zero coordinate contributes zero. The underlying raw fraction would be 0/0. This convention applies to the declared distance calculation; it is not a general rule for unrelated formulas or a policy for replacing missing data with zeros.

Does converting units always leave the result unchanged?

Case C shows invariance when both members of one coordinate are multiplied by the same positive factor. It also shows a change under a shared additive offset. Other transformations require their own analysis. Preserve the quantity relationship and exact transformation instead of assuming every operation called normalization has the same mathematical effect.

Can the total be greater than one?

Yes. A sum across multiple coordinates is different from a single coordinate contribution. In Case F, one hypothetical completion yields 1/3 plus 1, or 4/3. That does not make the arithmetic invalid or turn the result into a percentage. Any averaging or further normalization would need a separately stated definition.

Are the weighted examples recommendations for an AI system?

No. The weights [3, 1] are invented teaching inputs that expose their effect on the declared sum. They were not fitted, validated or chosen from business evidence. A real system needs its actual representation contract, purpose and evaluation evidence before anyone can conclude that a weighting scheme supports its intended use.

Were these distances measured on real embeddings?

No. The coordinate lists were authored for this guide, and local checks verify their narrow arithmetic and conditional relationships. No embedding model, retriever, SciPy function or client dataset was evaluated. The examples help a reader identify what a report must disclose before interpreting an actual distance value.

Keep the original worksheet beside any rewritten explanation. If a reviewer changes a denominator, weight or missing-input rule, save that as an explicit alternative calculation with its reason. This makes later disagreement about the metric easier to resolve because the competing operations remain visible instead of being blended into one apparently authoritative number.

Original fictional practice data

Original fictional teaching cases, not actual client records, reservations, model outputs, professional review or operating approval. No executable utility is supplied.

Six original fictional teaching cases; definitions and scope remain in the guide
fictional caseauthored inputsbounded result
A{"u": [1, 100], "v": [2, 101]}Contributions1/3,1/201 sum68/201 versus rawdifferences2
B{"pairs": [[0, 5], [0, 0]], "bothZeroConvention": 0}Contributions1/0; numeric zero not missing
C{"pair": [2, 6], "scaled": [20, 60], "offset": [12, 16]}Common positive scaling preserves1/2; offset gives1/7
D{"pairs": [[-2, 2], [-2, -6]]}Absolute magnitude denominators4/8, contributions1/1half
E{"u": [1, 4], "v": [2, 4], "weights": [3, 1]}Unweighted1/3,weighted sum1,separate normalized1/4 not recommendation
F{"u": [1, 4, 0], "v": [2, 4, null], "hypotheticalThird": [0, 5]}Partial1/3,availability2/3,fullunresolved,hypotheses1/3,4/3

Primary sources and editorial scope

AI-assisted website editorial. Sources read October 29, 2026 America/New_York. Original fictional teaching inputs and planning records only; no actual ticket, reservation, visit, inquiry, artwork/material observation, experiment, route inspection, individual access assessment, professional review or institutional endorsement. Original examples checked independently. No record change, actual client dataset, observed model output, professional review, security certification or operating approval is asserted.

Related practical questions