Skip to content

load_data_timeline_cancer_presence_phi

Load and return the cancer presence timeline dataset (PHI).

Returns:

Name Type Description
data Bunch

Dictionary-like object, with the following attributes.

  • data : pandas DataFrame The data matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from msk_cdm.datasets import connect_to_db
from msk_cdm.datasets.impact import load_data_timeline_cancer_presence_phi

auth_file = 'path/to/config.txt'
connect_to_db(auth_file=auth_file)

df_timeline_cancer_presence = load_data_timeline_cancer_presence_phi()
df = df_timeline_cancer_presence['data']

print(df.head())
Source code in msk_cdm/datasets/phi/impact/datasets_phi_impact.py
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
def load_data_timeline_cancer_presence_phi() -> Bunch:
    """Load and return the cancer presence timeline dataset (PHI).

    Returns:
        data: Dictionary-like object, with the following attributes.

            - **data** : pandas DataFrame
                The data matrix.

    Examples
    --------
    ```python
    from msk_cdm.datasets import connect_to_db
    from msk_cdm.datasets.impact import load_data_timeline_cancer_presence_phi

    auth_file = 'path/to/config.txt'
    connect_to_db(auth_file=auth_file)

    df_timeline_cancer_presence = load_data_timeline_cancer_presence_phi()
    df = df_timeline_cancer_presence['data']

    print(df.head())
    ```
    """
    df = _loader._load_phi_impact_data_timeline_cancer_presence()
    data = Bunch(data=df)
    return data