Saturn coefficient to assess the results of an UMAP dimensionality reduction
Project description
Saturn score
Summary
A Python package that computes the Saturn coefficient of a matrix to assess the quality of its UMAP dimensionality reduction.
Installation
You can run the following command to install this package:
pip3 install saturnscore
Example
You can run the following Python code to test your package installation:
import numpy as np
import pandas as pd
import random
import scipy
import umap.umap_ as umap
from saturnscore import Saturn_coefficient
random.seed(0)
np.random.seed(0) # Set random seed for reproducibility
input_data = np.random.randn(120, 200) # Generate random matrix X1
these_n_neighbors = 20
this_min_dist = 0.01
these_n_components = 2
this_metric = 'euclidean'
this_random_state = 42
this_n_jobs = 1
this_n_epochs = 200
print("these_n_neighbors = ", these_n_neighbors)
print("this_min_dist = ", this_min_dist)
print("these_n_components = ", these_n_components)
print("this_metric = ", this_metric)
umap_verbose = False
fit = umap.UMAP(n_neighbors=these_n_neighbors,
min_dist=this_min_dist,
n_components=these_n_components,
metric=this_metric,
n_jobs=this_n_jobs,
random_state=this_random_state,
n_epochs = this_n_epochs,
verbose=umap_verbose)
umap_output_layout = fit.fit_transform(input_data)
result = Saturn_coefficient.SaturnCoefficient(input_data, umap_output_layout)
print(f" Saturn coefficient = ", result)
The final command should print Saturn coefficient = 0.11817430122179944
Contact
The SaturnScore package was developed by Davide Chicco. Questions should be
addressed to davidechicco(AT)davidechicco.it
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 saturnscore-1.0.6.tar.gz.
File metadata
- Download URL: saturnscore-1.0.6.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8988941566cca3fca399f3d5a045e2512dfe5eff97230666d5df7885d6ad5ad4
|
|
| MD5 |
1c5e45095a0eada6a2057cd11ebd5da0
|
|
| BLAKE2b-256 |
50a829233cf3ea7d21aa3d2048eabafcd4c94f394bc5f6ed076bab5a09aed503
|
File details
Details for the file saturnscore-1.0.6-py3-none-any.whl.
File metadata
- Download URL: saturnscore-1.0.6-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89562fe1b0fc250fca50f748a5f79fc118355b322f6df19801d5c5d8666713ee
|
|
| MD5 |
81c98e97dcb11586be7849a9bb8457da
|
|
| BLAKE2b-256 |
1e3884b1e110c49a47bfad78e5cd2a8922cddd7c09f4e10c4356df6de9938fe8
|