Improved SONSC+ clustering evaluation using ISI (Improved SONSC Index)
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sonsc_isi-0.1.tar.gz.
File metadata
- Download URL: sonsc_isi-0.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28c0fb5d129aa5bcfe14178c3a01a2744838fd7d91ea7a943b40623025e3f1f2
|
|
| MD5 |
60f0fa3724d052d1e6efd379df6a08bb
|
|
| BLAKE2b-256 |
cc8bb907b0d5d2bfbbc4ff5e6c4f94d65d64a03118dc31f219ffd05eb2080f3d
|
File details
Details for the file sonsc_isi-0.1-py3-none-any.whl.
File metadata
- Download URL: sonsc_isi-0.1-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
048174f956112376c03134532813fcd6be947ea1bf986e3989cc79002e2c2b70
|
|
| MD5 |
81d57a17db905ea05415c772f98ceb63
|
|
| BLAKE2b-256 |
8489496b3ab3afc664ec3a6edd27bed732926ab8fdb84100dc29921b5d29b5ef
|