{"id":23490,"library":"daal4py","title":"daal4py - Intel® oneAPI Data Analytics Library","description":"daal4py provides a convenient Python API to Intel® oneAPI Data Analytics Library (oneDAL) for accelerating machine learning and data analysis. Current stable version is 2024.7.0 on PyPI, with newer releases (2025.11.0) available via Intel's Extension for Scikit-learn. Release cadence is approximately monthly.","status":"active","version":"2024.7.0","language":"python","source_language":"en","source_url":"https://github.com/IntelPython/daal4py","tags":["intel","oneDAL","machine-learning","data-analytics","GPU-accelerated"],"install":[{"cmd":"pip install daal4py","lang":"bash","label":"PyPI"},{"cmd":"conda install -c intel daal4py","lang":"bash","label":"Conda"}],"dependencies":[{"reason":"Core dependency for array operations","package":"numpy","optional":false},{"reason":"For compatibility and integration with scikit-learn estimators","package":"scikit-learn","optional":true}],"imports":[{"note":"No submodule imports; use daal4py.sklearn for patching","symbol":"daal4py","correct":"import daal4py"}],"quickstart":{"code":"import numpy as np\nimport daal4py\nfrom daal4py.oneapi import sycl_context\n# Example: K-Means clustering (oneDAL native)\ndata = np.random.rand(100, 5).astype(np.float64)\nwith sycl_context('cpu'):\n    n_clusters = 3\n    algo = daal4py.kmeans(nClusters=n_clusters, maxIterations=100)\n    result = algo.compute(data)\nprint(result.centroids)","lang":"python","description":"Simple K-Means using oneDAL native API with SYCL context."},"warnings":[{"fix":"Refer to migration guide: https://intelpython.github.io/daal4py/migration.html","message":"daal4py 2020.x has a different API compared to newer versions. Upgrade may require code changes.","severity":"breaking","affected_versions":"<2021.0"},{"fix":"Use standard numpy or dpctl arrays directly.","message":"Internal dpctl tensor handling functionality is deprecated and will be removed in future releases.","severity":"deprecated","affected_versions":">=2025.11.0"},{"fix":"Always create a new algorithm object for each call.","message":"daal4py objects (e.g., from compute) must not be reused after passing to another compute; create fresh instances.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'with sycl_context(\"gpu\"):' to ensure GPU usage.","message":"SYCL context must be set before calling any daal4py compute, otherwise it defaults to CPU host.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install daal4py' or 'conda install -c intel daal4py'","cause":"daal4py not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'daal4py'"},{"fix":"Upgrade daal4py to at least version 2020.0, e.g., 'pip install -U daal4py'","cause":"Using daal4py version older than 2020 where API changed.","error":"AttributeError: module 'daal4py' has no attribute 'kmeans'"},{"fix":"Use 'from daal4py.oneapi import sycl_context' and wrap code in 'with sycl_context(\"cpu\"):'","cause":"Passing wrong object to sycl_context or not importing it correctly.","error":"RuntimeError: Provided context is not sycl_context instance."},{"fix":"Ensure algo.compute(data) passes the input array.","cause":"Calling compute on a method that expects data but none provided.","error":"TypeError: compute() missing 1 required positional argument: 'data'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}