Supported Algorithms

Note

To verify that oneDAL is being used for these algorithms, you can enable verbose mode. See Verbose Mode for details.

Applying Extension for Scikit-learn* impacts the following scikit-learn estimators:

on CPU

Classification

Algorithm

Parameters

Data formats

Other limitations

sklearn.svm.SVC

kernel must be one of ["linear", "rbf", "poly", "sigmoid"]

Negative weights are not supported.

probability=True is not supported with array API classes other than NumPy.

sklearn.svm.NuSVC

kernel must be one of ["linear", "rbf", "poly", "sigmoid"]

Negative weights are not supported.

sklearn.ensemble.RandomForestClassifier

All parameters are supported except:

  • warm_start = True

  • ccp_alpha != 0

  • criterion != 'gini'

  • n_estimators > 6024

  • bootstrap = True and/or max_samples != None are not supported when there are sample weights

  • Non-integer max_samples larger than 1 or integer max_samples greater than number of rows, with bootstrap=True

Multi-output and sparse data are not supported. Missing values and infinite values are not supported.

Number of classes must be at least 2.

sklearn.ensemble.ExtraTreesClassifier

All parameters are supported except:

  • warm_start = True

  • ccp_alpha != 0

  • criterion != 'gini'

  • n_estimators > 6024

  • bootstrap = True and/or max_samples != None are not supported when there are sample weights

  • Non-integer max_samples larger than 1 or integer max_samples greater than number of rows, with bootstrap=True

Multi-output and sparse data are not supported. Missing values and infinite values are not supported.

Number of classes must be at least 2.

sklearn.neighbors.KNeighborsClassifier

  • For algorithm == 'kd_tree':

    all parameters except metric != 'euclidean' or 'minkowski' with p != 2

  • For algorithm == 'brute':

    all parameters except metric not in ['euclidean', 'manhattan', 'minkowski', 'chebyshev', 'cosine']

algorithm == 'ball_tree' is not supported.

Multi-output and sparse data are not supported.

Number of classes must be at least 2.

sklearn.linear_model.LogisticRegression

All parameters are supported except:

  • solver not in ['lbfgs', 'newton-cg']

  • l1_ratio != 0

  • dual = True

  • sample_weight != None

  • class_weight != None

  • Solver 'newton-cg' with fit_intercept = False is not supported

Sparse data is not supported.

Solver 'newton-cg' is only available in preview mode. Important: this estimator should not be used in parallel Python threads - for concurrent fits (e.g. from sklearn.model_selection.GridSearchCV), process-based parallelism should be used instead (default backend for joblib).

sklearn.linear_model.LogisticRegressionCV

All parameters are supported except:

  • solver not in ['lbfgs', 'newton-cg']

  • l1_ratios not in [0, "warn"]

  • dual = True

  • sample_weight != None

  • class_weight != None

  • Solver 'newton-cg' with fit_intercept = False is not supported

Sparse data is not supported.

Estimator is only available in preview mode.

Regression

Algorithm

Parameters

Data formats

sklearn.svm.SVR

kernel must be one of ["linear", "rbf", "poly", "sigmoid"]

Negative weights are not supported.

sklearn.svm.NuSVR

kernel must be one of ["linear", "rbf", "poly", "sigmoid"]

Negative weights are not supported.

sklearn.ensemble.RandomForestRegressor

All parameters are supported except:

  • warm_start = True

  • ccp_alpha != 0

  • criterion != 'squared_error'

  • n_estimators > 6024

  • bootstrap = True and/or max_samples != None are not supported when there are sample weights

  • Non-integer max_samples larger than 1 or integer max_samples greater than number of rows, with bootstrap=True

Multi-output and sparse data are not supported. Missing values and infinite values are not supported.

sklearn.ensemble.ExtraTreesRegressor

All parameters are supported except:

  • warm_start = True

  • ccp_alpha != 0

  • criterion != 'squared_error'

  • n_estimators > 6024

  • bootstrap = True and/or max_samples != None are not supported when there are sample weights

  • Non-integer max_samples larger than 1 or integer max_samples greater than number of rows, with bootstrap=True

Multi-output and sparse data are not supported. Missing values and infinite values are not supported.

