Load and return the IDB diagnosis 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
11
12
13
14
15 | from msk_cdm.datasets import connect_to_db
from msk_cdm.datasets.impact import load_diagnosis_idb
# Connect to the database
auth_file = 'path/to/config.txt'
connect_to_db(auth_file=auth_file)
# Load the dataset
df_diagnosis = load_diagnosis_idb()
# Access the data
df = df_diagnosis['data']
# Display the first few rows of the data
print(df.head())
|
Source code in msk_cdm/datasets/phi/idb/datasets_phi_idb.py
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170 | def load_diagnosis_idb() -> Bunch:
"""Load and return the IDB diagnosis 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_diagnosis_idb
# Connect to the database
auth_file = 'path/to/config.txt'
connect_to_db(auth_file=auth_file)
# Load the dataset
df_diagnosis = load_diagnosis_idb()
# Access the data
df = df_diagnosis['data']
# Display the first few rows of the data
print(df.head())
```
"""
df = _loader._load_phi_idb_diagnosis()
data = Bunch(data=df)
return data
|