A new library for extended and performance-focused ForceScheme implementation.
Until we set up a pypi package, you can test the library with
pip install git+https://github.com/visml/neo_force_scheme@0.0.1
You can find examples for simple data, large data with cpu, and large data with gpu
To run the projection:
import numpy as np
from neo_force_scheme import NeoForceScheme
dataset = np.random.random((100, 100)) # Some dataset
nfs = NeoForceScheme()
projection = nfs.fit_transform(dataset)
To use GPU, be sure to have CUDA toolkit installed.
import numpy as np
from neo_force_scheme import NeoForceScheme
dataset = np.random.random((100, 100)) # Some dataset
nfs = NeoForceScheme(cuda=True)
projection = nfs.fit_transform(dataset)
import numpy as np
from neo_force_scheme import NeoForceScheme, kruskal_stress
dataset = np.random.random((100, 100)) # Some dataset
nfs = NeoForceScheme(cuda=True)
projection = nfs.fit_transform(dataset)
stress = kruskal_stress(nfs.embedding_, projection)
import matplotlib.pyplot as plt
import numpy as np
from neo_force_scheme import NeoForceScheme
from matplotlib.colors import ListedColormap
dataset = np.random.random((100, 100)) # Some dataset without labels
labels = np.random.random(100) # Per-row labels
nfs = NeoForceScheme(cuda=True)
projection = nfs.fit_transform(dataset)
plt.figure()
plt.scatter(projection[:, 0],
projection[:, 1],
c=labels,
cmap=ListedColormap(['blue', 'red', 'green']),
edgecolors='face',
linewidths=0.5,
s=4)
plt.grid(linestyle='dotted')
plt.show()
import numpy as np
from neo_force_scheme import NeoForceScheme
# NOTE: plotly is not is not included in the package's dependencies
# so that it need to be installed seperately.
import plotly.graph_objects as go
dataset = np.random.random((100, 100)) # Some dataset without labels
labels = np.random.random(100) # Per-row labels
nfs = NeoForceScheme(cuda=True)
projection = nfs.fit_transform(dataset)
fig = go.Figure(data=
go.Scatter(x=projection[:, 0],
y=projection[:, 1],
mode='markers',
marker=dict(
size=16,
color=np.random.randn(100),
colorscale='Viridis',
showscale=True)
)
)
fig.show()
More information can be found at our documentation page
@software{qiaodan_luo_2022_7379477,
author = {Qiaodan Luo and
Leonardo Christino and
Fernando Paulovich},
title = {visml/neo\_force\_scheme: Eurovis Submission},
month = nov,
year = 2022,
publisher = {Zenodo},
version = {0.0.3},
doi = {10.5281/zenodo.7379477},
url = {https://doi.org/10.5281/zenodo.7379477}
}