class_docstr: A reward scheme that rewards the agent for increasing its net worth,
  while penalizing more volatile strategies.
  
  Parameters
  ----------
  return_algorithm : {'sharpe', 'sortino'}, Default 'sharpe'.
      The risk-adjusted return metric to use.
  risk_free_rate : float, Default 0.
      The risk free rate of returns to use for calculating metrics.
  target_returns : float, Default 0
      The target returns per period for use in calculating the sortino ratio.
  window_size : int
      The size of the look back window for computing the reward.
class_docstr_tok: ["A","reward","scheme","that","rewards","the","agent","for","increasing","its","net","worth",",","while","penalizing","more","volatile","strategies",".","Parameters","--","--","--","--","--","return_algorithm",":","{","'sharpe","'",",","'sortino","'","}",",","Default","'sharpe","'",".","The","risk-adjusted","return","metric","to","use",".","risk_free_rate",":","float",",","Default","0",".","The","risk","free","rate","of","returns","to","use","for","calculating","metrics",".","target_returns",":","float",",","Default","0","The","target","returns","per","period","for","use","in","calculating","the","sortino","ratio",".","window_size",":","int","The","size","of","the","look","back","window","for","computing","the","reward","."]
docstr: Computes the reward corresponding to the selected risk-adjusted return metric.
  
  Parameters
  ----------
  portfolio : `Portfolio`
      The current portfolio being used by the environment.
  
  Returns
  -------
  float
      The reward corresponding to the selected risk-adjusted return metric.
docstr_tok: ["Computes","the","reward","corresponding","to","the","selected","risk-adjusted","return","metric",".","Parameters","--","--","--","--","--","portfolio",":","`","Portfolio","`","The","current","portfolio","being","used","by","the","environment",".","Returns","--","--","--","-","float","The","reward","corresponding","to","the","selected","risk-adjusted","return","metric","."]
code: def get_reward(self, portfolio: "Portfolio") -> float:
      """Computes the reward corresponding to the selected risk-adjusted return metric.
  
      Parameters
      ----------
      portfolio : `Portfolio`
          The current portfolio being used by the environment.
  
      Returns
      -------
      float
          The reward corresponding to the selected risk-adjusted return metric.
      """
      net_worths = [
          nw["net_worth"] for nw in portfolio.performance.values()
      ][-(self._window_size + 1) :]
      returns = pd.Series(net_worths).pct_change().dropna()
      risk_adjusted_return = self._return_algorithm(returns)
      return risk_adjusted_return
  
imports: from abc import abstractmethod
  import numpy
  import pandas
  from tensortrade.env.generic import RewardScheme, TradingEnv
  from tensortrade.feed.core import Stream, DataFeed
  import math
label_desc: Use image node_id 4 for calling the RiskAdjustedReturns obj's underlying member method code with example usage: obj.get_reward(portfolio) and returns: risk_adjusted_return