rise_timeseries =============== .. py:module:: rise_timeseries Classes ------- .. autoapisummary:: rise_timeseries.RISETimeseries Module Contents --------------- .. py:class:: RISETimeseries(n_masks: int = 1000, feature_res: int = 8, p_keep: float = 0.5, preprocess_function: Optional[callable] = None, keep_masks: bool = False, keep_masked_data: bool = False, keep_predictions: bool = False) RISE implementation for timeseries adapted from the image version of RISE. .. py:attribute:: n_masks :value: 1000 .. py:attribute:: feature_res :value: 8 .. py:attribute:: p_keep :value: 0.5 .. py:attribute:: preprocess_function :value: None .. py:attribute:: masks :value: None .. py:attribute:: masked :value: None .. py:attribute:: predictions :value: None .. py:attribute:: keep_masks :value: False .. py:attribute:: keep_masked_data :value: False .. py:attribute:: keep_predictions :value: False .. py:method:: explain(model_or_function, input_timeseries, labels, batch_size=100, mask_type='mean') Runs the RISE explainer on images. The model will be called with masked timeseries, with a shape defined by `batch_size` and the shape of `input_data`. :param model_or_function: The function that runs the model to be explained _or_ the path to a ONNX model on disk. :type model_or_function: callable or str :param input_timeseries: Input timeseries data to be explained :type input_timeseries: np.ndarray :param batch_size: Batch size to use for running the model. :type batch_size: int :param labels: Labels to be explained :type labels: Iterable(int) :param mask_type: Masking strategy for masked values. Choose from 'mean' or a callable(input_timeseries) :returns: Explanation heatmap for each class (np.ndarray).