hsidky / dmaps Goto Github PK
View Code? Open in Web Editor NEWC++ Accelerated Python Diffusion Maps Library
License: MIT License
C++ Accelerated Python Diffusion Maps Library
License: MIT License
Hi, in the README.md, it's mentioned that the package is able to re-weight the kernel for biased input. I wonder how to use that feature since it's not mentioned in the README.
I also can't find the "example folder" that's mentioned in the README. The link to the blog that's mentioned in other issues is also down. Also, is the reweighting scheme the same as the umbrella integrated dmap paper?
Hello,
I'm trying to use your C++ implementation of Diffusion Maps with some of my data, which is really big (37k x 60k matrix). In readme you select the kernel bandwith as 3. How can I properly select a kernel bandwith on my data?
Best!
Davi
Hello and thank you for providing access to your library!
I have been playing around with python version of the library, trying to figure out how it works and repeating the basic example; It seems to be that I am doing something wrong, but I cannnot figure out what as the resulting diffusion map is definately not right. I will be gratefull if you could explain where I am mistaken.
Thank you!
Here is the code:
import dmaps
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
length_phi = 12
length_Z = 12
sigma = 0.1
m = 10000
phi = length_phi * np.random.rand(m)
xi = np.random.rand(m)
Z = length_Z * np.random.rand(m)
X = 1./6 * (phi + sigmaxi) * np.sin(phi)
Y = 1./6 * (phi + sigmaxi) * np.cos(phi)
swiss_roll = np.array([X, Y, Z]).transpose()
print(swiss_roll.shape)
dist = dmaps.DistanceMatrix(swiss_roll)
dist.compute(metric=dmaps.metrics.euclidean)
dist.save('distMetr.jpeg')
diffMap = dmaps.DiffusionMap(dist)
diffMap.set_kernel_bandwidth(3)
diffMap.compute(3)
v = diffMap.get_eigenvectors()
w = diffMap.get_eigenvalues()
plt.rcParams["figure.figsize"] = (8, 12)
fig = plt.figure()
Axes3D
ax = fig.add_subplot(211, projection='3d')
ax.scatter(swiss_roll[:, 0], swiss_roll[:, 1], swiss_roll[:, 2], c=swiss_roll[:, 1], cmap=plt.cm.get_cmap("Spectral"))
ax.set_title("Original data")
ax = fig.add_subplot(212)
arr0 = ax.scatter(v[:, 1]/v[:, 0], v[:, 2]/v[:, 0], c=swiss_roll[:, 1], cmap=plt.cm.get_cmap("Spectral"))
plt.xlabel('$\Psi_2$')
plt.ylabel('$\Psi_3$')
plt.title('Projected data')
plt.show()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.