(self, attributes, x, n_vals)
return EuclideanColumnsModel(
            attributes, self.impute, self.normalize, means, stdvars,
            self.callback)
Return `EuclideanColumnsModel` with stored means and variances
        for normalization and imputation.
Return `EuclideanColumnsModel` with stored means and variances
        for normalization and imputation.
Return EuclideanColumnsModel with stored means and variances for normalization and imputation .
def fit_cols(self, attributes, x, n_vals):
        """
        Return `EuclideanColumnsModel` with stored means and variances
        for normalization and imputation.
        """
        def nowarn(msg, cat, *args, **kwargs):
            if cat is RuntimeWarning and msg in (
                    "Mean of empty slice", "Degrees of freedom <= 0 for slice"):
                if self.normalize:
                    raise ValueError("some columns have no defined values")
            else:
                orig_warn(msg, cat, *args, **kwargs)

        self.check_no_discrete(n_vals)
        # catch_warnings resets the registry for "once", while avoiding this
        # warning would be annoying and slow, hence patching
        orig_warn = warnings.warn
        with patch("warnings.warn", new=nowarn):
            means = np.nanmean(x, axis=0)
            stdvars = np.nanvar(x, axis=0)
        if self.normalize and not stdvars.all():
            raise ValueError("some columns are constant")
        return EuclideanColumnsModel(
            attributes, self.impute, self.normalize, means, stdvars,
            self.callback)
def fit_cols ( self , attributes , x , n_vals ) : def nowarn ( msg , cat , * args , * * kwargs ) : if cat is RuntimeWarning and msg in ( "Mean of empty slice" , "Degrees of freedom <= 0 for slice" ) : if self . normalize : raise ValueError ( "some columns have no defined values" ) else : orig_warn ( msg , cat , * args , * * kwargs ) self . check_no_discrete ( n_vals ) # catch_warnings resets the registry for "once", while avoiding this # warning would be annoying and slow, hence patching orig_warn = warnings . warn with patch ( "warnings.warn" , new = nowarn ) : means = np . nanmean ( x , axis = 0 ) stdvars = np . nanvar ( x , axis = 0 ) if self . normalize and not stdvars . all ( ) : raise ValueError ( "some columns are constant" ) return EuclideanColumnsModel ( attributes , self . impute , self . normalize , means , stdvars , self . callback )