umap icon indicating copy to clipboard operation
umap copied to clipboard

Type Error

Open kangotti opened this issue 4 years ago • 6 comments

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'

kangotti avatar Jan 27 '21 14:01 kangotti

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.

lmcinnes avatar Jan 27 '21 21:01 lmcinnes

@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"

arnaud-nt2i avatar Apr 06 '21 09:04 arnaud-nt2i

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

lmcinnes avatar Apr 06 '21 17:04 lmcinnes

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

arnaud-nt2i avatar Apr 07 '21 16:04 arnaud-nt2i

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)

gaurav-95 avatar Sep 22 '21 13:09 gaurav-95

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

epkuznetsova avatar Dec 08 '21 09:12 epkuznetsova