def __init__(self, expected_returns, cov_matrix, weight_bounds=(<NUM_LIT:0>, <NUM_LIT:1>), gamma=<NUM_LIT:0>):
<EOL>self.cov_matrix = cov_matrix<EOL>if expected_returns is not None:<EOL><INDENT>if not isinstance(expected_returns, (pd.Series, list, np.ndarray)):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if not isinstance(cov_matrix, (pd.DataFrame, np.ndarray)):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>self.expected_returns = expected_returns<EOL><DEDENT>if isinstance(expected_returns, pd.Series):<EOL><INDENT>tickers = list(expected_returns.index)<EOL><DEDENT>elif isinstance(cov_matrix, pd.DataFrame):<EOL><INDENT>tickers = list(cov_matrix.columns)<EOL><DEDENT>else:<EOL><INDENT>tickers = list(range(len(expected_returns)))<EOL><DEDENT>super().__init__(len(tickers), tickers, weight_bounds)<EOL>if not isinstance(gamma, (int, float)):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if gamma < <NUM_LIT:0>:<EOL><INDENT>warnings.warn("<STR_LIT>", UserWarning)<EOL><DEDENT>self.gamma = gamma<EOL>
:param expected_returns: expected returns for each asset. Set to None if
                         optimising for volatility only.
:type expected_returns: pd.Series, list, np.ndarray
:param cov_matrix: covariance of returns for each asset
:type cov_matrix: pd.DataFrame or np.array
:param weight_bounds: minimum and maximum weight of an asset, defaults to (0, 1).
                      Must be changed to (-1, 1) for portfolios with shorting.
:type weight_bounds: tuple, optional
:param gamma: L2 regularisation parameter, defaults to 0. Increase if you want more
              non-negligible weights
:type gamma: float, optional
:raises TypeError: if ``expected_returns`` is not a series, list or array
:raises TypeError: if ``cov_matrix`` is not a dataframe or array