(self, X, y, timestamps=None, asset_names=None, transform=None)
Construct.
Construct.
Construct .
def __init__(self, X, y, timestamps=None, asset_names=None, transform=None):
        """Construct."""
        # checks
        if len(X) != len(y):
            raise ValueError('X and y need to have the same number of samples.')

        if X.shape[1] != y.shape[1]:
            raise ValueError('X and y need to have the same number of input channels.')

        if X.shape[-1] != y.shape[-1]:
            raise ValueError('X and y need to have the same number of assets.')

        self.X = X
        self.y = y
        self.timestamps = list(range(len(X))) if timestamps is None else timestamps
        self.asset_names = ['a_{}'.format(i) for i in range(X.shape[-1])] if asset_names is None else asset_names
        self.transform = transform

        # utility
        self.n_channels, self.lookback, self.n_assets = X.shape[1:]
        self.horizon = y.shape[2]
def __init__ ( self , X , y , timestamps = None , asset_names = None , transform = None ) : # checks if len ( X ) != len ( y ) : raise ValueError ( 'X and y need to have the same number of samples.' ) if X . shape [ 1 ] != y . shape [ 1 ] : raise ValueError ( 'X and y need to have the same number of input channels.' ) if X . shape [ - 1 ] != y . shape [ - 1 ] : raise ValueError ( 'X and y need to have the same number of assets.' ) self . X = X self . y = y self . timestamps = list ( range ( len ( X ) ) ) if timestamps is None else timestamps self . asset_names = [ 'a_{}' . format ( i ) for i in range ( X . shape [ - 1 ] ) ] if asset_names is None else asset_names self . transform = transform # utility self . n_channels , self . lookback , self . n_assets = X . shape [ 1 : ] self . horizon = y . shape [ 2 ]