sklearn.neighbors.KNeighborsRegressor

  • For algorithm == 'kd_tree':

    all parameters except metric != 'euclidean' or 'minkowski' with p != 2

  • For algorithm == 'brute':

    all parameters except metric not in ['euclidean', 'manhattan', 'minkowski', 'chebyshev', 'cosine']

algorithm == 'ball_tree' is not supported.

Multi-output and sparse data are not supported

sklearn.linear_model.LinearRegression

All parameters are supported except:

Only dense data is supported.

sklearn.linear_model.Ridge

All parameters are supported except:

Only dense data is supported.

sklearn.linear_model.ElasticNet

All parameters are supported except:

  • sample_weight != None

Sparse data is not supported.

sklearn.linear_model.Lasso

All parameters are supported except:

  • sample_weight != None

Sparse data is not supported.

Clustering

Algorithm

Parameters

Data formats

sklearn.cluster.KMeans

All parameters are supported except:

  • algorithm != 'lloyd' (‘elkan’ falls back to ‘lloyd’)

  • n_clusters = 1

  • sample_weight must be None, constant, or equal weights

  • verbose = True will only print results from the last iteration, and will only print inertia numbers, not ‘convergence achieved’ messages.

No limitations

sklearn.cluster.DBSCAN

All parameters are supported except:

  • metric != 'euclidean' or 'minkowski' with p != 2

  • algorithm not in ['brute', 'auto']

Only dense data is supported

Dimensionality Reduction

Algorithm

Parameters

Data formats

Other limitations

sklearn.decomposition.PCA

All parameters are supported except:

  • svd_solver not in ['full', 'covariance_eigh', 'onedal_svd']

  • For scikit-learn < 1.5: 'full' solver is automatically mapped to 'covariance_eigh'

Sparse data is not supported

sklearn.decomposition.IncrementalPCA

All parameters are supported except:

  • svd_solver not in ['full', 'covariance_eigh', 'onedal_svd']

  • For scikit-learn < 1.5: 'full' solver is automatically mapped to 'covariance_eigh'

Sparse data is not supported

Estimator is only available in preview mode.

sklearn.manifold.TSNE

All parameters are supported except:

  • metric != ‘euclidean’ or 'minkowski' with p != 2

  • n_components can only be 2

  • method != "barnes_hut"

Refer to TSNE acceleration details to learn more.

Sparse data is not supported for the initialization and distance calculation stages.

Anomaly Detection

Algorithm

Parameters

Data formats

sklearn.neighbors.LocalOutlierFactor

  • For algorithm == 'kd_tree':

    all parameters except metric != 'euclidean' or 'minkowski' with p != 2

  • For algorithm == 'brute':

    all parameters except metric not in ['euclidean', 'manhattan', 'minkowski', 'chebyshev', 'cosine']

algorithm == 'ball_tree' is not supported.

Sparse data is not supported

Nearest Neighbors

Algorithm

Parameters

Data formats

sklearn.neighbors.NearestNeighbors

  • For algorithm == 'kd_tree':

    all parameters except metric != 'euclidean' or 'minkowski' with p != 2

  • For algorithm == 'brute':

    all parameters except metric not in ['euclidean', 'manhattan', 'minkowski', 'chebyshev', 'cosine']

algorithm == 'ball_tree' is not supported.

Sparse data is not supported

Other Tasks

Algorithm

Parameters

Data formats

Other limitations

sklearn.covariance.EmpiricalCovariance

All parameters are supported

Only dense data is supported

Estimator is only available in preview mode.

sklearnex.basic_statistics.BasicStatistics

All parameters are supported

Supported data formats:

  • Dense data

  • CSR sparse matrices

Sample weights are not supported for CSR data format

sklearn.model_selection.train_test_split

All parameters are supported

Supported data formats:

  • Only dense data is supported

  • Only integer and 32/64-bits floating point types are supported

  • Data with more than 3 dimensions is not supported

  • Only np.ndarray, pd.DataFrame and pd.Series inputs are supported.

sklearn.metrics.pairwise_distances

All parameters are supported except:

  • metric not in ['cosine', 'correlation']

Supported data formats:

  • Only dense data is supported

  • Y must be None

  • Input dtype must be np.float64

