lale/lib/aif360/datasets.py
def fetch_meps_panel21_fy2016_df(preprocess=False):
    """
    Fetch a subset of the `MEPS`_ dataset from aif360 and add fairness info.

    It contains information collected on a nationally representative sample
    of the civilian noninstitutionalized population of the United States,
    specifically reported medical expenditures and civilian demographics.
    This dataframe corresponds to data from panel 20 from the year 2016.
    Without preprocessing, the dataframe contains 17052 rows and 1936 columns.
    (With preprocessing the dataframe contains 15675 rows and 138 columns.)
    There is one protected attribute, race, and the disparate impact is 0.462
    if preprocessing is not applied and 0.451 if preprocessing is applied.
    The data includes numeric and categorical columns, with some missing values.

    Note: in order to use this dataset, be sure to follow the instructions
    found in the `AIF360 documentation`_ and accept the corresponding license agreement.

    .. _`MEPS`:  https://meps.ahrq.gov/mepsweb/data_stats/download_data_files_detail.jsp?cboPufNumber=HC-181
    .. _`AIF360 documentation`: https://github.com/Trusted-AI/AIF360/tree/master/aif360/data/raw/meps

    Parameters
    ----------
    preprocess : boolean, optional, default False

      If True,
      encode protected attribute in X corresponding to race as 0 or 1
      to indicate privileged groups;
      encode labels in y as 0 or 1 to indicate faborable outcomes;
      rename columns that are panel or round-specific;
      drop columns such as ID columns that are not relevant to the task at hand;
      and drop rows where features are unknown.

    Returns
    -------
    result : tuple

      - item 0: pandas Dataframe

          Features X, including both protected and non-protected attributes.

      - item 1: pandas Series

          Labels y.

      - item 3: fairness_info

          JSON meta-data following the format understood by fairness metrics
          and mitigation operators in `lale.lib.aif360`.
    """
    if preprocess:
        dataset = aif360.datasets.MEPSDataset21()
        return _get_pandas_and_fairness_info_from_meps_dataset(dataset)
    else:
        return _fetch_meps_raw_df(Panel.PANEL21, FiscalYear.FY2016)

    Fetch a subset of the `MEPS`_ dataset from aif360 and add fairness info.

    It contains information collected on a nationally representative sample
    of the civilian noninstitutionalized population of the United States,
    specifically reported medical expenditures and civilian demographics.
    This dataframe corresponds to data from panel 20 from the year 2016.
    Without preprocessing, the dataframe contains 17052 rows and 1936 columns.
    (With preprocessing the dataframe contains 15675 rows and 138 columns.)
    There is one protected attribute, race, and the disparate impact is 0.462
    if preprocessing is not applied and 0.451 if preprocessing is applied.
    The data includes numeric and categorical columns, with some missing values.

    Note: in order to use this dataset, be sure to follow the instructions
    found in the `AIF360 documentation`_ and accept the corresponding license agreement.

    .. _`MEPS`:  https://meps.ahrq.gov/mepsweb/data_stats/download_data_files_detail.jsp?cboPufNumber=HC-181
    .. _`AIF360 documentation`: https://github.com/Trusted-AI/AIF360/tree/master/aif360/data/raw/meps

    Parameters
    ----------
    preprocess : boolean, optional, default False

      If True,
      encode protected attribute in X corresponding to race as 0 or 1
      to indicate privileged groups;
      encode labels in y as 0 or 1 to indicate faborable outcomes;
      rename columns that are panel or round-specific;
      drop columns such as ID columns that are not relevant to the task at hand;
      and drop rows where features are unknown.

    Returns
    -------
    result : tuple

      - item 0: pandas Dataframe

          Features X, including both protected and non-protected attributes.

      - item 1: pandas Series

          Labels y.

      - item 3: fairness_info

          JSON meta-data following the format understood by fairness metrics
          and mitigation operators in `lale.lib.aif360`.
    
Fetch a subset of the `MEPS`_ dataset from aif360 and add fairness info.
It contains information collected on a nationally representative sample
of the civilian noninstitutionalized population of the United States,
specifically reported medical expenditures and civilian demographics.
This dataframe corresponds to data from panel 20 from the year 2016.
Without preprocessing, the dataframe contains 17052 rows and 1936 columns.
(With preprocessing the dataframe contains 15675 rows and 138 columns.)
There is one protected attribute, race, and the disparate impact is 0.462
if preprocessing is not applied and 0.451 if preprocessing is applied.
The data includes numeric and categorical columns, with some missing values.

