Skip to main content

Visualize Multidimensional Data on a Sphere

Project description

This tool utilises sophisticated PCA with a cosine kernel to generate informative visualisations of multi-dimensional data in three-dimensional space. Following the PCA process, the data is normalised by shifting each point to a centroid and making it the unit norm. To enhance the visualisation, vectors are additionally scaled with precision to move the farthest points closer to the surface of the sphere. The outcome is an engaging and instinctive representation of the data in spherical format. The tool initiates interactive visualisations in a new tab of your default web browser, facilitating data exploration and analysis.

Basic Usage

Init visualizer

import pandas as pd
from sklearn import datasets
from sklearn.datasets import make_blobs
from prosphera.projector import Projector

# Instantiate the class
visualizer = Projector()

Generated dataset

# Generate data
data, labels = make_blobs(
    n_samples=5000,
    centers=50,
    n_features=25,
    random_state=1234)

# Call the visualize method to generate and display the visualization
visualizer.project(
    data=data,
    labels=labels)

Browser tab:

image

Wine dataset

wine = datasets.load_wine()

visualizer.project(
    data=wine['data'],
    labels=wine['target'])

Browser tab:

image

Cancer dataset

cancer = datasets.load_breast_cancer()

visualizer.project(
    data=cancer['data'],
    labels=cancer['target'])

Browser tab:

image

Digits dataset (no labels)

digits = datasets.load_digits(n_class=5)

visualizer.project(
    data=digits['data'],
    meta=digits['target'])

Browser tab:

image

Digits dataset (apply labels)

visualizer.project(
    data=digits['data'],
    labels=digits['target'])

Browser tab:

image

Housing dataset (labels from 'age')

housing = datasets.fetch_california_housing()

visualizer.project(
    data=housing['data'],
    labels=pd.qcut(housing['data'][:, 1], 5).astype(str))

Browser tab:

image

Change renderer

You can set renderer as visualizer = Projector(renderer='iframe') to save the plot locally as HTML. Available renderers:

  • 'jupyterlab'
  • 'vscode'
  • 'notebook'
  • 'kaggle'
  • 'colab' and others

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prosphera-1.0.5.tar.gz (42.7 kB view details)

Uploaded Source

Built Distribution

prosphera-1.0.5-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

Details for the file prosphera-1.0.5.tar.gz.

File metadata

  • Download URL: prosphera-1.0.5.tar.gz
  • Upload date:
  • Size: 42.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for prosphera-1.0.5.tar.gz
Algorithm Hash digest
SHA256 51056c19f2bf883bf6047b397ee9afe63160282d4441793524e5e25ff7b15e85
MD5 eeefda74a77ec9d3b4e94825fab6a1f7
BLAKE2b-256 b7648ff737af81a3cb041f3b03c4f7e54a59cde6888fd970d4fc1a511546ce8d

See more details on using hashes here.

File details

Details for the file prosphera-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: prosphera-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 29.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for prosphera-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6841eb349e6eeab0e31f95d28a1881f1d6f279c49be14fc5d89e60f78ff15f3d
MD5 fcbbee270d8257e4c002fd7a90046517
BLAKE2b-256 2d1b21679b62158cee8203bb26dc740bd24b02afd218fa1023832f6434e33d5f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page