Jump to content

Dunn Index Python Data Function for Spotfire® 1.0.0

1 Screenshot


This Python data function calculates metrics to help the user decide on the optimal number of clusters (K value) for the K-Means method on the given input dataset.


This Python data function helps in calculating Dunn Index (DI) which is a metric for judging a clustering algorithm. A higher DI implies better clustering and better clustering means that clusters are compact and well-separated from other clusters. Here the DI is equal to the minimum inter-cluster distance divided by the maximum cluster size. Note that larger inter-cluster distances (better separation) and smaller cluster sizes (more compact clusters) lead to a higher DI value.

The final output consists of an output table with 'No of clusters' and its corresponding Dunn Index value.


Installing the data function

Follow the online guide available here to register a data function in Spotfire.


Configuring the data function

Each data function may require inputs from the Spotfire analysis and will return outputs to the Spotfire analysis. For each data function, these need to be configured once the data function is registered. To learn about how to configure data functions in Spotfire please view this video:

For more information on Spotfire visit the Spotfire training page.


Data function library

There exists a large number of data functions covering various features. Feel free to review what is available on the Data Function Library.

Release 1.0.0

Published: April 2021

Initial release includes:

  • Data function
  • Dxp with example usage
  • Documentation
  • License information

  • Create New...