CentralFeature
✖
CentralFeature
Details and Options


- CentralFeature is a location measure. It gives a point in the data with the minimum total distance to every other point.
- CentralFeature finds the element
that minimizes the sum of distances
for the unweighted case and
for the weighted case.
- The data data has the following forms and interpretations:
-
{data1,data2,…} list of data of different formats including numerical, geospatial, textual, visual, dates and times, as well as combinations of these {data1,data2,…}{v1,v2,…} data with indices {v1,v2,…} {data1,data2,…}Automatic take the vi to be successive integers i GeoPosition[…] array of geodetic positions WeightedData[…] data with weights - The following option can be given:
-
DistanceFunction Automatic the distance metric to use - The setting for DistanceFunction can be any distance or dissimilarity function or a function f defining a distance between two points.
- By default, the following distance functions are used for different types of elements:
-
EuclideanDistance numeric data ImageDistance images JaccardDissimilarity Boolean data EditDistance text and nominal sequences Abs[DateDifference[#1,#2]]& dates and times ColorDistance colors GeoDistance geospatial data Boole[SameQ[#1,#2]]& nominal data HammingDistance nominal vector data WarpingDistance numerical sequences - All images are first conformed using ConformImages when the option DistanceFunction is Automatic.
- By default, when data elements are mixed-type vectors, distances are computed independently for each type and combined using Norm.

Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (9)Survey of the scope of standard use cases
Same inputs with different output formats:

https://wolfram.com/xid/01ytjx49nma-0a946l

https://wolfram.com/xid/01ytjx49nma-cg1nsz


https://wolfram.com/xid/01ytjx49nma-baimh9


https://wolfram.com/xid/01ytjx49nma-xk77u


https://wolfram.com/xid/01ytjx49nma-jxkqh

Central feature works with WeightedData:

https://wolfram.com/xid/01ytjx49nma-cmk87u

https://wolfram.com/xid/01ytjx49nma-hau2mb


https://wolfram.com/xid/01ytjx49nma-87iwb

Central feature of a large array:

https://wolfram.com/xid/01ytjx49nma-nknun


https://wolfram.com/xid/01ytjx49nma-ma3v2m

Find the central feature of data involving quantities:

https://wolfram.com/xid/01ytjx49nma-jopin9


https://wolfram.com/xid/01ytjx49nma-e8c21s

Find the central feature of a list of images:

https://wolfram.com/xid/01ytjx49nma-86ek1f


https://wolfram.com/xid/01ytjx49nma-5h0a58


https://wolfram.com/xid/01ytjx49nma-g60h57

Compute the central feature of strings:

https://wolfram.com/xid/01ytjx49nma-jgyc34

Compute the central feature of Boolean vectors:

https://wolfram.com/xid/01ytjx49nma-et6i42

Compute the central feature of a list of date objects:

https://wolfram.com/xid/01ytjx49nma-fo7hey

Compute the central feature of geodetic positions:

https://wolfram.com/xid/01ytjx49nma-h00b0u

https://wolfram.com/xid/01ytjx49nma-zscajd


https://wolfram.com/xid/01ytjx49nma-xh3bo

Options (2)Common values & functionality for each option
DistanceFunction (2)
By default, Euclidean distance is used:

https://wolfram.com/xid/01ytjx49nma-hgtsmh

The ChessboardDistance only takes into account the dimension with the largest separation:

https://wolfram.com/xid/01ytjx49nma-88aqlu

The DistanceFunction can be given as a symbol:

https://wolfram.com/xid/01ytjx49nma-cse7si

https://wolfram.com/xid/01ytjx49nma-hb61z3

https://wolfram.com/xid/01ytjx49nma-pw5mgr


https://wolfram.com/xid/01ytjx49nma-vs537w

Applications (4)Sample problems that can be solved with this function
Obtain a robust estimate of multivariate location when outliers are present:

https://wolfram.com/xid/01ytjx49nma-g5ces4

https://wolfram.com/xid/01ytjx49nma-cexxtn

Extreme values have a large influence on the Mean:

https://wolfram.com/xid/01ytjx49nma-blrzc0

Sample points from a convex polygon:

https://wolfram.com/xid/01ytjx49nma-os2mws

https://wolfram.com/xid/01ytjx49nma-eu6ef9

Estimate the center of the polygon by computing the central feature of random points:

https://wolfram.com/xid/01ytjx49nma-km5uzj


https://wolfram.com/xid/01ytjx49nma-htcbm0

Find the central feature of California, based on the location of cities:

https://wolfram.com/xid/01ytjx49nma-ch0km6

https://wolfram.com/xid/01ytjx49nma-fej0tx

Find the central feature of California, based on the location of cities weighted by population:

https://wolfram.com/xid/01ytjx49nma-vaphe

https://wolfram.com/xid/01ytjx49nma-ffpsfp

Draw the cities' locations (gray), unweighted central feature (red) and weighted central feature (black):

https://wolfram.com/xid/01ytjx49nma-35pzkk

https://wolfram.com/xid/01ytjx49nma-bzitte

The top eight largest cities in Ohio:

https://wolfram.com/xid/01ytjx49nma-n79bt

The central feature of the eight cities based on TravelDistance:

https://wolfram.com/xid/01ytjx49nma-ief8up

The sum of distances from the central feature to the other cities, based on TravelDistance:

https://wolfram.com/xid/01ytjx49nma-oy5ptc

Draw the cities' locations (gray) and the central feature (red):

https://wolfram.com/xid/01ytjx49nma-p0o21w

Properties & Relations (5)Properties of the function, and connections to other functions
CentralFeature is a multivariate location measure:

https://wolfram.com/xid/01ytjx49nma-3l3hs

https://wolfram.com/xid/01ytjx49nma-49w8bq


https://wolfram.com/xid/01ytjx49nma-d706y

Mean is also a location measure:

https://wolfram.com/xid/01ytjx49nma-gqcaip

Visualize the data points with central feature and mean:

https://wolfram.com/xid/01ytjx49nma-mgzvm

CentralFeature finds a point belonging to the data that minimizes the sum of distances:

https://wolfram.com/xid/01ytjx49nma-hsraxu

https://wolfram.com/xid/01ytjx49nma-d1hk4a

Compute the central feature directly from the definition:

https://wolfram.com/xid/01ytjx49nma-p2lkxt

https://wolfram.com/xid/01ytjx49nma-h5g0m

Visualize the sum of distances function together with the data points:

https://wolfram.com/xid/01ytjx49nma-9fojv

CentralFeature is the same as Median with univariate data when the data length is odd:

https://wolfram.com/xid/01ytjx49nma-nl9yne

https://wolfram.com/xid/01ytjx49nma-fto1z

CentralFeature finds an element in the data that minimizes the sum of distances to other data points:

https://wolfram.com/xid/01ytjx49nma-l6968w

https://wolfram.com/xid/01ytjx49nma-fpw0ac

SpatialMedian finds a point in the domain that minimizes the sum of distances:

https://wolfram.com/xid/01ytjx49nma-dtgm5w

The sum of distances with respect to CentralFeature is greater than or equal to the one with respect to SpatialMedian:

https://wolfram.com/xid/01ytjx49nma-dq0fzw

https://wolfram.com/xid/01ytjx49nma-otjqfs

Create a random graph with edge weights sampled uniformly between 0 and 1:

https://wolfram.com/xid/01ytjx49nma-4hyg3

Locate the GraphCenter:

https://wolfram.com/xid/01ytjx49nma-f3adkp

Specify the distance between each pair of vertices using GraphDistance:

https://wolfram.com/xid/01ytjx49nma-52owx
Locate the center using CentralFeature:

https://wolfram.com/xid/01ytjx49nma-dmt0h

Possible Issues (1)Common pitfalls and unexpected behavior
CentralFeature of a non-weighted, two-element list returns the first element:

https://wolfram.com/xid/01ytjx49nma-qczayo

https://wolfram.com/xid/01ytjx49nma-oxzelz

For weighted two-element lists, it chooses the element with the highest weight, which trivially minimizes :

https://wolfram.com/xid/01ytjx49nma-jczf9o

Wolfram Research (2017), CentralFeature, Wolfram Language function, https://reference.wolfram.com/language/ref/CentralFeature.html.
Text
Wolfram Research (2017), CentralFeature, Wolfram Language function, https://reference.wolfram.com/language/ref/CentralFeature.html.
Wolfram Research (2017), CentralFeature, Wolfram Language function, https://reference.wolfram.com/language/ref/CentralFeature.html.
CMS
Wolfram Language. 2017. "CentralFeature." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CentralFeature.html.
Wolfram Language. 2017. "CentralFeature." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CentralFeature.html.
APA
Wolfram Language. (2017). CentralFeature. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CentralFeature.html
Wolfram Language. (2017). CentralFeature. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CentralFeature.html
BibTeX
@misc{reference.wolfram_2025_centralfeature, author="Wolfram Research", title="{CentralFeature}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/CentralFeature.html}", note=[Accessed: 29-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_centralfeature, organization={Wolfram Research}, title={CentralFeature}, year={2017}, url={https://reference.wolfram.com/language/ref/CentralFeature.html}, note=[Accessed: 29-March-2025
]}