semvec/pypi-packages huggingface dataset:
sonsc-isi 0.1
Improved SONSC+ clustering evaluation using ISI (Improved SONSC Index)
Requires Python: >=3.6

SONSC+ (ISI): Optimal Number of Clusters Selection Using ISI Index

A Python implementation of the improved SONSC+ algorithm utilizing the Improved Separation Index (ISI) for accurate clustering evaluation and optimal selection of clusters without requiring labeled data.

📌 Installation

Install via pip:

pip install sonsc-isi

🚀 Features

Automatic selection of the optimal number of clusters.

High interpretability using Cohesion, Separation, and ISI.

Compatible with various datasets including MNIST, CIFAR-10, Iris, etc.

Generates detailed visualizations for easy interpretation.

🔖 Usage Example

Here's how to use sonsc_isi in your project:

from sonsc_isi import sonsc_isi
from sklearn.datasets import load_digits
from sklearn.preprocessing import StandardScaler
import matplotlib.pyplot as plt

X, _ = load_digits(return_X_y=True)
X = StandardScaler().fit_transform(X)

k_values = range(2, 15)
results_df = sonsc_isi(X, k_values=k_values)

print(results_df)

# Visualizing results
plt.figure(figsize=(10, 5))
plt.plot(results_df["k"], results_df["ISI"], marker='o', label='ISI Score', color='purple')
plt.axvline(results_df.loc[results_df["ISI"].idxmax(), "k"], linestyle='--', color='red', label='Optimal k')
plt.title("ISI Scores for Different Numbers of Clusters")
plt.xlabel("Number of Clusters (k)")
plt.ylabel("ISI Score")
plt.legend()
plt.grid()
plt.show()

📚 Supported Datasets

MNIST

CIFAR-10

Iris

Digits

Any custom numerical dataset

🖥 Example Notebook

See examples/example_sonsc_isi.ipynb for detailed usage examples on MNIST and CIFAR-10 datasets.

📖 Reference

The algorithm is inspired by and improved upon the work described in:

Cosine Clustering Index (CCI), SN Computer Science

@article{CCI2024,
  author = {Jahanian, Mojtaba and Others},
  title = {Cosine Clustering Index (CCI)},
  journal = {SN Computer Science},
  year = {2024},
  doi = {10.1007/s42979-024-02970-7}
}

⚙️ Dependencies:

numpy

pandas

matplotlib

scikit-learn

tensorflow

📄 License:

MIT © Your Name
byuhbll-django-dry 1.1.0
Reduce duplication and boilerplate in Django apps.
Requires Python: >=3.8

# Django Dry

Reduce duplication and boilerplate in Django apps. DRY stands for "Don't repeat yourself".

This package is used by the Software Engineering team at the BYU Library.

## Contributing to this project

### Project development setup

Follow these steps to setup your development environment:

1. Clone the repository. Run `git clone git@gitlab.com:byuhbll/lib/python/django-dry.git`.
2. Open the project in Visual Studio Code.
3. Open the project in a devcontainer with the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension.
4. Contribute!

This project uses [uv](https://docs.astral.sh/uv/) to manage dependencies.

### Project documentation

The [project's documentation](docs/index.md) can be found in the `docs` directory and is in markdown format.

### Testing in this project

Running `pytest` will run all unit tests.

Unit tests can also be run using `tox`. Simply run `tox` on the command line and the unit tests should run for all supported versions of Python.