kdigo
This module contains the analysis class for processing AKI stages from time series data.
Analyser
Class for data analysis using probes and preprocessors.
This class provides functionality for analyzing data using a collection of probes and preprocessors. It processes the input data through the specified preprocessors and applies the probes to perform the analysis. The analysis results are returned as a DataFrame.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
list[Dataset]
|
A list of Dataset objects containing the input data. |
required |
probes
|
list[Probe]
|
A list of Probe objects representing the analysis probes to apply. If not provided, default probes including UrineOutputProbe, AbsoluteCreatinineProbe, and RelativeCreatinineProbe will be used. |
None
|
preprocessors
|
list[Preprocessor]
|
A list of Preprocessor objects representing the preprocessors to apply on the input data. If not provided, default preprocessors including UrineOutputPreProcessor, CreatininePreProcessor, and DemographicsPreProcessor will be used. |
None
|
stay_identifier
|
str
|
The column name in the input data representing the stay identifier. |
"stay_id"
|
time_identifier
|
str
|
The column name in the input data representing the time identifier. |
"charttime"
|
Examples:
Instantiate the Analyser class with custom data, probes, and preprocessors
1 |
|
Process stays and obtain the analysis results
1 |
|
Source code in pyaki/kdigo.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 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 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
|
process_stay(stay_id)
Process a specific stay in the input data by patient identificator.
This method processes a specific stay in the input data by applying the configured probes and preprocessors. The analysis results for the stay are returned as a DataFrame.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stay_id
|
str
|
The identifier of the stay to process. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
The analysis results for the specific stay. |
Source code in pyaki/kdigo.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
|
process_stays()
Process all stays in the input data.
This method processes all stays in the input data by applying the configured probes. The analysis results for all stays are concatenated and returned as a single DataFrame.
Returns:
Type | Description |
---|---|
DataFrame
|
The analysis results for all stays. |
Source code in pyaki/kdigo.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
validate_data(datasets)
validate the input data for negative values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
datasets
|
list[Dataset]
|
A list of Dataset objects containing the input data. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If any of the datasets contain negative values. |
Source code in pyaki/kdigo.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|