sklearn.metrics.roc_auc_score

All parameters are supported except:

  • average != None

  • sample_weight != None

  • max_fpr != None

  • multi_class != None

Only binary y_true is supported

on GPU

See also

GPU support

Classification

Algorithm

Parameters

Data formats

Other limitations

sklearn.svm.SVC

All parameters are supported except:

  • kernel not in ["linear", "rbf"]

  • class_weight != None

  • probability != False (see limitations on this)

Only dense data is supported. Negative weights are not supported.

Only binary classification is supported. If passing probability=True, under target_offload, the initial model will be fitted on GPU, but subsequent calibration will be done on CPU through scikit-learn; whereas if passing array API inputs with probability=True, the whole procedure will fall back to scikit-learn on CPU.

sklearn.ensemble.RandomForestClassifier

All parameters are supported except:

  • warm_start = True

  • ccp_alpha != 0

  • criterion != 'gini'

  • oob_score = True

  • sample_weight != None

  • n_estimators > 6024

  • bootstrap = True and/or max_samples != None are not supported when there are sample weights

  • Non-integer max_samples larger than 1 or integer max_samples greater than number of rows, with bootstrap=True

Multi-output and sparse data are not supported. Missing values and infinite values are not supported.

Number of classes must be at least 2.

sklearn.ensemble.ExtraTreesClassifier

All parameters are supported except:

  • warm_start = True

  • ccp_alpha != 0

  • criterion != 'gini'

  • oob_score = True

  • sample_weight != None

  • n_estimators > 6024

  • bootstrap = True and/or max_samples != None are not supported when there are sample weights

  • Non-integer max_samples larger than 1 or integer max_samples greater than number of rows, with bootstrap=True

Multi-output and sparse data are not supported. Missing values and infinite values are not supported.

Number of classes must be at least 2.

sklearn.neighbors.KNeighborsClassifier

All parameters are supported except:

  • algorithm != 'brute'

  • weights = 'callable'

  • metric not in ['euclidean', 'manhattan', 'minkowski', 'chebyshev', 'cosine']

Only dense data is supported.

Number of classes must be at least 2. The following methods are not accelerated by Extension for Scikit-learn* and will fall back to scikit-learn on CPU, returning NumPy arrays when using array API inputs: radius_neighbors(), radius_neighbors_graph().

sklearn.linear_model.LogisticRegression

All parameters are supported except:

  • solver != 'newton-cg'

  • class_weight != None

  • sample_weight != None

  • dual = True

  • intercept_scaling != 1

  • warm_start = True

  • l1_ratio != 0

No limitations.

Only binary classification is supported.

Regression

Algorithm

Parameters

Data formats

sklearn.ensemble.RandomForestRegressor

All parameters are supported except:

  • warm_start = True

  • ccp_alpha != 0

  • criterion != 'squared_error'

  • oob_score = True

  • sample_weight != None

  • n_estimators > 6024

  • bootstrap = True and/or max_samples != None are not supported when there are sample weights

  • Non-integer max_samples larger than 1 or integer max_samples greater than number of rows, with bootstrap=True

Multi-output and sparse data are not supported. Missing values and infinite values are not supported.

sklearn.ensemble.ExtraTreesRegressor

All parameters are supported except:

  • warm_start = True

  • ccp_alpha != 0

  • criterion != 'squared_error'

  • oob_score = True

  • sample_weight != None

  • n_estimators > 6024

  • bootstrap = True and/or max_samples != None are not supported when there are sample weights

  • Non-integer max_samples larger than 1 or integer max_samples greater than number of rows, with bootstrap=True

Multi-output and sparse data are not supported. Missing values and infinite values are not supported.

sklearn.neighbors.KNeighborsRegressor

All parameters are supported except:

  • algorithm != 'brute'

  • weights = 'callable'

  • metric not in ['euclidean', 'manhattan', 'minkowski', 'chebyshev', 'cosine']

Only dense data is supported. The following methods are not accelerated by Extension for Scikit-learn* and will fall back to scikit-learn on CPU, returning NumPy arrays when using array API inputs: radius_neighbors(), radius_neighbors_graph().

sklearn.linear_model.Ridge

