from sklearn.base import TransformerMixin
from sklearn.utils import as_float_array
import numpy as np

class MeanDiscrete(TransformerMixin):
    def fit(self,X):
        X = as_float_array(X)
        self.mean = X.mean(axis=0)#每一列的均值
        return self

    def transform(self,X):
        X = as_float_array(X)
        assert np.shape(X)[1]==self.mean.shape[0]
        return X>self.mean
361eddc4991362b54275369f8b02a4c3a2d7186a
<mask token>


class MeanDiscrete(TransformerMixin):
    <mask token>
    <mask token>

<mask token>


class MeanDiscrete(TransformerMixin):

    def fit(self, X):
        X = as_float_array(X)
        self.mean = X.mean(axis=0)
        return self
    <mask token>

<mask token>


class MeanDiscrete(TransformerMixin):

    def fit(self, X):
        X = as_float_array(X)
        self.mean = X.mean(axis=0)
        return self

    def transform(self, X):
        X = as_float_array(X)
        assert np.shape(X)[1] == self.mean.shape[0]
        return X > self.mean

from sklearn.base import TransformerMixin
from sklearn.utils import as_float_array
import numpy as np


class MeanDiscrete(TransformerMixin):

    def fit(self, X):
        X = as_float_array(X)
        self.mean = X.mean(axis=0)
        return self

    def transform(self, X):
        X = as_float_array(X)
        assert np.shape(X)[1] == self.mean.shape[0]
        return X > self.mean

from sklearn.base import TransformerMixin
from sklearn.utils import as_float_array
import numpy as np

class MeanDiscrete(TransformerMixin):
    def fit(self,X):
        X = as_float_array(X)
        self.mean = X.mean(axis=0)#每一列的均值
        return self

    def transform(self,X):
        X = as_float_array(X)
        assert np.shape(X)[1]==self.mean.shape[0]
        return X>self.mean