Skip to content

Commit

Permalink
fix knn balltree warning
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgigante committed Jun 19, 2018
1 parent ee767f9 commit 2f312c9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions graphtools/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,11 @@ def knn_tree(self):
n_jobs=self.n_jobs).fit(self.data_nu)
except ValueError:
# invalid metric
log_warning(
warnings.warn(
"Metric {} not valid for `sklearn.neighbors.BallTree`. "
"Graph instantiation may be slower than normal.")
"Graph instantiation may be slower than normal.".format(
self.distance),
UserWarning)
self._knn_tree = NearestNeighbors(
n_neighbors=self.knn,
algorithm='auto',
Expand Down

0 comments on commit 2f312c9

Please sign in to comment.