size(X, 1) must be greater than n_components and n_components must be greater than 1

Viewed 59

I got a 2*86 matrix. And I want to apply umap on this matrix in Julia. So my code is

embedding = umap(matrix; n_neighbors=2, min_dist=0.1, n_epochs=200)

While I got the error "ArgumentError: size(X, 1) must be greater than n_components and n_components must be greater than 1" How to solve this error?

1 Answers

If you have an n×m matrix, UMAP.jl interprets it as m observations of n-dimmensional data, i.e. every column in your input is a vector in your input space. Since umap reduces the dimensionality of your data the number of rows in your input needs to be larger than than the requested number of output components, n_components which defaults to 2 and can't (at this moment) be 1 in UMAP.jl.

You have 86 observations of 2-dimensional data. Since the data is already 2-dimensional you can't use umap to reduce the dimensionality.

Related