Python interface to langevintour
Project description
langevitour for Python
Python interface for langevitour a HTML widget that randomly tours projections of a high-dimensional dataset with an animated scatter-plot.
For more information see the langevitour Github repo or website.
Installation
pip install langevitour
Python usage
import numpy as np
from langevitour import Langevitour
# Generate a sample dataset
X = []
group = []
n = 20000
def r():
return np.random.normal(0, 0.02)
for i in range(n):
a = i/n * np.pi * 2
X.append([
10 + np.sin(a)/3 + r(),
20 + np.sin(a*2)/3 + r(),
30 + np.sin(a*3)/3,
40 + np.sin(a*4)/3,
50 + np.sin(a*5)/3
])
group.append(int(i*4/n))
# Extra axes (specified as columns of a matrix)
extra_axes = [[1], [2], [0], [0], [0]]
extra_axes_names = ["V1+2*V2"]
tour = Langevitour(
X,
group=group,
extra_axes=extra_axes,
extra_axes_names=extra_axes_names,
point_size=1,
)
tour.write_html("langevitour_plot.html")
langevitour also works in jupyter notebooks.
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
langevitour-0.5.5.tar.gz
(54.7 kB
view hashes)
Built Distribution
Close
Hashes for langevitour-0.5.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30976251d250cbf03f7ca2c3e53c134be6bfb2e19cff2dc81b7ab79aa20150ec |
|
MD5 | e6b2ce5277a6c1e41238c96f7fcc76fb |
|
BLAKE2b-256 | 93e3d17919b7dde724b86e49f9c2552618a407a874f821b35c1f38914530885e |