def _is_algorithm_kd_tree(model):
    """Checks if the algorithm for the scikit model is set to 'kd_tree'."""
    return model.algorithm == "kd_tree" or (
        model.algorithm == "auto" and model._fit_method == "kd_tree"
    )
Checks if the algorithm for the scikit model is set to 'kd_tree'.
coremltools/converters/sklearn/_k_neighbors_classifier.py