Skip to content

Commit

Permalink
Simplest possible solution for issue #23. Hopefully this is sufficient.
Browse files Browse the repository at this point in the history
  • Loading branch information
lmcinnes committed Nov 22, 2017
1 parent b11250d commit 589ef08
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion umap/umap_.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,10 @@ def rptree_leaf_array(data, n_neighbors, rng_state, n_trees=10, angular=False):
leaf_array = -1 * np.ones([len(leaves), leaf_size], dtype=np.int64)
for i, leaf in enumerate(leaves):
leaf_array[i, :len(leaf)] = leaf
except RecursionError:
except (RuntimeError, RecursionError):
warn('Random Projection forest initialisation failed due to recursion'
'limit being reached. Something is a little strange with your '
'data, and this may take longer than normal to compute.')
leaf_array = np.array([[-1]])

return leaf_array
Expand Down Expand Up @@ -1558,6 +1561,8 @@ def fit(self, X, y=None):
self.verbose
)

return self

def fit_transform(self, X, y=None):
"""Fit X into an embedded space and return that transformed
output.
Expand Down

0 comments on commit 589ef08

Please sign in to comment.