def _get_model_type(self):
    if self.params_aux.get('use_daal', True):
        try:
            from sklearnex import patch_sklearn
            patch_sklearn('knn_classifier')
            patch_sklearn('knn_regressor')
            logger.log(15, '\tUsing daal4py KNN backend...')
        except:
            pass
    try:
        from ._knn_loo_variants import KNeighborsClassifier, KNeighborsRegressor
    except:
        from sklearn.neighbors import KNeighborsClassifier, KNeighborsRegressor
        logger.warning('WARNING: Leave-one-out variants of KNN failed to import. Falling back to standard KNN implementations.')
    if (self.problem_type == REGRESSION):
        return KNeighborsRegressor
    else:
        return KNeighborsClassifier
def _get_model_type(self):
    if self.params_aux.get('use_daal', True):
        try:
            from sklearnex import patch_sklearn
            patch_sklearn('knn_classifier')
            patch_sklearn('knn_regressor')
            logger.log(15, '\tUsing daal4py KNN backend...')
        except:
            pass
    try:
        from ._knn_loo_variants import KNeighborsClassifier, KNeighborsRegressor
    except:
        from sklearn.neighbors import KNeighborsClassifier, KNeighborsRegressor
        logger.warning('WARNING: Leave-one-out variants of KNN failed to import. Falling back to standard KNN implementations.')
    if (self.problem_type == REGRESSION):
        return KNeighborsRegressor
    else:
        return KNeighborsClassifier