Setting Up and Managing the User Environment | Natural Language Processing | Open Analytics Framework - Setting Up and Managing the User Environment - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
  1. Explore the base environments offered on the target system.
    list_base_envs()

    Out:

           base_name  language version
    0     python_3.8   Python  3.8.18
    1     python_3.9   Python  3.9.18
    2    python_3.10   Python  3.10.13
    3          r_4.1        R   4.1.3
    4          r_4.0        R   4.0.5
    5          r_4.2        R   4.2.2
  2. Create a new R user environment from available base environment equipped with R 4.1.3.
    demo_env = create_env(env_name = 'tokenizers_r_env',
                          base_env = 'r_4.1.3',
                          desc = 'OpenAF Demo tokenizers Use Case Environment')
  3. Verify the new environment has been created.
    list_user_envs()

    Out:

    User environment 'tokenizers_r_env' created.
  4. Use the user environment handler to manage it and install the libraries needed for the analysis.
    1. View existing libraries in the user environment.
      demo_env.libs
    2. Install required R library, ‘tokenizers’, from the requirement file which will install any dependencies in the user environment.
      The requirement file must be specified in the install_lib() function by means of the file location in your filepath.
      The default value of the asynchronous parameter is False, which means you need to wait until installation is complete to proceed with the next statement. However, by specifying asynchronous=True, teradataml enables you to continue executing statements while installation takes place asynchronously in the background. Avoid using the libraries you request before installation is complete.
      claim_id = demo_env.install_lib(libs_file_path=os.path.join(path_to_reqsfiles, 'reqs_tokenizers_R.txt'), asynchronous=False)
    3. During the asynchronous installation, you can check the status by using the following API.
      demo_env.status(claim_id)
    4. Verify that required R libraries have been installed correctly.
      demo_env.libs()