lmcinnes / umap

Uniform Manifold Approximation and Projection
BSD 3-Clause "New" or "Revised" License
7.44k stars 807 forks source link

Type Error #561

Open kangotti opened 3 years ago

kangotti commented 3 years ago

hello,

I am trying to run this algorithm on my dataset but I am getting this TypeError.

TypeError Traceback (most recent call last)

in 22 intersection = umap.umap_.general_simplicial_set_intersection(fit1.graph_, fit2.graph_, weight=categorical_weight) 23 intersection = umap.umap_.reset_local_connectivity(intersection) ---> 24 embedding = umap.umap_.simplicial_set_embedding(fit1._raw_data, intersection, fit1.n_components, 25 fit1._initial_alpha, fit1._a, fit1._b, 26 fit1.repulsion_strength, fit1.negative_sample_rate, TypeError: simplicial_set_embedding() missing 2 required positional arguments: 'densmap_kwds' and 'output_dens'
lmcinnes commented 3 years ago

The newer code has some extra parameters to that function (which is largely an internal function). On the plus side you should now be able to do something like

combined = fit1 * fit2

to get the same result as what you seem to be hand coding there.

arnaud-nt2i commented 3 years ago

@lmcinnes Could you elaborate on how to how to use new combined fits?

To everyone else reading this: the two new parameters should be filled by respectively "{}" and "False"

lmcinnes commented 3 years ago

I believe you should be able to see more details on the combined fits in the documentation: https://umap-learn.readthedocs.io/en/latest/composing_models.html

arnaud-nt2i commented 3 years ago

@lmcinnes thank you. Sorry for RTFM issu...

gaurav-95 commented 3 years ago

Also as a consequence when plotting the scatter map the result has to be converted to an array and the first index should be plotted:

Ex: plt.scatter(*np.array(embedding)[0].T, s=2, cmap='Spectral', alpha=1.0)

epkuznetsova commented 2 years ago

I passed the following arguments. Might not be the right thing to do, but it got the job done: (..., densmap_kwds = {}, output_dens = False)