ml_grid.pipeline.column_names ============================= .. py:module:: ml_grid.pipeline.column_names Functions --------- .. autoapisummary:: ml_grid.pipeline.column_names.filter_substring_list ml_grid.pipeline.column_names.get_pertubation_columns Module Contents --------------- .. py:function:: filter_substring_list(string: List[str], substr: List[str]) -> List[str] Filters a list of strings based on a list of substrings. :param string: The list of strings to filter. :type string: List[str] :param substr: The list of substrings to search for. :type substr: List[str] :returns: A new list containing strings from the input list that contain any of the specified substrings, excluding those containing "bmi". :rtype: List[str] .. py:function:: get_pertubation_columns(all_df_columns: List[str], local_param_dict: Dict[str, Any], drop_term_list: List[str]) -> Tuple[List[str], List[str]] Identifies and categorizes columns for perturbation and dropping. This function processes a list of all DataFrame columns, categorizing them into groups like blood tests, diagnostic orders, etc. It also identifies columns to be dropped based on specific keywords. The selection of columns for 'perturbation' is determined by flags within `local_param_dict`. :param all_df_columns: A list of all column names in the DataFrame. :type all_df_columns: List[str] :param local_param_dict: A dictionary containing local parameters, including 'outcome_var_n' and a 'data' sub-dictionary that specifies which column categories to include for perturbation (e.g., 'age', 'sex', 'bmi', 'bloods'). :type local_param_dict: Dict[str, Any] :param drop_term_list: A list of strings. Any column name containing these strings (case-insensitive) will be added to the `drop_list`. :type drop_term_list: List[str] :returns: A tuple containing two lists: - pertubation_columns: A list of column names selected for perturbation based on the `local_param_dict` settings. - drop_list: A list of column names identified to be dropped from the DataFrame. :rtype: Tuple[List[str], List[str]]