(self, data, init=False)
return discretizer(data)
Extracts two selected columns from sparse matrix.
        GH-2260
Extracts two selected columns from sparse matrix.
        GH-2260
Extracts two selected columns from sparse matrix . GH - 2260
def sparse_to_dense(self, data, init=False):
        """
        Extracts two selected columns from sparse matrix.
        GH-2260
        """
        def discretizer(data):
            if any(attr.is_continuous for attr in chain(data.domain.variables, data.domain.metas)):
                discretize = Discretize(
                    method=EqualFreq(n=4), remove_const=False,
                    discretize_classes=True, discretize_metas=True)
                return discretize(data).to_dense()
            return data

        if not data.is_sparse() and not init:
            return self.discrete_data
        if data.is_sparse():
            attrs = {self.attr_x,
                     self.attr_y}
            new_domain = data.domain.select_columns(attrs)
            data = Table.from_table(new_domain, data)
        return discretizer(data)
def sparse_to_dense ( self , data , init = False ) : def discretizer ( data ) : if any ( attr . is_continuous for attr in chain ( data . domain . variables , data . domain . metas ) ) : discretize = Discretize ( method = EqualFreq ( n = 4 ) , remove_const = False , discretize_classes = True , discretize_metas = True ) return discretize ( data ) . to_dense ( ) return data if not data . is_sparse ( ) and not init : return self . discrete_data if data . is_sparse ( ) : attrs = { self . attr_x , self . attr_y } new_domain = data . domain . select_columns ( attrs ) data = Table . from_table ( new_domain , data ) return discretizer ( data )