All parameters are supported except:

  • solver != 'auto'

  • sample_weight != None

  • positive = True

  • alpha must be a scalar

Only dense data is supported.

sklearn.linear_model.LinearRegression

All parameters are supported except:

  • sample_weight != None

  • positive = True

Only dense data is supported.

Clustering

Algorithm

Parameters

Data formats

sklearn.cluster.KMeans

All parameters are supported except:

  • algorithm != 'lloyd' (‘elkan’ falls back to ‘lloyd’)

  • n_clusters = 1

  • sample_weight must be None, constant, or equal weights

  • init = 'k-means++' falls back to CPU

  • verbose = True will only print results from the last iteration, and will only print inertia numbers, not ‘convergence achieved’ messages.

No limitations

sklearn.cluster.DBSCAN

All parameters are supported except:

  • metric != 'euclidean'

  • algorithm not in ['brute', 'auto']

Only dense data is supported

Dimensionality Reduction

Algorithm

Parameters

Data formats

Other limitations

sklearn.decomposition.PCA

All parameters are supported except:

  • svd_solver not in ['full', 'covariance_eigh', 'onedal_svd']

  • For scikit-learn < 1.5: 'full' solver is automatically mapped to 'covariance_eigh'

Sparse data is not supported

sklearn.decomposition.IncrementalPCA

All parameters are supported except:

  • svd_solver not in ['full', 'covariance_eigh']

  • For scikit-learn < 1.5: 'full' solver is automatically mapped to 'covariance_eigh'

Sparse data is not supported

Estimator is only available in preview mode.

Anomaly Detection

Algorithm

Parameters

Data formats

Other limitations

sklearn.neighbors.LocalOutlierFactor

All parameters are supported except:

  • algorithm != 'brute'

  • metric not in ['euclidean', 'manhattan', 'minkowski', 'chebyshev', 'cosine']

Only dense data is supported

If using target_offload, some computations outside of neighbor calculations (related to thresholds for outlierness) might happen on CPU.

Nearest Neighbors

Algorithm

Parameters

Data formats

sklearn.neighbors.NearestNeighbors

All parameters are supported except:

  • algorithm != 'brute'

  • metric not in ['euclidean', 'manhattan', 'minkowski', 'chebyshev', 'cosine']

Only dense data is supported. The following methods are not accelerated by Extension for Scikit-learn* and will fall back to scikit-learn on CPU, returning NumPy arrays when using array API inputs: radius_neighbors(), radius_neighbors_graph().

sklearn.neighbors.LocalOutlierFactor

All parameters are supported except:

  • algorithm != 'brute'

  • metric not in ['euclidean', 'manhattan', 'minkowski', 'chebyshev', 'cosine']

Only dense data is supported.

Other Tasks

Algorithm

Parameters

Data formats

Other limitations

sklearn.covariance.EmpiricalCovariance

All parameters are supported

Only dense data is supported

Estimator is only available in preview mode.

sklearnex.basic_statistics.BasicStatistics

All parameters are supported

Supported data formats:

  • Dense data

  • CSR sparse matrices

Sample weights are not supported for CSR data format.

SPMD Support

Classification

Algorithm

Parameters & Methods

Data formats

Other limitations

sklearn.ensemble.RandomForestClassifier

All parameters are supported except:

  • warm_start = True

  • ccp_alpha != 0

  • criterion != 'gini'

  • oob_score = True

  • sample_weight != None

  • n_estimators > 6024

  • bootstrap = True and/or max_samples != None are not supported when there are sample weights

  • Non-integer max_samples larger than 1 or integer max_samples greater than number of rows, with bootstrap=True

Multi-output and sparse data are not supported. Missing values and infinite values are not supported.

Number of classes must be at least 2.

sklearn.ensemble.ExtraTreesClassifier

All parameters are supported except:

  • warm_start = True

  • ccp_alpha != 0

  • criterion != 'gini'

  • oob_score = True

  • sample_weight != None

  • n_estimators > 6024

  • bootstrap = True and/or max_samples != None are not supported when there are sample weights

  • Non-integer max_samples larger than 1 or integer max_samples greater than number of rows, with bootstrap=True

Multi-output and sparse data are not supported. Missing values and infinite values are not supported.

Number of classes must be at least 2.

