Crates.io | survival_analysis |
lib.rs | survival_analysis |
version | 0.1.0 |
source | src |
created_at | 2020-07-25 06:09:23.60298 |
updated_at | 2020-07-25 06:09:23.60298 |
description | Survival analysis library |
homepage | http://github.com/mikkyang/survival-analysis |
repository | http://github.com/mikkyang/survival-analysis |
max_upload_size | |
id | 269423 |
size | 28,046 |
A experimental survival analysis library, initially inspired by Python's lifelines.
Current Limitations:
use ndarray::prelude::*;
use survival_analysis::{IntervalCensored, Fitter, BaseFitter};
use survival_analysis::distribution::WeibullDistribution;
let data = IntervalCensored {
start: array![0., 2., 5., 10.],
stop: array![2., 5., 10., 1e10f64],
};
let fitter = BaseFitter::new(data);
let params: WeibullDistribution<f64> = fitter.fit().unwrap();
assert!((params.shape - 0.980).abs() < 1e-2);
assert!((params.scale - 7.187).abs() < 1e-2);