ofs_aif.scenario package

Submodules

ofs_aif.scenario.human_trafficking module

class HumanTrafficking(fic_mis_date=None, lookback=None, batch_run_id=None, bus_dmn_list=None, jrsdcn_cd=None, objective_id=None, threshold_set_id=None)

Bases: ofs_aif.scenario.scenario.Scenario

class HumanTrafficking implements APIs for Human Trafficking features

get_data_HT()

API creates necessary base data for human trafficking scenario

Returns

List dataframes returns from this API.
  • df_master : a master dataframe contains aggregated information for focus

  • trxn_df_mstr : a transaction dataframe which contains row transaction involved.

Examples:
>>> df_master, trxn_df_mstr  = shell.get_data_HT()
human_trf_transaction_volume()

API creates datasets for human trafficking red flag for Multiple small cash deposits and withdrawals in different locations.

Returns

List of features for customers. Following are the details.
  • Customer ID

  • Credit_Debit_Amount_Ratio

  • No_different_states_perc

  • Credit_Debit_Count_Ratio

  • Perc_days_reporting_avoided

  • Total Credit Amount

  • Perc_Activity_Between Time Limits

Examples:
>>> feature = htObj.human_trf_transaction_volume()

ofs_aif.scenario.scenario module

class Scenario(fic_mis_date=None)

Bases: ofs_aif.aif.aif

class Scenario implements APIs for all common utility across all scenarios

add_to_scenario_dataset(pandas_df_list, key_var='ENTITY_ID', overwrite=True)
Description:

Customized merge used for concatenation multiple dataframes for AIF use case.

Parameters
  • pandas_df_list – list of dataframes to merge

  • key_var – Identity column. Default “ENTITY_ID”

  • overwrite – Boolean True/False. Overwrite existing column’s data if True.

Returns

resulted dataframe

alert_details(batch_run_id=None)

Description: Returns description of newly created events

Parameters

batch_run_id – Run ID of current batch

Returns

resulted dataframe

generate_break(df=None, trxn_df=None, conditions=None)

API creates break based on threshold parameter.

Returns

Insert data into all break related staging tables. On successful return “Break generated Successfully…!”

Examples:
>>> shell.generate_break(df, filter)
    df              : data frame containing base data.
    filter          : Filter criteria on data frame.
get_data(scenario=None)
Description:

API consolidate all red flags togather and return one master data-frame. Internally it calls two separate API for shell and HT for shell and humantrafficking scenario respectively.

return:

Consolidated data-frame for focus and transaction

Examples:
>>> df_mstr, trxn_df_mstr = shell.get_data(self, scenario=None)
run_ecm_batch()

ofs_aif.scenario.shell_scenario module

class ShellScenario(fic_mis_date=None, lookback=None, bus_dmn_list=None, jrsdcn_cd=None, batch_run_id=None, objectiveid=None, threshold_set_id=None)

Bases: ofs_aif.scenario.scenario.Scenario

class ShellScenario implements APIs for Shell Account features

cbk_exceed_anticipatory_profile_credit()

API creates datasets for Shell Account red flag credit transaction. Following are small description. for A foreign correspondent bank exceeds the anticipated volume projected in its client profile for wire transfers in a given time period.

Returns

List of features for customers. Following are the details.
  • Customer ID

  • Is_anticipated_profile_exceeded_credit

  • Perc_Credit_Amount_CBK_exceeded

  • Perc_Credit_Amount_CBK_total

  • is_seasoned

Examples:
>>> df_cr = shell.cbk_exceed_anticipatory_profile_credit()
cbk_exceed_anticipatory_profile_debit()

API creates datasets for Shell Account red flag debit transaction. Following are small description. for A foreign correspondent bank exceeds the anticipated volume projected in its client profile for wire transfers in a given time period.

Returns

List of features for customers. Following are the details.
  • Customer ID

  • Is_aniticipated_profile_exceeded_debit

  • Perc_Debit_Amount_CBK_exceeded

  • Perc_Debit_Amount_CBK_total

  • is_seasoned

Examples:
>>> df_cr = shell.cbk_exceed_anticipatory_profile_debit()
cbk_high_risk_geography_beneficiary()

API creates datasets for Shell Account red flag debit/credit transaction. Following are small feature description. Frequent involvement of beneficiaries located in high-risk, offshore financial centers.

Returns

List of features for customers. Following are the details.
  • Customer ID

  • Percentage of high risk credit amount

  • Percentage of high risk debit amount

  • Percentage of high risk credit count

  • Percentage of high risk debit count

Examples:
>>> df_hrg = shell.cbk_high_risk_geography_beneficiary()
get_data_shell()

API creates necessary base data for shell scenario

Returns

List dataframes returns from this API.
  • df_master : a master dataframe contains aggregated information for focus

  • trxn_df_mstr : a transaction dataframe which contains row transaction involved.

Examples:
>>> df_master, trxn_df_mstr  = shell.get_data_shell()

Module contents