class_docstr: Provides implementations for DRL algorithms
  
  Attributes
  ----------
      env: gym environment class
          user-defined class
  
  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: ["Provides","implementations","for","DRL","algorithms","Attributes","--","--","--","--","--","env",":","gym","environment","class","user-defined","class","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"]
docstr: make a prediction and get results
docstr_tok: ["make","a","prediction","and","get","results"]
code: def DRL_prediction(model, environment, deterministic=True):
      """make a prediction and get results"""
      test_env, test_obs = environment.get_sb_env()
      account_memory = None  # This help avoid unnecessary list creation
      actions_memory = None  # optimize memory consumption
      # state_memory=[] #add memory pool to store states
  
      test_env.reset()
      max_steps = len(environment.df.index.unique()) - 1
  
      for i in range(len(environment.df.index.unique())):
          action, _states = model.predict(
              test_obs, deterministic=deterministic
          )
          # account_memory = test_env.env_method(method_name="save_asset_memory")
          # actions_memory = test_env.env_method(method_name="save_action_memory")
          test_obs, rewards, dones, info = test_env.step(action)
  
          if (
              i == max_steps - 1
          ):  # more descriptive condition for early termination to clarify the logic
              account_memory = test_env.env_method(
                  method_name="save_asset_memory"
              )
              actions_memory = test_env.env_method(
                  method_name="save_action_memory"
              )
          # add current state to state memory
          # state_memory=test_env.env_method(method_name="save_state_memory")
  
          if dones[0]:
              print("hit end!")
              break
      return account_memory[0], actions_memory[0]
  
imports: from __future__ import annotations
  import time
  import numpy
  import pandas
  from stable_baselines3 import A2C
  from stable_baselines3 import DDPG
  from stable_baselines3 import PPO
  from stable_baselines3 import SAC
  from stable_baselines3 import TD3
  from stable_baselines3.common.callbacks import BaseCallback
  from stable_baselines3.common.noise import NormalActionNoise
  from stable_baselines3.common.noise import OrnsteinUhlenbeckActionNoise
  from stable_baselines3.common.vec_env import DummyVecEnv
  from finrl import config
  from finrl.meta.env_stock_trading.env_stocktrading import StockTradingEnv
  from finrl.meta.preprocessor.preprocessors import data_split
label_desc: Use image node_id 4 for calling the DRLAgent obj's underlying member method code with example usage: obj.DRL_prediction(model, environment, deterministic) and returns: account_memory,  actions_memory