class_docstr: Portfolio Optimizer
  
  The following optimization algorithms are supported:
      - `gmv`: Global Minimum Variance Portfolio
      - `mvo`: Mean Variance Optimized Portfolio
      - `rp`: Risk Parity
      - `inv`: Inverse Volatility
  
  Note:
      This optimizer always assumes full investment and no-shorting.
class_docstr_tok: ["Portfolio","Optimizer","The","following","optimization","algorithms","are","supported",":","-","`","gmv","`",":","Global","Minimum","Variance","Portfolio","-","`","mvo","`",":","Mean","Variance","Optimized","Portfolio","-","`","rp","`",":","Risk","Parity","-","`","inv","`",":","Inverse","Volatility","Note",":","This","optimizer","always","assumes","full","investment","and","no-shorting","."]
docstr: mean-variance optimization objective
  
  Optimization objective
      min_w - w' r + lamb * w' S w
docstr_tok: ["mean-variance","optimization","objective","Optimization","objective","min_w","-","w","'","r","+","lamb","*","w","'","S","w"]
code: def _get_objective_mvo(
      self, S: np.ndarray, r: np.ndarray = None
  ) -> Callable:
      """mean-variance optimization objective
  
      Optimization objective
          min_w - w' r + lamb * w' S w
      """
  
      def func(x):
          risk = x @ S @ x
          ret = x @ r
          return -ret + self.lamb * risk
  
      return func
  
file_path: qlib/qlib/contrib/strategy/optimizer/optimizer.py
imports: import warnings
  import numpy
  import pandas
  import scipy.optimize
  from typing import Optional, Union, Callable, List
  from .base import BaseOptimizer
label_desc: Use image node_id 9 for calling the PortfolioOptimizer obj's underlying member method code with example usage: obj._get_objective_mvo(S, r) and returns: func, unknown