API Reference

ModalityEvents

class monad.targets.ModalityEvents

Contains main entity events data source defined in the pretrain phase.


Properties


ModalityEvents.events

Values of the feature.

def target_fn(history: Events, future: Events, attributes: Attributes, ctx: Dict) -> np.ndarray:
    ...

    # here we get values of the price feature from the datasource transactions
    price_values = future["transactions"]["price"].events

    ...
Returns

numpy.ndarray



ModalityEvents.timestamps

Timestamps of the events.

def target_fn(history: Events, future: Events, attributes: Attributes, ctx: Dict) -> np.ndarray:
    ...

    # here we get values of the price feature from the datasource transactions
    timestamps = future["transactions"]["price"].timestamps

    ...
Returns

numpy.ndarray[numpy.float64]



ModalityEvents.dataset_name

The name of the data source from which the feature is derived.

Returns

str



ModalityEvents.column_name

The name of the column from which the feature is derived.

Returns

str



Methods


ModalityEvents.__getitem__(self, i)

Parameters

i: int | list[int] | slice | numpy.ndarray[numpy.int64] | numpy.ndarray[numpy.bool]
Index or list of indexes of events.

Returns

ModalityEvents with the chosen subset of events.



ModalityEvents.__len__(self)

The number of events.

Returns

int