Home

Awesome

Gap Statistic

Overview

This repository provides an implementation of the Gap Statistic, a clustering evaluation method, integrated into H2O-3, H2O.ai's open-source machine learning platform. The Gap Statistic helps determine the optimal number of clusters in a dataset by comparing the within-cluster dispersion to that of a reference null distribution, effectively evaluating whether a proposed clustering structure is significantly better than random noise.

Gap Statistic Methodology

The Gap Statistic compares the total within-cluster variation for different numbers of clusters with their expected values under a null reference distribution (i.e., a distribution with no obvious clustering). The method calculates the gap between observed and expected within-cluster dispersion for each number of clusters, and the optimal number of clusters is where the gap is maximized.

Key Features

Usage

To use the Gap Statistic within H2O-3, follow these steps:

  1. Install H2O-3: If you haven't already, install H2O-3 by following the instructions on the H2O-3 GitHub page.
  2. Prepare Data: Load your dataset into H2O-3.
  3. Run Gap Statistic: Execute the Gap Statistic function with your chosen clustering algorithm and data to evaluate the optimal number of clusters.

Example usage and detailed instructions can be found in the repository’s example notebook or script files.

Installation

  1. Clone the repository:
    git clone https://github.com/username/gap-statistic-h2o3.git
    

Install dependencies

Implementation Details

This implementation builds upon the principles outlined in the original paper by Tibshirani et al., which introduced the Gap Statistic. We follow this methodology to provide a robust method for determining the cluster count within H2O-3.

References

Contributing

Please open an issue or submit a pull request if you have suggestions or improvements for this implementation.

License

This project is licensed under the MIT License. See the LICENSE file for details.