This package implements the
- Clone the repository:
git clone https://github.com/pvsundar/sundar_gap_stat.git- Navigate to the package directory:
cd sundar_gap_stat- Install the package and its dependencies:
pip install .Alternatively, you can install directly from the GitHub repository:
pip install git+https://github.com/pvsundar/sundar_gap_stat.gitHere’s a basic example of how to use the package with the Iris dataset:
from sklearn.datasets import load_iris
from gap_statistic.utils import sundar_tibshirani_gap_statistic_main
from sklearn.datasets import fetch_openml
import numpy as np
X, y = load_iris(return_X_y=True)
sundar_tibshirani_gap_statistic_main(X, y, k=3)Feel free to open an issue or submit a pull request if you'd like to contribute.
This project is licensed under the MIT License - see the LICENSE.md file for details.
Special thanks to all contributors and the open-source community. in particular to the code by Mavengence who created the package for the Tibshirani Gap Statistic. https://github.com/Mavengence/GapStatistics/blob/main/gapstatistics/gapstatistics.py