sklearn.neighbors.KNeighborsClassifier

All parameters are supported except:

  • algorithm != 'brute'

  • weights = 'callable'

  • metric not in ['euclidean', 'manhattan', 'minkowski', 'chebyshev', 'cosine']

  • predict_proba method not supported

Only dense data is supported.

Number of classes must be at least 2.

sklearn.linear_model.LogisticRegression

All parameters are supported except:

  • solver != 'newton-cg'

  • class_weight != None

  • sample_weight != None

  • dual = True

  • intercept_scaling != 1

  • warm_start = True

  • l1_ratio != 0

Method score is not supported.

Only binary classification is supported

Regression

Algorithm

Parameters & Methods

Data formats

sklearn.ensemble.RandomForestRegressor

All parameters are supported except:

  • warm_start = True

  • ccp_alpha != 0

  • criterion != 'squared_error'

  • oob_score = True

  • sample_weight != None

  • n_estimators > 6024

  • bootstrap = True and/or max_samples != None are not supported when there are sample weights

  • Non-integer max_samples larger than 1 or integer max_samples greater than number of rows, with bootstrap=True

Multi-output and sparse data are not supported. Missing values and infinite values are not supported.

sklearn.ensemble.ExtraTreesRegressor

All parameters are supported except:

  • warm_start = True

  • ccp_alpha != 0

  • criterion != 'squared_error'

  • oob_score = True

  • sample_weight != None

  • n_estimators > 6024

  • bootstrap = True and/or max_samples != None are not supported when there are sample weights

  • Non-integer max_samples larger than 1 or integer max_samples greater than number of rows, with bootstrap=True

Multi-output and sparse data are not supported. Missing values and infinite values are not supported.

sklearn.neighbors.KNeighborsRegressor

All parameters are supported except:

  • algorithm != 'brute'

  • weights = 'callable'

  • metric != 'euclidean' or 'minkowski' with p != 2

Only dense data is supported

sklearn.linear_model.LinearRegression

All parameters are supported except:

  • sample_weight != None

  • positive = True

Only dense data is supported.

Clustering

Algorithm

Parameters & Methods

Data formats

sklearn.cluster.KMeans

All parameters are supported except:

  • algorithm != 'lloyd' (‘elkan’ falls back to ‘lloyd’)

  • n_clusters = 1

  • sample_weight must be None, constant, or equal weights

  • init = 'k-means++' falls back to CPU

  • verbose = True will only print results from the last iteration, and will only print inertia numbers, not ‘convergence achieved’ messages.

No limitations

sklearn.cluster.DBSCAN

All parameters are supported except:

  • metric != 'euclidean'

  • algorithm not in ['brute', 'auto']

Only dense data is supported

Dimensionality Reduction

Algorithm

Parameters & Methods

Data formats

Other limitations

sklearn.decomposition.PCA

All parameters are supported except:

  • svd_solver not in ['full', 'covariance_eigh', 'onedal_svd']

  • For scikit-learn < 1.5: 'full' solver is automatically mapped to 'covariance_eigh'

Sparse data is not supported

sklearn.decomposition.IncrementalPCA

All parameters are supported except:

  • svd_solver not in ['full', 'covariance_eigh']

  • For scikit-learn < 1.5: 'full' solver is automatically mapped to 'covariance_eigh'

Sparse data is not supported

Estimator is only available in preview mode.

Nearest Neighbors

Algorithm

Parameters

Data formats

sklearn.neighbors.NearestNeighbors

All parameters are supported except:

  • algorithm != 'brute'

  • metric not in ['euclidean', 'manhattan', 'minkowski', 'chebyshev', 'cosine']

Only dense data is supported

Other Tasks

Algorithm

Parameters

Data formats

Other limitations

sklearn.covariance.EmpiricalCovariance

All parameters are supported

Only dense data is supported

Estimator is only available in preview mode.

sklearnex.basic_statistics.BasicStatistics

All parameters are supported

Supported data formats:

  • Dense data

  • CSR sparse matrices

Sample weights not supported for CSR data format

Scikit-learn Tests

Monkey-patched scikit-learn classes and functions passes scikit-learn’s own test suite, with few exceptions - see Scikit-learn’s test suite for details.