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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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