def fit(self, X):
        """
        Fit the scaler based on some data.

        Takes the columnwise mean and standard deviation of the entire input
        array.
        If the array has more than 2 dimensions, it is flattened.

        Parameters
        ----------
        X : numpy array

        Returns
        -------
        scaled : numpy array
            A scaled version of said array.

        """
        if X.ndim > 2:
            X = X.reshape((np.prod(X.shape[:-1]), X.shape[-1]))
        self.mean = X.mean(0)
        self.std = X.std(0)
        self.is_fit = True
        return self