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.3.tar.gz (42.7 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for prosphera-1.0.3.tar.gz
Algorithm Hash digest
SHA256 eeafe49e6763664f828cd0ac769a1fe7f775c4615de4f397842f050c6bdb012f
MD5 f9f9aa3553a97029649d34410eab269b
BLAKE2b-256 120d49ad25aff6206aa53d30b75f7267e11930b66116c7a7af52ddae7ce77a5e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prosphera-1.0.3-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.5

File hashes

Hashes for prosphera-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cc1900e4ff31f348f85e79d645439fc6b9965330eeff44aba76066af45c16d32
MD5 85dbb6e9bf568f318ed80a827e7b6950
BLAKE2b-256 8d10e2edf83bfac572567e0cd0e71a63a0efa7709f1bc4c8fcbe62f4021c1f69

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