def do_cspvarica(self, varfit='ensemble', random_state=None):
        """ Perform CSPVARICA

        Perform CSPVARICA source decomposition and VAR model fitting.

        Parameters
        ----------
        varfit : string
            Determines how to calculate the residuals for source decomposition.
            'ensemble' (default) fits one model to the whole data set,
            'class' fits a different model for each class, and
            'trial' fits a different model for each individual trial.

        Returns
        -------
        self : Workspace
            The Workspace object.

        Raises
        ------
        RuntimeError
            If the :class:`Workspace` instance does not contain data.

        See Also
        --------
        :func:`cspvarica` : CSPVARICA implementation
        """
        if self.data_ is None:
            raise RuntimeError("CSPVARICA requires data to be set")
        try:
            sorted(self.cl_)
            for c in self.cl_:
                assert(c is not None)
        except (TypeError, __HOLE__):
            raise RuntimeError("CSPVARICA requires orderable and hashable class labels that are not None")
        result = cspvarica(x=self.data_, var=self.var_, cl=self.cl_,
                           reducedim=self.reducedim_, backend=self.backend_,
                           varfit=varfit, random_state=random_state)
        self.mixing_ = result.mixing
        self.unmixing_ = result.unmixing
        self.var_ = result.b
        self.connectivity_ = Connectivity(self.var_.coef, self.var_.rescov, self.nfft_)
        self.activations_ = dot_special(self.unmixing_.T, self.data_)
        self.mixmaps_ = []
        self.unmixmaps_ = []
        return self
dataset/ETHPy150Open scot-dev/scot/scot/ooapi.py/Workspace.do_cspvarica