class_docstr: Implementations for DRL algorithms
  
  Attributes
  ----------
      env: gym environment class
          user-defined class
      price_array: numpy array
          OHLC data
      tech_array: numpy array
          techical data
      turbulence_array: numpy array
          turbulence/risk data
  Methods
  -------
      get_model()
          setup DRL algorithms
      train_model()
          train DRL algorithms in a train dataset
          and output the trained model
      DRL_prediction()
          make a prediction in a test dataset and get results
class_docstr_tok: ["Implementations","for","DRL","algorithms","Attributes","--","--","--","--","--","env",":","gym","environment","class","user-defined","class","price_array",":","numpy","array","OHLC","data","tech_array",":","numpy","array","techical","data","turbulence_array",":","numpy","array","turbulence\/risk","data","Methods","--","--","--","-","get_model","(",")","setup","DRL","algorithms","train_model","(",")","train","DRL","algorithms","in","a","train","dataset","and","output","the","trained","model","DRL_prediction","(",")","make","a","prediction","in","a","test","dataset","and","get","results"]
code: def DRL_prediction(
      model_name,
      env,
      price_array,
      tech_array,
      turbulence_array,
      agent_path="./test_ppo/checkpoint_000100/checkpoint-100",
  ):
      if model_name not in MODELS:
          raise NotImplementedError("NotImplementedError")
  
      if model_name == "a2c":
          model_config = MODELS[model_name].A2C_DEFAULT_CONFIG.copy()
      elif model_name == "td3":
          model_config = MODELS[model_name].TD3_DEFAULT_CONFIG.copy()
      else:
          model_config = MODELS[model_name].DEFAULT_CONFIG.copy()
      model_config["env"] = env
      model_config["log_level"] = "WARN"
      model_config["env_config"] = {
          "price_array": price_array,
          "tech_array": tech_array,
          "turbulence_array": turbulence_array,
          "if_train": False,
      }
      env_config = {
          "price_array": price_array,
          "tech_array": tech_array,
          "turbulence_array": turbulence_array,
          "if_train": False,
      }
      env_instance = env(config=env_config)
  
      # ray.init() # Other Ray APIs will not work until `ray.init()` is called.
      if model_name == "ppo":
          trainer = MODELS[model_name].PPOTrainer(
              env=env, config=model_config
          )
      elif model_name == "a2c":
          trainer = MODELS[model_name].A2CTrainer(
              env=env, config=model_config
          )
      elif model_name == "ddpg":
          trainer = MODELS[model_name].DDPGTrainer(
              env=env, config=model_config
          )
      elif model_name == "td3":
          trainer = MODELS[model_name].TD3Trainer(
              env=env, config=model_config
          )
      elif model_name == "sac":
          trainer = MODELS[model_name].SACTrainer(
              env=env, config=model_config
          )
  
      try:
          trainer.restore(agent_path)
          print("Restoring from checkpoint path", agent_path)
      except BaseException:
          raise ValueError("Fail to load agent!")
  
      # test on the testing env
      state = env_instance.reset()
      episode_returns = []  # the cumulative_return / initial_account
      episode_total_assets = [env_instance.initial_total_asset]
      done = False
      while not done:
          action = trainer.compute_single_action(state)
          state, reward, done, _ = env_instance.step(action)
  
          total_asset = (
              env_instance.amount
              + (
                  env_instance.price_ary[env_instance.day]
                  * env_instance.stocks
              ).sum()
          )
          episode_total_assets.append(total_asset)
          episode_return = (
              total_asset / env_instance.initial_total_asset
          )
          episode_returns.append(episode_return)
      ray.shutdown()
      print("episode return: " + str(episode_return))
      print("Test Finished!")
      return episode_total_assets
  
file_path: FinRL/finrl/agents/rllib/models.py
imports: from __future__ import annotations
  import ray
  from ray.rllib.algorithms.a2c import a2c
  from ray.rllib.algorithms.ddpg import ddpg
  from ray.rllib.algorithms.ppo import ppo
  from ray.rllib.algorithms.sac import sac
  from ray.rllib.algorithms.td3 import td3
label_desc: Use image node_id 4 for calling the DRLAgent obj's underlying member method code with example usage: obj.DRL_prediction(model_name, env, price_array, tech_array, turbulence_array, agent_path) and returns: episode_total_assets