def ncomps(self, ncomps):
        """

        Setter for number of components.

        :param int ncomps: Number of components to use in the model.
        :raise AttributeError: If there is a problem changing the number of components and resetting the model.
        """
        # To ensure changing number of components effectively resets the model
        try:
            self._ncomps = ncomps
            self.pca_algorithm = clone(self.pca_algorithm, safe=True)
            self.pca_algorithm.n_components = ncomps
            self.modelParameters = None
            self.loadings = None
            self.scores = None
            self.cvParameters = None
            return None
        except AttributeError as atre:
            raise atre
def ncomps ( self , ncomps ) : try : self . _ncomps = ncomps self . pca_algorithm = clone ( self . pca_algorithm , safe = True ) self . pca_algorithm . n_components = ncomps self . modelParameters = None self . loadings = None self . scores = None self . cvParameters = None return None except AttributeError as atre : raise atre
Setter for number of components.

        :param int ncomps: Number of components to use in the model.
        :raise AttributeError: If there is a problem changing the number of components and resetting the model.