artifician package

Subpackages

artifician.dataset module

class artifician.dataset.Dataset

Bases: object

Dataset contains all the functionality for preparing artifician data

Dataset has events which are observed by observers (for eg: FeatureDefiniton, Processor) All the processed artifician data is stored in datastore which is an object of Pandas dataframe

Attributes:

cached (dictionary): {event: rx.core.observable.observable.Observable} datastore (pandas.core.frame.DataFrame): all the samples are stored in datastore PREPARE_DATASET (function): event POST_PROCESS (function): event

add_samples(samples)

add samples to the datastore.

Args:

samples (any): artifician data

Return:

datastore (pandas.core.frame.DataFrame): dataset

observe(event)
build and return observable for given event. This method is

called by the observer who wants to listen to the particular event.

Args:

event (function): function to create observable from

Returns:

observable (rx.core.observable.observable.Observable): Observable

post_process()

This event should be called after artifician data is prepared. All the actions that needs to performed collectively on the whole dataset should listen to post_process event.

artifician.feature_definition module

class artifician.feature_definition.FeatureDefinition(extractor=<function FeatureDefinition.<lambda>>, *extractor_parameters)

Bases: object

Contains all the functionality for preparing single feature

Attributes:

value (any): value of the feature cached (dictionary): {event: rx.core.observable.observable.Observable} extractor (function): extract feature value from the artifician EVENT_PROCESSED (function): event that processes the feature MAP_VALUES (function): event that maps values of feature extractor_parameters (*args): parameters for extractor function

map(feature_value)

Map the feature value from into int or list of int

Args:

feature_value (any): feature value that needs to be mapped

Return:

None

observe(event)

build and return observable for given event

Args:

event (function): function to create observable from

Return:

observable (rx.core.observable.observable.Observable): Observable

process(publisher, sample)

process the sample to build feature value process should contain all the logic for completely processing the feature value

Args:

sample (any): sample data publisher (object): instance of publisher

Return:

feature_processed (list): processed feature_raw

subscribe(publisher, pool_scheduler=None)

Defines logic for subscribing to an event in publisher

Args:

publisher (object): publisher instance pool_scheduler (rx.scheduler.ThreadPoolScheduler): scheduler instance for concurrency

Return:

None