idq.features

features.py supports the class representation of idq.features.FeatureVector and idq.features.Quiver, which are thin wrappers around numpy structured arrays.

class idq.features.ColumnTransformer(transforms, default)[source]

manages transformations of columns on an individual feature/FeatureVector basis useful when the same transformation is applied to the same column from many channels

class idq.features.DataChunk(features: Dict, columns: Tuple, start: int, end: int, segs: Optional[ligo.segments.__segments.segmentlist] = None, skip_filter: bool = True)[source]
filter(channels=None, columns=None, segs=None, time='time', bounds=None)[source]

update segments and filters out data that don’t span segments NOTE: this requires knowledge of the “time” key within data

flush(max_stride=inf, time='time')[source]

remove data to a target span and number of samples

random_times(time, target_channel, dirty_bounds, dirty_window, random_rate, segs=None)[source]

A convenience function to extract random times.

target_times(time, target_channel, target_bounds, segs=None)[source]

A convenience function to extract target times.

class idq.features.DataTable(data=None, masked=False, names=None, dtype=None, meta=None, copy=True, rows=None, copy_indices=True, units=None, descriptions=None, **kwargs)[source]
Row

alias of FeatureVector

class idq.features.DeltaTimeTransformer(time='time', default=-inf, default_delta_time=inf, **kwargs)[source]

extends column map specifically to transform raw timestamps to relative timestamps

class idq.features.Downselect(default=-inf, **kwargs)[source]

an object that downselects a list of triggers to a prefered one, otherwise returning a default value

class idq.features.DownselectLoudest(default=-inf, **kwargs)[source]

take the loudest thing within some time window if there is no trigger within the window, return None

class idq.features.DownselectPointy(default=-inf, **kwargs)[source]

take the thing with the smallest pointy-poisson p-value

class idq.features.FeatureVector(table, index)[source]

A feature vector representing a single row in a Dataset.

class idq.features.Selector(channels: Tuple, time: str = 'time', downselector: Optional[idq.features.Downselect] = None, transformer: Optional[idq.features.ColumnTransformer] = None, bounds: dict = <factory>)[source]
class idq.features.Whitener[source]

an object that manages whitening tables from quiver.vectorize remembers the xformations and serves as a utility for classifiers to map back and forth

color(data, names)[source]

the inverse of whiten assumes data.shape = (Nsamples, Nfeatures)

modifies data in place, but also returns a reference

train(data, names)[source]

assumes data.shape = (Nsamples, Nfeatures)

whiten(data, names)[source]

map colored data into whitened data with xformation stored in this object assumes data.shape = (Nsamples, Nfeatures)

modifies data in place, but also returns a reference

idq.features.combine_chunks(datachunks)[source]

combine chunks into a single DataChunk