Libraries and scripts for notebooks
Watson Studio includes many preinstalled libraries for Python and R in its runtime environments:
- Spark libraries, such as, SparkSQL, Spark Streaming, and Spark MLlib
- Open source visualization libraries, such as GraphX
- PixieDust helper library
- Brunel visualization library
- SPSS model visualization library
- Deep learning libraries
- SPSS predictive analytics algorithms
- Decision Optimization
- Python project-lib library
- R project-lib library
To work with Scala in a notebook, use a Spark environment.
Listing installed libraries
Before you install any libraries by way of a notebook, you should check if those libraries are already preinstralled in the runtime environment. If a library is not preinstalled, you should customize the environment definition and not add this library through the notebook. That way, the library is preinstalled each time the environment runtime is started. Libraries that you add to your environment runtime through a notebook are persisted for the lifetime of the runtime only. If the runtime is stopped and later restarted, those libraries are not installed.
Bear in mind that you can only customize a environment definition that you created; you can’t customize the preset default environment definitions provided by Watson Studio.
Currently, you can only customize a default environment definition that you created. For all other environment types, namely Spark and GPU, you need to install custom or additional libraries through the notebook.
To see the list of installed libraries in your Watson Studio environment:
- Click your project’s Environments tab.
- From the Environment definitions list, click the environment definition you want to use. This opens the environment definition details page where you can see the list of installed libraries.
- Optional: Add custom libraries and packages. See customizating the software configuration.
Importing an installed library
To import an installed library into your notebook, run the appropriate command from a notebook cell with the library name:
Alternatively, you can write a script that includes multiple classes and methods and then import the script into your notebook. Watch this video to see how to use the Spark Machine Learning Libraries.