neurobcl.trainers package#

Submodules#

neurobcl.trainers.dictionary_trainer module#

class neurobcl.trainers.dictionary_trainer.DictionaryBucketTrainer(dict_data, keyword_feats_name, bucket_feats_name, quantile_gap=10, max_depth=2)[source]#

Bases: NeuroBucketTrainer

Train using dictionary/json data, the format of the data should be a list of dictionaries where each dictionary represents a single item and the keys of the dictionary represent the features of the item. (Should be uniform)

get_at(target_feature, rank, filters={})[source]#

Get the value of the target_feature at the given rank, Use cache precomputations at sorting

Parameters:
  • target_feature (str) – The feature to get the value from

  • rank (int) – The rank of the value to get

  • filters (dict) – The filters to apply to the data

Returns:

The value of the target_feature at the given rank

Return type:

int

get_bucket_features()[source]#

Get the bucket features of the data

get_non_bucket_features()[source]#

Get the non-bucket features of the data

total_items(filters={})[source]#

Get the total items for the given filters

Parameters:

filters (dict) – The filters to be applied

Returns:

The total items for the given filters

Return type:

int

Module contents#