def clean_weights(self, cutoff=<NUM_LIT>, rounding=<NUM_LIT:5>):
if not isinstance(rounding, int) or rounding < <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>clean_weights = self.weights.copy()<EOL>clean_weights[np.abs(clean_weights) < cutoff] = <NUM_LIT:0><EOL>if rounding is not None:<EOL><INDENT>clean_weights = np.round(clean_weights, rounding)<EOL><DEDENT>return dict(zip(self.tickers, clean_weights))<EOL>
Helper method to clean the raw weights, setting any weights whose absolute
values are below the cutoff to zero, and rounding the rest.

:param cutoff: the lower bound, defaults to 1e-4
:type cutoff: float, optional
:param rounding: number of decimal places to round the weights, defaults to 5.
                 Set to None if rounding is not desired.
:type rounding: int, optional
:return: asset weights
:rtype: dict