survival 1.1.5__cp314-cp314-macosx_10_12_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of survival might be problematic. Click here for more details.

survival/py.typed ADDED
File without changes
Binary file
@@ -0,0 +1,610 @@
1
+ Metadata-Version: 2.4
2
+ Name: survival
3
+ Version: 1.1.5
4
+ Classifier: Development Status :: 5 - Production/Stable
5
+ Classifier: Intended Audience :: Science/Research
6
+ Classifier: Intended Audience :: Healthcare Industry
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: POSIX :: Linux
9
+ Classifier: Operating System :: MacOS
10
+ Classifier: Operating System :: Microsoft :: Windows
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Rust
13
+ Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
14
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
15
+ Classifier: Typing :: Typed
16
+ Requires-Dist: pre-commit==4.5.1 ; extra == 'dev'
17
+ Requires-Dist: pytest==9.0.2 ; extra == 'dev'
18
+ Requires-Dist: numpy==2.4.0 ; extra == 'dev'
19
+ Requires-Dist: pytest==9.0.2 ; extra == 'test'
20
+ Requires-Dist: numpy==2.4.0 ; extra == 'test'
21
+ Requires-Dist: pandas==2.3.3 ; extra == 'test'
22
+ Requires-Dist: polars==1.36.1 ; extra == 'test'
23
+ Provides-Extra: dev
24
+ Provides-Extra: test
25
+ License-File: LICENSE
26
+ Summary: A high-performance survival analysis library written in Rust with Python bindings
27
+ Keywords: survival-analysis,kaplan-meier,cox-regression,statistics,biostatistics,rust
28
+ Author-email: Cameron Lyons <cameron.lyons2@gmail.com>
29
+ Maintainer-email: Cameron Lyons <cameron.lyons2@gmail.com>
30
+ License: MIT
31
+ Requires-Python: >=3.9
32
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
33
+ Project-URL: Repository, https://github.com/Cameron-Lyons/survival
34
+ Project-URL: Documentation, https://github.com/Cameron-Lyons/survival#readme
35
+ Project-URL: Issues, https://github.com/Cameron-Lyons/survival/issues
36
+
37
+ # survival
38
+
39
+ [![Crates.io](https://img.shields.io/crates/v/survival.svg)](https://crates.io/crates/survival)
40
+ [![PyPI version](https://img.shields.io/pypi/v/survival.svg)](https://pypi.org/project/survival/)
41
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
42
+
43
+ A high-performance survival analysis library written in Rust, with a Python API powered by [PyO3](https://github.com/PyO3/pyo3) and [maturin](https://github.com/PyO3/maturin).
44
+
45
+ ## Features
46
+
47
+ - Core survival analysis routines
48
+ - Cox proportional hazards models with frailty
49
+ - Kaplan-Meier and Aalen-Johansen (multi-state) survival curves
50
+ - Nelson-Aalen estimator
51
+ - Parametric accelerated failure time models
52
+ - Fine-Gray competing risks model
53
+ - Penalized splines (P-splines) for smooth covariate effects
54
+ - Concordance index calculations
55
+ - Person-years calculations
56
+ - Score calculations for survival models
57
+ - Residual analysis (martingale, Schoenfeld, score residuals)
58
+ - Bootstrap confidence intervals
59
+ - Cross-validation for model assessment
60
+ - Statistical tests (log-rank, likelihood ratio, Wald, score, proportional hazards)
61
+ - Sample size and power calculations
62
+ - RMST (Restricted Mean Survival Time) analysis
63
+ - Landmark analysis
64
+ - Calibration and risk stratification
65
+ - Time-dependent AUC
66
+ - Conditional logistic regression
67
+ - Time-splitting utilities
68
+
69
+ ## Installation
70
+
71
+ ### From PyPI (Recommended)
72
+
73
+ ```sh
74
+ pip install survival
75
+ ```
76
+
77
+ ### From Source
78
+
79
+ #### Prerequisites
80
+
81
+ - Python 3.9+
82
+ - Rust (see [rustup.rs](https://rustup.rs/))
83
+ - [maturin](https://github.com/PyO3/maturin)
84
+
85
+ Install maturin:
86
+ ```sh
87
+ pip install maturin
88
+ ```
89
+
90
+ #### Build and Install
91
+
92
+ Build the Python wheel:
93
+ ```sh
94
+ maturin build --release
95
+ ```
96
+
97
+ Install the wheel:
98
+ ```sh
99
+ pip install target/wheels/survival-*.whl
100
+ ```
101
+
102
+ For development:
103
+ ```sh
104
+ maturin develop
105
+ ```
106
+
107
+ ## Usage
108
+
109
+ ### Aalen's Additive Regression Model
110
+
111
+ ```python
112
+ from survival import AaregOptions, aareg
113
+
114
+ data = [
115
+ [1.0, 0.0, 0.5],
116
+ [2.0, 1.0, 1.5],
117
+ [3.0, 0.0, 2.5],
118
+ ]
119
+ variable_names = ["time", "event", "covariate1"]
120
+
121
+ # Create options with required parameters (formula, data, variable_names)
122
+ options = AaregOptions(
123
+ formula="time + event ~ covariate1",
124
+ data=data,
125
+ variable_names=variable_names,
126
+ )
127
+
128
+ # Optional: modify default values via setters
129
+ # options.weights = [1.0, 1.0, 1.0]
130
+ # options.qrtol = 1e-8
131
+ # options.dfbeta = True
132
+
133
+ result = aareg(options)
134
+ print(result)
135
+ ```
136
+
137
+ ### Penalized Splines (P-splines)
138
+
139
+ ```python
140
+ from survival import PSpline
141
+
142
+ x = [0.1 * i for i in range(100)]
143
+ pspline = PSpline(
144
+ x=x,
145
+ df=10,
146
+ theta=1.0,
147
+ eps=1e-6,
148
+ method="GCV",
149
+ boundary_knots=(0.0, 10.0),
150
+ intercept=True,
151
+ penalty=True,
152
+ )
153
+ pspline.fit()
154
+ ```
155
+
156
+ ### Concordance Index
157
+
158
+ ```python
159
+ from survival import perform_concordance1_calculation
160
+
161
+ time_data = [1.0, 2.0, 3.0, 4.0, 5.0, 1.0, 2.0, 3.0, 4.0, 5.0]
162
+ weights = [1.0, 1.0, 1.0, 1.0, 1.0]
163
+ indices = [0, 1, 2, 3, 4]
164
+ ntree = 5
165
+
166
+ result = perform_concordance1_calculation(time_data, weights, indices, ntree)
167
+ print(f"Concordance index: {result['concordance_index']}")
168
+ ```
169
+
170
+ ### Cox Regression with Frailty
171
+
172
+ ```python
173
+ from survival import perform_cox_regression_frailty
174
+
175
+ result = perform_cox_regression_frailty(
176
+ time_data=[...],
177
+ status_data=[...],
178
+ covariates=[...],
179
+ # ... other parameters
180
+ )
181
+ ```
182
+
183
+ ### Person-Years Calculation
184
+
185
+ ```python
186
+ from survival import perform_pyears_calculation
187
+
188
+ result = perform_pyears_calculation(
189
+ time_data=[...],
190
+ weights=[...],
191
+ # ... other parameters
192
+ )
193
+ ```
194
+
195
+ ### Kaplan-Meier Survival Curves
196
+
197
+ ```python
198
+ from survival import survfitkm, SurvFitKMOutput
199
+
200
+ # Example survival data
201
+ time = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]
202
+ status = [1.0, 1.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0] # 1 = event, 0 = censored
203
+ weights = [1.0] * len(time) # Optional: equal weights
204
+
205
+ result = survfitkm(
206
+ time=time,
207
+ status=status,
208
+ weights=weights,
209
+ entry_times=None, # Optional: entry times for left-truncation
210
+ position=None, # Optional: position flags
211
+ reverse=False, # Optional: reverse time order
212
+ computation_type=0 # Optional: computation type
213
+ )
214
+
215
+ print(f"Time points: {result.time}")
216
+ print(f"Survival estimates: {result.estimate}")
217
+ print(f"Standard errors: {result.std_err}")
218
+ print(f"Number at risk: {result.n_risk}")
219
+ ```
220
+
221
+ ### Fine-Gray Competing Risks Model
222
+
223
+ ```python
224
+ from survival import finegray, FineGrayOutput
225
+
226
+ # Example competing risks data
227
+ tstart = [0.0, 0.0, 0.0, 0.0]
228
+ tstop = [1.0, 2.0, 3.0, 4.0]
229
+ ctime = [0.5, 1.5, 2.5, 3.5] # Cut points
230
+ cprob = [0.1, 0.2, 0.3, 0.4] # Cumulative probabilities
231
+ extend = [True, True, False, False] # Whether to extend intervals
232
+ keep = [True, True, True, True] # Which cut points to keep
233
+
234
+ result = finegray(
235
+ tstart=tstart,
236
+ tstop=tstop,
237
+ ctime=ctime,
238
+ cprob=cprob,
239
+ extend=extend,
240
+ keep=keep
241
+ )
242
+
243
+ print(f"Row indices: {result.row}")
244
+ print(f"Start times: {result.start}")
245
+ print(f"End times: {result.end}")
246
+ print(f"Weights: {result.wt}")
247
+ ```
248
+
249
+ ### Parametric Survival Regression (Accelerated Failure Time Models)
250
+
251
+ ```python
252
+ from survival import survreg, SurvivalFit, DistributionType
253
+
254
+ # Example survival data
255
+ time = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]
256
+ status = [1.0, 1.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0] # 1 = event, 0 = censored
257
+ covariates = [
258
+ [1.0, 2.0],
259
+ [1.5, 2.5],
260
+ [2.0, 3.0],
261
+ [2.5, 3.5],
262
+ [3.0, 4.0],
263
+ [3.5, 4.5],
264
+ [4.0, 5.0],
265
+ [4.5, 5.5],
266
+ ]
267
+
268
+ # Fit parametric survival model
269
+ result = survreg(
270
+ time=time,
271
+ status=status,
272
+ covariates=covariates,
273
+ weights=None, # Optional: observation weights
274
+ offsets=None, # Optional: offset values
275
+ initial_beta=None, # Optional: initial coefficient values
276
+ strata=None, # Optional: stratification variable
277
+ distribution="weibull", # "extreme_value", "logistic", "gaussian", "weibull", or "lognormal"
278
+ max_iter=20, # Optional: maximum iterations
279
+ eps=1e-5, # Optional: convergence tolerance
280
+ tol_chol=1e-9, # Optional: Cholesky tolerance
281
+ )
282
+
283
+ print(f"Coefficients: {result.coefficients}")
284
+ print(f"Log-likelihood: {result.log_likelihood}")
285
+ print(f"Iterations: {result.iterations}")
286
+ print(f"Variance matrix: {result.variance_matrix}")
287
+ print(f"Convergence flag: {result.convergence_flag}")
288
+ ```
289
+
290
+ ### Cox Proportional Hazards Model
291
+
292
+ ```python
293
+ from survival import CoxPHModel, Subject
294
+
295
+ # Create a Cox PH model
296
+ model = CoxPHModel()
297
+
298
+ # Or create with data
299
+ covariates = [[1.0, 2.0], [2.0, 3.0], [1.5, 2.5]]
300
+ event_times = [1.0, 2.0, 3.0]
301
+ censoring = [1, 1, 0] # 1 = event, 0 = censored
302
+
303
+ model = CoxPHModel.new_with_data(covariates, event_times, censoring)
304
+
305
+ # Fit the model
306
+ model.fit(n_iters=10)
307
+
308
+ # Get results
309
+ print(f"Baseline hazard: {model.baseline_hazard}")
310
+ print(f"Risk scores: {model.risk_scores}")
311
+ print(f"Coefficients: {model.get_coefficients()}")
312
+
313
+ # Predict on new data
314
+ new_covariates = [[1.0, 2.0], [2.0, 3.0]]
315
+ predictions = model.predict(new_covariates)
316
+ print(f"Predictions: {predictions}")
317
+
318
+ # Calculate Brier score
319
+ brier = model.brier_score()
320
+ print(f"Brier score: {brier}")
321
+
322
+ # Compute survival curves for new covariates
323
+ new_covariates = [[1.0, 2.0], [2.0, 3.0]]
324
+ time_points = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] # Optional: specific time points
325
+ times, survival_curves = model.survival_curve(new_covariates, time_points)
326
+ print(f"Time points: {times}")
327
+ print(f"Survival curves: {survival_curves}") # One curve per covariate set
328
+
329
+ # Create and add subjects
330
+ subject = Subject(
331
+ id=1,
332
+ covariates=[1.0, 2.0],
333
+ is_case=True,
334
+ is_subcohort=True,
335
+ stratum=0
336
+ )
337
+ model.add_subject(subject)
338
+ ```
339
+
340
+ ### Cox Martingale Residuals
341
+
342
+ ```python
343
+ from survival import coxmart
344
+
345
+ # Example survival data
346
+ time = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]
347
+ status = [1, 1, 0, 1, 0, 1, 1, 0] # 1 = event, 0 = censored
348
+ score = [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2] # Risk scores
349
+
350
+ # Calculate martingale residuals
351
+ residuals = coxmart(
352
+ time=time,
353
+ status=status,
354
+ score=score,
355
+ weights=None, # Optional: observation weights
356
+ strata=None, # Optional: stratification variable
357
+ method=0, # Optional: method (0 = Breslow, 1 = Efron)
358
+ )
359
+
360
+ print(f"Martingale residuals: {residuals}")
361
+ ```
362
+
363
+ ### Survival Difference Tests (Log-Rank Test)
364
+
365
+ ```python
366
+ from survival import survdiff2, SurvDiffResult
367
+
368
+ # Example: Compare survival between two groups
369
+ time = [1.0, 2.0, 3.0, 4.0, 5.0, 1.5, 2.5, 3.5, 4.5, 5.5]
370
+ status = [1, 1, 0, 1, 0, 1, 1, 1, 0, 1]
371
+ group = [1, 1, 1, 1, 1, 2, 2, 2, 2, 2] # Group 1 and Group 2
372
+
373
+ # Perform log-rank test (rho=0 for standard log-rank)
374
+ result = survdiff2(
375
+ time=time,
376
+ status=status,
377
+ group=group,
378
+ strata=None, # Optional: stratification variable
379
+ rho=0.0, # 0.0 = log-rank, 1.0 = Wilcoxon, other = generalized
380
+ )
381
+
382
+ print(f"Observed events: {result.observed}")
383
+ print(f"Expected events: {result.expected}")
384
+ print(f"Chi-squared statistic: {result.chi_squared}")
385
+ print(f"Degrees of freedom: {result.degrees_of_freedom}")
386
+ print(f"Variance matrix: {result.variance}")
387
+ ```
388
+
389
+ ## API Reference
390
+
391
+ ### Classes
392
+
393
+ **Core Models:**
394
+ - `AaregOptions`: Configuration options for Aalen's additive regression model
395
+ - `PSpline`: Penalized spline class for smooth covariate effects
396
+ - `CoxPHModel`: Cox proportional hazards model class
397
+ - `Subject`: Subject data structure for Cox PH models
398
+ - `ConditionalLogisticRegression`: Conditional logistic regression model
399
+ - `ClogitDataSet`: Dataset for conditional logistic regression
400
+
401
+ **Survival Curves:**
402
+ - `SurvFitKMOutput`: Output from Kaplan-Meier survival curve fitting
403
+ - `SurvFitAJ`: Output from Aalen-Johansen survival curve fitting
404
+ - `NelsonAalenResult`: Output from Nelson-Aalen estimator
405
+ - `StratifiedKMResult`: Output from stratified Kaplan-Meier
406
+
407
+ **Parametric Models:**
408
+ - `SurvivalFit`: Output from parametric survival regression
409
+ - `DistributionType`: Distribution types for parametric models (extreme_value, logistic, gaussian, weibull, lognormal)
410
+ - `FineGrayOutput`: Output from Fine-Gray competing risks model
411
+
412
+ **Statistical Tests:**
413
+ - `SurvDiffResult`: Output from survival difference tests
414
+ - `LogRankResult`: Output from log-rank test
415
+ - `TrendTestResult`: Output from trend tests
416
+ - `TestResult`: General test result output
417
+ - `ProportionalityTest`: Output from proportional hazards test
418
+
419
+ **Validation:**
420
+ - `BootstrapResult`: Output from bootstrap confidence interval calculations
421
+ - `CVResult`: Output from cross-validation
422
+ - `CalibrationResult`: Output from calibration analysis
423
+ - `PredictionResult`: Output from prediction functions
424
+ - `RiskStratificationResult`: Output from risk stratification
425
+ - `TdAUCResult`: Output from time-dependent AUC calculation
426
+
427
+ **RMST and Survival Metrics:**
428
+ - `RMSTResult`: Output from RMST calculation
429
+ - `RMSTComparisonResult`: Output from RMST comparison between groups
430
+ - `MedianSurvivalResult`: Output from median survival calculation
431
+ - `CumulativeIncidenceResult`: Output from cumulative incidence calculation
432
+ - `NNTResult`: Number needed to treat result
433
+
434
+ **Landmark Analysis:**
435
+ - `LandmarkResult`: Output from landmark analysis
436
+ - `ConditionalSurvivalResult`: Output from conditional survival calculation
437
+ - `HazardRatioResult`: Output from hazard ratio calculation
438
+ - `SurvivalAtTimeResult`: Output from survival at specific times
439
+ - `LifeTableResult`: Output from life table calculation
440
+
441
+ **Power and Sample Size:**
442
+ - `SampleSizeResult`: Output from sample size calculations
443
+ - `AccrualResult`: Output from accrual calculations
444
+
445
+ **Utilities:**
446
+ - `CoxCountOutput`: Output from Cox counting functions
447
+ - `SplitResult`: Output from time-splitting
448
+ - `LinkFunctionParams`: Link function parameters
449
+ - `CchMethod`: Case-cohort method specification
450
+ - `CohortData`: Cohort data structure
451
+
452
+ ### Functions
453
+
454
+ **Model Fitting:**
455
+ - `aareg(options)`: Fit Aalen's additive regression model
456
+ - `survreg(...)`: Fit parametric accelerated failure time models
457
+ - `perform_cox_regression_frailty(...)`: Fit Cox proportional hazards model with frailty
458
+
459
+ **Survival Curves:**
460
+ - `survfitkm(...)`: Fit Kaplan-Meier survival curves
461
+ - `survfitaj(...)`: Fit Aalen-Johansen survival curves (multi-state)
462
+ - `nelson_aalen_estimator(...)`: Calculate Nelson-Aalen estimator
463
+ - `stratified_kaplan_meier(...)`: Calculate stratified Kaplan-Meier curves
464
+ - `agsurv4(...)`: Anderson-Gill survival calculations (version 4)
465
+ - `agsurv5(...)`: Anderson-Gill survival calculations (version 5)
466
+
467
+ **Statistical Tests:**
468
+ - `survdiff2(...)`: Perform survival difference tests (log-rank, Wilcoxon, etc.)
469
+ - `logrank_test(...)`: Perform log-rank test
470
+ - `fleming_harrington_test(...)`: Perform Fleming-Harrington weighted test
471
+ - `logrank_trend(...)`: Perform log-rank trend test
472
+ - `lrt_test(...)`: Likelihood ratio test
473
+ - `wald_test_py(...)`: Wald test
474
+ - `score_test_py(...)`: Score test
475
+ - `ph_test(...)`: Proportional hazards assumption test
476
+
477
+ **Residuals:**
478
+ - `coxmart(...)`: Calculate Cox martingale residuals
479
+ - `agmart(...)`: Calculate Anderson-Gill martingale residuals
480
+ - `schoenfeld_residuals(...)`: Calculate Schoenfeld residuals
481
+ - `cox_score_residuals(...)`: Calculate Cox score residuals
482
+
483
+ **Concordance:**
484
+ - `perform_concordance1_calculation(...)`: Calculate concordance index (version 1)
485
+ - `perform_concordance3_calculation(...)`: Calculate concordance index (version 3)
486
+ - `perform_concordance_calculation(...)`: Calculate concordance index (version 5)
487
+ - `concordance(...)`: General concordance calculation
488
+
489
+ **Validation:**
490
+ - `bootstrap_cox_ci(...)`: Bootstrap confidence intervals for Cox models
491
+ - `bootstrap_survreg_ci(...)`: Bootstrap confidence intervals for parametric models
492
+ - `cv_cox_concordance(...)`: Cross-validation for Cox model concordance
493
+ - `cv_survreg_loglik(...)`: Cross-validation for parametric model log-likelihood
494
+ - `calibration(...)`: Model calibration assessment
495
+ - `predict_cox(...)`: Predictions from Cox models
496
+ - `risk_stratification(...)`: Risk group stratification
497
+ - `td_auc(...)`: Time-dependent AUC calculation
498
+ - `brier(...)`: Calculate Brier score
499
+ - `integrated_brier(...)`: Calculate integrated Brier score
500
+
501
+ **RMST and Survival Metrics:**
502
+ - `rmst(...)`: Calculate restricted mean survival time
503
+ - `rmst_comparison(...)`: Compare RMST between groups
504
+ - `survival_quantile(...)`: Calculate survival quantiles (median, etc.)
505
+ - `cumulative_incidence(...)`: Calculate cumulative incidence
506
+ - `number_needed_to_treat(...)`: Calculate NNT
507
+
508
+ **Landmark Analysis:**
509
+ - `landmark_analysis(...)`: Perform landmark analysis
510
+ - `landmark_analysis_batch(...)`: Perform batch landmark analysis at multiple time points
511
+ - `conditional_survival(...)`: Calculate conditional survival
512
+ - `hazard_ratio(...)`: Calculate hazard ratios
513
+ - `survival_at_times(...)`: Calculate survival at specific time points
514
+ - `life_table(...)`: Generate life table
515
+
516
+ **Power and Sample Size:**
517
+ - `sample_size_survival(...)`: Calculate required sample size
518
+ - `sample_size_survival_freedman(...)`: Sample size using Freedman's method
519
+ - `power_survival(...)`: Calculate statistical power
520
+ - `expected_events(...)`: Calculate expected number of events
521
+
522
+ **Utilities:**
523
+ - `finegray(...)`: Fine-Gray competing risks model data preparation
524
+ - `perform_pyears_calculation(...)`: Calculate person-years of observation
525
+ - `perform_pystep_calculation(...)`: Perform step calculations
526
+ - `perform_pystep_simple_calculation(...)`: Perform simple step calculations
527
+ - `perform_score_calculation(...)`: Calculate score statistics
528
+ - `perform_agscore3_calculation(...)`: Calculate score statistics (version 3)
529
+ - `survsplit(...)`: Split survival data at specified times
530
+ - `tmerge(...)`: Merge time-dependent covariates
531
+ - `tmerge2(...)`: Merge time-dependent covariates (version 2)
532
+ - `tmerge3(...)`: Merge time-dependent covariates (version 3)
533
+ - `collapse(...)`: Collapse survival data
534
+ - `coxcount1(...)`: Cox counting process calculations
535
+ - `coxcount2(...)`: Cox counting process calculations (version 2)
536
+ - `agexact(...)`: Exact Anderson-Gill calculations
537
+ - `norisk(...)`: No-risk calculations
538
+ - `cipoisson(...)`: Poisson confidence intervals
539
+ - `cipoisson_exact(...)`: Exact Poisson confidence intervals
540
+ - `cipoisson_anscombe(...)`: Anscombe Poisson confidence intervals
541
+ - `cox_callback(...)`: Cox model callback for iterative fitting
542
+
543
+ ## PSpline Options
544
+
545
+ The `PSpline` class provides penalized spline smoothing:
546
+
547
+ **Constructor Parameters:**
548
+ - `x`: Covariate vector (list of floats)
549
+ - `df`: Degrees of freedom (integer)
550
+ - `theta`: Roughness penalty (float)
551
+ - `eps`: Accuracy for degrees of freedom (float)
552
+ - `method`: Penalty method for tuning parameter selection. Supported methods:
553
+ - `"GCV"` - Generalized Cross-Validation
554
+ - `"UBRE"` - Unbiased Risk Estimator
555
+ - `"REML"` - Restricted Maximum Likelihood
556
+ - `"AIC"` - Akaike Information Criterion
557
+ - `"BIC"` - Bayesian Information Criterion
558
+ - `boundary_knots`: Tuple of (min, max) for the spline basis
559
+ - `intercept`: Whether to include an intercept in the basis
560
+ - `penalty`: Whether to apply the penalty
561
+
562
+ **Methods:**
563
+ - `fit()`: Fit the spline model, returns coefficients
564
+ - `predict(new_x)`: Predict values at new x points
565
+
566
+ **Properties:**
567
+ - `coefficients`: Fitted coefficients (None if not fitted)
568
+ - `fitted`: Whether the model has been fitted
569
+ - `df`: Degrees of freedom
570
+ - `eps`: Convergence tolerance
571
+
572
+ ## Development
573
+
574
+ Build the Rust library:
575
+ ```sh
576
+ cargo build
577
+ ```
578
+
579
+ Run tests:
580
+ ```sh
581
+ cargo test
582
+ ```
583
+
584
+ Format code:
585
+ ```sh
586
+ cargo fmt
587
+ ```
588
+
589
+ The codebase is organized with:
590
+ - Core routines in `src/`
591
+ - Tests and examples in `test/`
592
+ - Python bindings using PyO3
593
+
594
+ ## Dependencies
595
+
596
+ - [PyO3](https://github.com/PyO3/pyo3) - Python bindings
597
+ - [ndarray](https://github.com/rust-ndarray/ndarray) - N-dimensional arrays
598
+ - [faer](https://github.com/sarah-ek/faer-rs) - Pure-Rust linear algebra
599
+ - [itertools](https://github.com/rust-itertools/itertools) - Iterator utilities
600
+ - [rayon](https://github.com/rayon-rs/rayon) - Parallel computation
601
+
602
+ ## Compatibility
603
+
604
+ - This build is for Python only. R/extendr bindings are currently disabled.
605
+ - macOS users: Ensure you are using the correct Python version and have Homebrew-installed Python if using Apple Silicon.
606
+
607
+ ## License
608
+
609
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
610
+
@@ -0,0 +1,8 @@
1
+ survival-1.1.5.dist-info/METADATA,sha256=gHFqOT-FandBIsN_F4jNoXbAgQI2xmoUlKWHpu9OvR0,19768
2
+ survival-1.1.5.dist-info/WHEEL,sha256=0p9RWqZ1tTIS4XVGVX-OqQSPs2Wp470cV_pQ0zUt98A,107
3
+ survival-1.1.5.dist-info/licenses/LICENSE,sha256=hS2BuXZUcQTPPxaojumqQeGtQjachYGOChZXBWbQQ7E,1070
4
+ survival/__init__.py,sha256=GnlNEQ5WtMH1BtVycBOXD_TI0wZuqrEqGJYsXgjbhVI,115
5
+ survival/__init__.pyi,sha256=phbQd5RA8G_WqOUfceRiboKGkcVCLKybWxf1f1XDjZY,22470
6
+ survival/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ survival/survival.cpython-314-darwin.so,sha256=jpvdBaEvqp2vehcnKOUxkNJRO0yi-gNQlWvp7LvJE4Q,2862044
8
+ survival-1.1.5.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.10.2)
3
+ Root-Is-Purelib: false
4
+ Tag: cp314-cp314-macosx_10_12_x86_64
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Cameron Lyons
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.