1
AutoLISP (Vanilla / Visual) / Re: most common value in a list (mode)
« Last post by kdub_nz on May 31, 2024, 11:33:53 PM »Quote
The mode is the most common number that appears in your set of data. To find the mode count how often each number appears and the number that appears the most times is the mode.https://www.ncl.ac.uk/webtemplate/ask-assets/external/maths-resources/statistics/descriptive-statistics/mean-median-and-mode.html#:~:text=Mode-,Definition,most%20times%20is%20the%20mode.
Quote
Mode: The most frequent number—that is, the number that occurs the highest number of times.https://www.khanacademy.org/math/statistics-probability/summarizing-quantitative-data/mean-median-basics/a/mean-median-and-mode-review
Seems 'mode' is not an Cardinal value, just the number that appears most . . nor an analysis of the other numbers.
. . . so my expectation would be to return a single number, or a list if there are multiple modes
Having two modes is called "bimodal".
Having more than two modes is called "multimodal".
I s'pose the handling of a list with an equal amount of each number would depend on the use case.
//--
edge cases can be a killer.