File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -883,11 +883,19 @@ def generate_prediction_data(self):
883
883
you are intending to use functions from ``hdbscan.prediction``.
884
884
"""
885
885
886
- if self .metric != 'precomputed' :
886
+ if self .metric not in FAST_METRICS :
887
887
min_samples = self .min_samples or self .min_cluster_size
888
+ if self .metric in KDTree .valid_metrics :
889
+ tree_type = 'kdtree'
890
+ elif self .metric in BallTree .valid_metrics :
891
+ tree_type = 'balltree'
892
+ else :
893
+ warn ('Metric {} not supported for prediction data!' .format (self .metric ))
894
+ return
895
+
888
896
self ._prediction_data = PredictionData (
889
897
self ._raw_data , self .condensed_tree_ , min_samples ,
890
- tree_type = 'kdtree' , metric = self .metric ,
898
+ tree_type = tree_type , metric = self .metric ,
891
899
** self ._metric_kwargs
892
900
)
893
901
else :
You can’t perform that action at this time.
0 commit comments