Question 1
Content Domain 4: Machine Learning Implementation and OperationsA data scientist uses an Amazon SageMaker notebook instance to conduct data exploration and analysis. This requires certain Python packages that are not natively available on Amazon SageMaker to be installed on the notebook instance. How can a machine learning specialist ensure that required packages are automatically available on the notebook instance for the data scientist to use?
Correct answer: D
Explanation
Amazon SageMaker notebook instances support lifecycle configurations to run scripts when the instance starts. By adding package installation commands there, the required Python packages are installed automatically and are available for the data scientist each time the notebook instance is used.
Why each option is right or wrong
A. Install AWS Systems Manager Agent on the underlying Amazon EC2 instance and use Systems Manager Automation to execute the package installation commands.
Systems Manager automates EC2 operations generally, but SageMaker notebook customization is natively handled by lifecycle configurations.
B. Create a Jupyter notebook file (.ipynb) with cells containing the package installation commands to execute and place the file under the /etc/init directory of each Amazon SageMaker notebook instance.
A notebook file is user content, not a startup mechanism for automatic package installation.
C. Use the conda package manager from within the Jupyter notebook console to apply the necessary conda packages to the default kernel of the notebook.
Manual conda installation can work interactively, but it does not ensure automatic availability on instance startup.
D. Create an Amazon SageMaker lifecycle configuration with package installation commands and assign the lifecycle configuration to the notebook instance.
Amazon SageMaker notebook instances support lifecycle configuration scripts that run on start-up, and the relevant mechanism is the notebook instance lifecycle configuration attached to the instance. Under the SageMaker notebook instance lifecycle configuration feature, a start script can execute package installation commands each time the instance is created or started, so the required Python libraries are present without manual setup.