(self, limit=None, partial=False)
Download SQL data and store it in memory as numpy matrices.
Download SQL data and store it in memory as numpy matrices.
Download SQL data and store it in memory as numpy matrices .
def download_data(self, limit=None, partial=False):
        """Download SQL data and store it in memory as numpy matrices."""
        if limit and not partial and self.approx_len() > limit:
            raise ValueError("Too many rows to download the data into memory.")
        X = [np.empty((0, len(self.domain.attributes)))]
        Y = [np.empty((0, len(self.domain.class_vars)))]
        metas = [np.empty((0, len(self.domain.metas)))]
        for row in islice(self, limit):
            X.append(row._x)
            Y.append(row._y)
            metas.append(row._metas)
        self._X = np.vstack(X).astype(np.float64)
        self._Y = np.vstack(Y).astype(np.float64)
        self._metas = np.vstack(metas).astype(object)
        self._W = np.empty((self._X.shape[0], 0))
        self._init_ids(self)
        if not partial or limit and self._X.shape[0] < limit:
            self._cached__len__ = self._X.shape[0]
def download_data ( self , limit = None , partial = False ) : if limit and not partial and self . approx_len ( ) > limit : raise ValueError ( "Too many rows to download the data into memory." ) X = [ np . empty ( ( 0 , len ( self . domain . attributes ) ) ) ] Y = [ np . empty ( ( 0 , len ( self . domain . class_vars ) ) ) ] metas = [ np . empty ( ( 0 , len ( self . domain . metas ) ) ) ] for row in islice ( self , limit ) : X . append ( row . _x ) Y . append ( row . _y ) metas . append ( row . _metas ) self . _X = np . vstack ( X ) . astype ( np . float64 ) self . _Y = np . vstack ( Y ) . astype ( np . float64 ) self . _metas = np . vstack ( metas ) . astype ( object ) self . _W = np . empty ( ( self . _X . shape [ 0 ] , 0 ) ) self . _init_ids ( self ) if not partial or limit and self . _X . shape [ 0 ] < limit : self . _cached__len__ = self . _X . shape [ 0 ]