Databricks Machine Learning Associate exam dumps

Databricks Machine Learning Associate practice question 45 of 656

Databricks Certified Machine Learning Associate. Associate level, Databricks. Free question with the correct answer and a full explanation.

Databricks Machine Learning Associate Question 45

Single answer

You are working on a Databricks cluster and need to install a Python library so it is available to all notebooks running on the cluster. Which approach should you take?

  1. A

    Use the %pip install command inside one of the notebooks

  2. B

    Install the library via the Library tab in the Cluster configuration

  3. C

    Use the dbutils.library.install() command in a notebook

  4. D

    Manually add the library to each notebook using the sys.path.append() function

Show answer and explanation

Correct answer: B

Explanation

The recommended way to install a Python library for all notebooks on a Databricks cluster is to use the Library tab in the Cluster configuration. This ensures the library is installed at the cluster level and is available to all notebooks that run on the cluster. Other methods, like using %pip install or dbutils, are either limited to individual notebooks or unsupported in this context.

  • A. Incorrect.

    Using %pip install in a notebook only makes the library available to that specific notebook session. This does not ensure availability across all notebooks on the cluster.

  • B. Correct.

    Installing the library via the Library tab in the Cluster configuration ensures that the library is installed on the cluster and is available to all notebooks running on the cluster.

  • C. Incorrect.

    The dbutils.library.install() command is not the recommended or supported approach for installing libraries in Databricks, and this method is deprecated.

  • D. Incorrect.

    Manually adding the library to each notebook using sys.path.append() is not a scalable or practical method for ensuring availability across notebooks on the cluster.

Timed practice exam

Take a Databricks Machine Learning Associate practice test under exam conditions

48 questions in 90 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam