cluestar
Gain a clue by clustering!
This library contains visualisation tools that might help you get started with classification tasks. The idea is that if you can inspect clusters easily, you might gain a clue on what good labels for your dataset might be!
It generates charts that looks like this:
There's even a fancy chart that can compare embedding techniques.
Install
python -m pip install cluestar
Interactive Demo
You can see an interactive demo of the generated widgets here.
You can also toy around with the demo notebook found here.
Usage
The first step is to encode textdata in two dimensions, like below.
from sklearn.pipeline import make_pipeline
from sklearn.decomposition import TruncatedSVD
from sklearn.feature_extraction.text import TfidfVectorizer
pipe = make_pipeline(TfidfVectorizer(), TruncatedSVD(n_components=2))
X = pipe.fit_transform(texts)
From here you can make an interactive chart via;
from cluestar import plot_text
plot_text(X, texts)
The best results are likely found when you use umap together with something like universal sentence encoder.
You might also improve the understandability by highlighting points that have a certain word in it.
plot_text(X, texts, color_words=["plastic", "voucher", "deliver"])
You can also use a numeric array, one that contains proba-values for prediction, to influence the color.
# First, get an array of pvals from some model
p_vals = some_model.predict(texts)[:, 0]
# Use these to assign pretty colors.
plot_text(X, texts, color_array=p_vals)
You can also compare two embeddings interactively. To do this:
from cluestar import plot_text_comparison
plot_text(X1=X, X2=X, texts)
Metadata
Release files for cluestar 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cluestar-0.2.1.tar.gz | 4.8 kB | Without provenance | Details for cluestar-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cluestar-0.2.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for cluestar-0.2.1-py2.py3-none-any.whl |
Total release size: 10.1 kB
Release files / cluestar-0.2.1.tar.gz
| Download URL | cluestar-0.2.1.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3b816d8a2b60c60a08737a9225129aaae6757983273cd8e9fb8645105d5c61e
|
|
BLAKE2b-256 checksum How to use checksums |
1acbc36629da325ed5773c48f4f1e34f2ecfe2db2e2b2d0cfa304b4a613604d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.6
|
Release files / cluestar-0.2.1-py2.py3-none-any.whl
| Download URL | cluestar-0.2.1-py2.py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
fcf2cd43c3385130cbc71509947f545d9edbdef6a1811e4dbb007e888bcf7fae
|
|
BLAKE2b-256 checksum How to use checksums |
7d1d8cfcec80f1dbe1221dbaa61026b1b9991bb87125ca187f24e04a4f47ec65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.6
|
Security for cluestar 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.