Basic Element table

Creating Basic element table

For using artml, a basic element table is created first which stores key information for each feature in summarized basic elements. This BET is key for all the successive steps. After generating BET, this table can be used for Data exploration & for Modeling. All the basic elements can be update in real time (incrementally or decrementally), using learn or forget functions. As, BET is updated with the new Data, we can update the model in real time.

create_bet

artml library has functions for building and updating the BET. Use these functions, for the streaming data to update the BET. Use create_bet function to build the BET. The only field you need to input is Dataframe or Data to build the BET. Output created is a Table in a Pandas dataframe format.

  #creating the basic elements table for the dataset.
  from artml import bet
  BET =  bet.create_bet(DataToCreateBet)

BET need to be created only once at the begininng, later on to make any further changes use learn or forget functions.

Update BET

learn

The artml learn updates the basic elements table with any new incoming data. arguments needed for this function are BET (variable assigned for the created BET) and new dataframe. It returns the new updated BET as a dataframe.

  BET_New = bet.learn(BET, NewData)

forget

Similarly like learn function to update BET with the new data, if we want to remove the effect of some data from the BET we can use forget function. arguments needed for this function are BET (variable assigned for the created BET) and the data that needs to be deleted (Input as a dataframe). It returns the new BET as a dataframe.

  BET_updated = bet.forget(BET, Data)

learnbyindex

learnbyindex function is used to update BET at atomic level, we can update any of the feature with the new values. This function takes Basic Element Table and feature_names & values as arguments to update the given list of feature column & rows in the BET by corresponding values.

  BET_updated = bet.learnbyindex(Basic_Element_Table, 'feature_1','feature_2', 1, 2 )
  #Above function updates feature_1, feature_2 in the BET by values 1 and 2 respectively

forgetbyindex

forgetbyindex function deletes the effect of given input values for corresponding given features. This function takes Basic Element Table and feature name & values as arguments to update the given list of features in the BET by corresponding values (deleting effect of those values from BET).

  BET_updated = bet.forgetbyindex(Basic_Element_Table, 'feature_1','feature_2', 1, 2 )
  #Above function reduces feature_1, feature_2 in the BET by values 1 and 2 respectively