hmm.labeling.utils module

hmm.labeling.utils.choose_barrier(x, reverse=False)[source]

Choose the scenario where the AV hits the barrier. If there is no such scenario, abstain.

Parameters

reverse – If false, choose to hit the barrier. Else choose not to.

hmm.labeling.utils.choose_max(x)[source]

Accept a single argmax only; if there is a tie, abstain.

Parameters

x – an nparray of the values; must be in the order noint, int

hmm.labeling.utils.count_characters(x, suffix, characters)[source]
Parameters
  • suffix – The suffix to use - int or noint

  • characters – a list of characters to sum up

Returns

the number of characters in these groups

hmm.labeling.utils.is_law_abiding(df, suf='')[source]
hmm.labeling.utils.is_law_violating(df, suf='')[source]
hmm.labeling.utils.is_passenger(df, suf='')[source]
hmm.labeling.utils.pictofy(response, raw=False)[source]
hmm.labeling.utils.select_against_homogenous_group(x, group)[source]

Always select against a group if it contains only instances of characters in :group:.

hmm.labeling.utils.spare_group(x, group)[source]

Never choose an alternative that sacrifices a character in :group:.

hmm.labeling.utils.transform_abstract(df)[source]
Parameters

df – dataframe of raw character vectors

Returns

dataframe of abstract moral vectors