Python interface to the langevintour
Project description
pyLangevitour
Python interface for langevitour. langevitour is an 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,
levels=["a", "b", "c", "d"],
extra_axes=extra_axes,
extra_axes_names=extra_axes_names,
scale=[2, 1, 1, 1, 1],
center=[10, 20, 30, 40, 50],
point_size=1,
)
tour.write_html("langevitour_plot.html")
pyLangevitour also works in jupyter notebooks.
License
pyLangevitour
is distributed under the terms of the MIT license.
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.0.2.tar.gz
(4.2 MB
view hashes)
Built Distribution
Close
Hashes for langevitour-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb05911edd16451aa3f86e409f773bd0cff0fd722e074fb754f3986fa5aa6bfe |
|
MD5 | d3663c9872d997eb42e0b2d559ec2985 |
|
BLAKE2b-256 | 04d34661b18c08bdd4ff80b2a4cdc66c4e01aef50f6743312fa514e8415ce2e8 |