API reference
High-level estimator
A compact, model-independent entry point.
Parameters use user-facing names while mapping onto the backward-compatible
:class:FSAConfig fields. Advanced users may pass an existing config
instead.
Source code in federated_survival/api.py
20 21 22 23 24 25 26 27 28 29 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 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | |
fit(data, durations=None, events=None, *, duration_col='time', event_col='status', client_col=None, augmentation=None)
Fit from a package DataSet, DataFrame, or NumPy arrays.
A DataFrame may optionally contain an institution column. Otherwise the requested synthetic partition strategy is applied. The feature count is always inferred from the supplied data.
Source code in federated_survival/api.py
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 | |
predict_survival(features)
Return a time-by-sample survival-probability DataFrame.
Source code in federated_survival/api.py
152 153 154 155 156 | |
evaluate(features, durations, events)
Compute time-dependent concordance and IPCW integrated Brier score.
Source code in federated_survival/api.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
get_run_summary()
Return serialisable configuration and final metrics.
Source code in federated_survival/api.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |
get_privacy_info()
Report configured perturbation settings, not an achieved DP budget.
Source code in federated_survival/api.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |
Composable experiment API
Run one Center/Federated/Local comparison with a compact public call.
Source code in federated_survival/experiment_api.py
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 | |
Cross selected models and protocols on paired per-seed partitions.
Pass one DataSet for a single seed or a mapping returned by
partition_data_many for repeated seeds. Within each seed, Center,
Federated, and Local fits use the same partition and test set. Incompatible
cells are rejected before training. This API does not write an audit
manifest; use YAML when a full machine-readable run record is required.
Source code in federated_survival/experiment_api.py
356 357 358 359 360 361 362 363 364 365 366 367 368 369 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 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | |
Paired metrics, round history, and selectable plots from one or more seeds.
Source code in federated_survival/experiment_api.py
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 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | |
plot(kind='final_metrics', *, model=None, protocol=None, chart=None, seed=None, x='feature_1', y='time', output_path=None, show=True)
Plot client partition, final C-index/IBS, or federated round history.
For multi-model/protocol results, select one cell with model and
protocol. Partition plots default to a client-wise strip; set
chart="scatter" for feature axes. Boxplots and violin plots need
at least two paired seeds.
Source code in federated_survival/experiment_api.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
save_figures(output_dir, *, combine=False, final_chart='dotplot', partition_chart='strip', model=None, protocol=None, seed=None, x='feature_1', y='time', image_format='png', overwrite=False)
Save separate plots and optionally a dataset-independent combined figure.
combine=False writes partition, round-metric, and final-metric
figures. combine=True writes those plus one five-panel overview.
Existing target files are preserved unless overwrite=True.
Source code in federated_survival/experiment_api.py
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | |
Interactive data functions
Generate one simulated survival table through the public package API.
censoring is the censoring-distribution control used by Weibull,
log-normal, and SDGM1 simulations; it is not an exact requested censoring
proportion. SDGM2/SDGM3 use u_max and SDGM4 uses c_step.
Source code in federated_survival/data/workflow.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
Load CSV/Excel survival data and return canonical x1..xp/time/status columns.
Source code in federated_survival/data/workflow.py
50 51 52 53 54 55 56 57 58 59 60 61 62 | |
Load a real survival dataset bundled with the installed package.
Bundled tables live inside the package itself
(federated_survival/data/real/), so they are available after a normal
pip install -- no repository clone or manual data download needed.
Use :func:available_real_datasets to list the shipped names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Dataset name, e.g. |
'gbsg'
|
duration_column
|
str
|
Column treated as survival time (kept as |
'time'
|
event_column
|
str
|
Column treated as the event indicator (kept as |
'status'
|
Returns:
| Name | Type | Description |
|---|---|---|
DataFrame
|
pd.DataFrame: Canonical |
|
what |
DataFrame
|
func: |
Source code in federated_survival/data/workflow.py
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 | |
Return the sorted names of real datasets bundled with the package.
Source code in federated_survival/data/workflow.py
70 71 72 73 74 | |
Split data and optionally preprocess features from training statistics only.
Source code in federated_survival/data/workflow.py
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 | |
Create paired client partitions for multiple random seeds.
Source code in federated_survival/data/workflow.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 | |
Draw a feature scatter or a client-wise event/censoring strip plot.
The returned object is a Matplotlib Figure. Set show=False for
scripts, tests, or headless execution and use output_path to save it.
Source code in federated_survival/data/workflow.py
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | |
Return original-plus-synthetic client arrays without altering dataset.
MVAEC augments each client locally. MVAES pools generated samples before
redistributing them; it must not be presented as a no-sharing workflow.
The existing MVAE trainer uses 500 epochs per client. The output is for
exploratory experiments, not a privacy guarantee. By default, synthetic
samples are conditionally drawn near latent codes from the wider half of
each client's uncensored-time distribution. Use
sampling="unconditional" to recover prior-only latent sampling.
Source code in federated_survival/data/augmentation_workflow.py
19 20 21 22 23 24 25 26 27 28 29 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 | |
Compare generated samples from augmentation methods in separate panels.
chart="strip" places clients on the x-axis and time on the y-axis,
distinguishing original events, original censoring, and synthetic events.
chart="scatter" uses feature/time axes and colours for clients.
The held-out test set is never plotted or augmented.
Source code in federated_survival/data/augmentation_workflow.py
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 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | |
Model adapters
Bases: ABC
Contract implemented by every built-in and third-party survival model.
Source code in federated_survival/models/adapters.py
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 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
configure_targets(config, durations, events)
Fit any label transform and update output dimensionality.
Source code in federated_survival/models/adapters.py
167 168 169 170 171 172 173 174 175 176 177 | |
build_model(network, config, label_transform=None, optimizer=None)
abstractmethod
Wrap a Torch network in the corresponding PyCox model.
Source code in federated_survival/models/adapters.py
197 198 199 | |
prepare_for_prediction(model, train_x, train_y, label_transform=None)
Attach training data and estimate a Cox baseline when required.
Source code in federated_survival/models/adapters.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | |
Register a custom adapter under a case-insensitive name.
Source code in federated_survival/models/adapters.py
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | |
Validate probability bounds, finiteness, and monotonicity.
Identical columns are recorded as a degeneracy diagnostic rather than an unconditional error because a legitimately uninformative model may emit the same curve for every sample. The experiment layer can nevertheless fail a run when that behaviour is unexpected.
Source code in federated_survival/models/adapters.py
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 | |
Federated protocols
Bases: ABC
Base class for built-in and third-party federated protocols.
Source code in federated_survival/protocols/base.py
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 | |
begin_run(config, global_state)
Reset protocol state before a new fit.
Source code in federated_survival/protocols/base.py
59 60 61 | |
prepare_client_model(model, global_state)
Optionally modify the local objective before optimizer steps.
Source code in federated_survival/protocols/base.py
63 64 | |
round_communication_bytes(n_clients, model_bytes)
Return the payload-byte estimate for one parameter-exchange round.
Source code in federated_survival/protocols/base.py
76 77 78 | |
Machine-readable compatibility declaration for a protocol.
Source code in federated_survival/protocols/base.py
19 20 21 22 23 24 25 26 27 28 | |
Register a protocol class under a case-insensitive public name.
Source code in federated_survival/protocols/base.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
Bases: FederatedProtocol
Distributed Newton solver for a linear pooled CoxPH objective.
Source code in federated_survival/protocols/webdisco.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 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | |
distributed_objective(client_sets, beta, event_times=None)
Return pooled Breslow log likelihood, score, information and bytes.
Source code in federated_survival/protocols/webdisco.py
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 | |
Backward-compatible core
Configuration class for federated survival analysis.
Source code in federated_survival/core/config.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 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 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | |
__post_init__()
Validate configuration parameters.
Source code in federated_survival/core/config.py
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 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
Runner for federated survival analysis.
Source code in federated_survival/core/runner.py
27 28 29 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 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 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 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 | |
__init__(config)
Initialize the federated survival analysis runner.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
FSAConfig
|
Federated learning configuration. |
required |
Source code in federated_survival/core/runner.py
30 31 32 33 34 35 36 37 38 39 40 41 | |
set_random_seed()
Set the random seed.
Source code in federated_survival/core/runner.py
43 44 45 46 47 48 49 50 | |
run(data, type='raw', aug_method='MVAEC')
Run federated survival analysis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Any
|
Survival data with the following attributes: - clients_set: Client datasets in the form {client_id: (train_X, train_y)} - raw_aug_clients_set: Client datasets augmented from raw data, in the form {client_id: (train_X, train_y)} - test_data: Test data - test_label: Test labels |
required |
type
|
str
|
Data type, 'raw' or 'raw_aug' |
'raw'
|
aug_method
|
str
|
Data augmentation method, 'MVAEC' or 'MVAES' |
'MVAEC'
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Dict[str, List[float]]
|
{'train_Cindex': train_Cindex, 'train_IBS': train_IBS, 'test_Cindex': test_Cindex, 'test_IBS': test_IBS} |
Source code in federated_survival/core/runner.py
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 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | |
predict_survival(features)
Predict survival curves after :meth:run has fitted a model.
Source code in federated_survival/core/runner.py
432 433 434 435 436 437 438 439 440 441 442 | |
get_privacy_info()
Get differential privacy protection information.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Dict[str, Any]
|
Privacy protection related information. |
Source code in federated_survival/core/runner.py
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 | |
plot_results(results, output_path=None, show=True)
Plot training results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
results
|
Dict[str, List[float]]
|
Training results in the form: { 'train_Cindex': List[float], # Training set C-index 'train_IBS': List[float], # Training set IBS 'test_Cindex': List[float], # Test set C-index 'test_IBS': List[float] # Test set IBS } |
required |
output_path
|
Optional[Union[str, Path]]
|
Optional path to save the figure. |
None
|
show
|
bool
|
Whether to open an interactive window; set to False for automated tests. |
True
|
Returns:
| Type | Description |
|---|---|
Figure
|
matplotlib.figure.Figure: The generated figure object. |
Source code in federated_survival/core/runner.py
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 | |