in order to use this dataset, be sure to follow the instructions
found in the `AIF360 documentation`_ and accept the corresponding license agreement.



Parameters

preprocess : boolean, optional, default False

If True,
encode protected attribute in X corresponding to race as 0 or 1
to indicate privileged groups;
encode labels in y as 0 or 1 to indicate faborable outcomes;
rename columns that are panel or round-specific;
drop columns such as ID columns that are not relevant to the task at hand;
and drop rows where features are unknown.

Returns

result : tuple

item 0: pandas Dataframe

Features X, including both protected and non-protected attributes.

item 1: pandas Series

Labels y.



JSON meta-data following the format understood by fairness metrics
and mitigation operators in `lale.lib.aif360`.
Fetch a subset of the ` MEPS ` _ dataset from aif360 and add fairness info . It contains information collected on a nationally representative sample of the civilian noninstitutionalized population of the United States specifically reported medical expenditures and civilian demographics . This dataframe corresponds to data from panel 20 from the year 2016 . Without preprocessing the dataframe contains 17052 rows and 1936 columns . ( With preprocessing the dataframe contains 15675 rows and 138 columns . ) There is one protected attribute race and the disparate impact is 0 . 462 if preprocessing is not applied and 0 . 451 if preprocessing is applied . The data includes numeric and categorical columns with some missing values . in order to use this dataset be sure to follow the instructions found in the ` AIF360 documentation ` _ and accept the corresponding license agreement . Parameters preprocess : boolean optional default False If True encode protected attribute in X corresponding to race as 0 or 1 to indicate privileged groups ; encode labels in y as 0 or 1 to indicate faborable outcomes ; rename columns that are panel or round - specific ; drop columns such as ID columns that are not relevant to the task at hand ; and drop rows where features are unknown . Returns result : tuple item 0 : pandas Dataframe Features X including both protected and non - protected attributes . item 1 : pandas Series Labels y . JSON meta - data following the format understood by fairness metrics and mitigation operators in ` lale . lib . aif360 ` .
def fetch_meps_panel21_fy2016_df(preprocess=False):
    if preprocess:
        dataset = aif360.datasets.MEPSDataset21()
        return _get_pandas_and_fairness_info_from_meps_dataset(dataset)
    else:
        return _fetch_meps_raw_df(Panel.PANEL21, FiscalYear.FY2016)
def fetch_meps_panel21_fy2016_df ( preprocess = False ) : if preprocess : dataset = aif360 . datasets . MEPSDataset21 ( ) return _get_pandas_and_fairness_info_from_meps_dataset ( dataset ) else : return _fetch_meps_raw_df ( Panel . PANEL21 , FiscalYear . FY2016 )
Fetch a subset of the `MEPS`_ dataset from aif360 and add fairness info.
Fetch a subset of the ` MEPS ` _ dataset from aif360 and add fairness info .
"""
    Fetch a subset of the `MEPS`_ dataset from aif360 and add fairness info.

    It contains information collected on a nationally representative sample
    of the civilian noninstitutionalized population of the United States,
    specifically reported medical expenditures and civilian demographics.
    This dataframe corresponds to data from panel 20 from the year 2016.
    Without preprocessing, the dataframe contains 17052 rows and 1936 columns.
    (With preprocessing the dataframe contains 15675 rows and 138 columns.)
    There is one protected attribute, race, and the disparate impact is 0.462
    if preprocessing is not applied and 0.451 if preprocessing is applied.
    The data includes numeric and categorical columns, with some missing values.

    Note: in order to use this dataset, be sure to follow the instructions
    found in the `AIF360 documentation`_ and accept the corresponding license agreement.

    .. _`MEPS`:  https://meps.ahrq.gov/mepsweb/data_stats/download_data_files_detail.jsp?cboPufNumber=HC-181
    .. _`AIF360 documentation`: https://github.com/Trusted-AI/AIF360/tree/master/aif360/data/raw/meps

    Parameters
    ----------
    preprocess : boolean, optional, default False

      If True,
      encode protected attribute in X corresponding to race as 0 or 1
      to indicate privileged groups;
      encode labels in y as 0 or 1 to indicate faborable outcomes;
      rename columns that are panel or round-specific;
      drop columns such as ID columns that are not relevant to the task at hand;
      and drop rows where features are unknown.

    Returns
    -------
    result : tuple

      - item 0: pandas Dataframe

          Features X, including both protected and non-protected attributes.

      - item 1: pandas Series

          Labels y.

      - item 3: fairness_info

          JSON meta-data following the format understood by fairness metrics
          and mitigation operators in `lale.lib.aif360`.
    """
preprocess