scikit-survival 0.23.1__cp310-cp310-macosx_11_0_arm64.whl → 0.24.1__cp310-cp310-macosx_11_0_arm64.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.
@@ -1,9 +1,9 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: scikit-survival
3
- Version: 0.23.1
3
+ Version: 0.24.1
4
4
  Summary: Survival analysis built on top of scikit-learn
5
5
  Author-email: Sebastian Pölsterl <sebp@k-d-w.org>
6
- License: GNU GENERAL PUBLIC LICENSE
6
+ License: GNU GENERAL PUBLIC LICENSE
7
7
  Version 3, 29 June 2007
8
8
 
9
9
  Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
@@ -694,52 +694,53 @@ Classifier: Programming Language :: C++
694
694
  Classifier: Programming Language :: Cython
695
695
  Classifier: Programming Language :: Python
696
696
  Classifier: Programming Language :: Python :: 3
697
- Classifier: Programming Language :: Python :: 3.9
698
697
  Classifier: Programming Language :: Python :: 3.10
699
698
  Classifier: Programming Language :: Python :: 3.11
700
699
  Classifier: Programming Language :: Python :: 3.12
700
+ Classifier: Programming Language :: Python :: 3.13
701
701
  Classifier: Topic :: Software Development
702
702
  Classifier: Topic :: Scientific/Engineering
703
- Requires-Python: >=3.9
703
+ Requires-Python: >=3.10
704
704
  Description-Content-Type: text/x-rst
705
705
  License-File: COPYING
706
706
  Requires-Dist: ecos
707
707
  Requires-Dist: joblib
708
708
  Requires-Dist: numexpr
709
709
  Requires-Dist: numpy
710
- Requires-Dist: osqp !=0.6.0,!=0.6.1
711
- Requires-Dist: pandas >=1.4.0
712
- Requires-Dist: scipy >=1.3.2
713
- Requires-Dist: scikit-learn <1.6,>=1.4.0
710
+ Requires-Dist: osqp<1.0.0,>=0.6.3
711
+ Requires-Dist: pandas>=1.4.0
712
+ Requires-Dist: scipy>=1.3.2
713
+ Requires-Dist: scikit-learn<1.7,>=1.6.1
714
714
  Provides-Extra: dev
715
- Requires-Dist: black[jupyter] ; extra == 'dev'
716
- Requires-Dist: build ; extra == 'dev'
717
- Requires-Dist: coverage ; extra == 'dev'
718
- Requires-Dist: Cython >=3.0.10 ; extra == 'dev'
719
- Requires-Dist: packaging ; extra == 'dev'
720
- Requires-Dist: pre-commit ; extra == 'dev'
721
- Requires-Dist: pytest ; extra == 'dev'
722
- Requires-Dist: ruff ; extra == 'dev'
723
- Requires-Dist: setuptools-scm >=8 ; extra == 'dev'
724
- Requires-Dist: tomli ; extra == 'dev'
725
- Requires-Dist: tox ; extra == 'dev'
715
+ Requires-Dist: black[jupyter]; extra == "dev"
716
+ Requires-Dist: build; extra == "dev"
717
+ Requires-Dist: coverage; extra == "dev"
718
+ Requires-Dist: Cython>=3.0.10; extra == "dev"
719
+ Requires-Dist: packaging; extra == "dev"
720
+ Requires-Dist: pre-commit; extra == "dev"
721
+ Requires-Dist: pytest; extra == "dev"
722
+ Requires-Dist: ruff; extra == "dev"
723
+ Requires-Dist: setuptools-scm>=8; extra == "dev"
724
+ Requires-Dist: tomli; extra == "dev"
725
+ Requires-Dist: tox; extra == "dev"
726
726
  Provides-Extra: docs
727
- Requires-Dist: ipython !=8.7.0 ; extra == 'docs'
728
- Requires-Dist: nbsphinx >=0.9.2 ; extra == 'docs'
729
- Requires-Dist: docutils ; extra == 'docs'
730
- Requires-Dist: setuptools-scm ; extra == 'docs'
731
- Requires-Dist: sphinx ~=7.3.7 ; extra == 'docs'
732
- Requires-Dist: pydata-sphinx-theme ~=0.15.2 ; extra == 'docs'
733
- Requires-Dist: sphinxcontrib-spelling ; extra == 'docs'
734
- Requires-Dist: sphinx-design ~=0.5.0 ; extra == 'docs'
735
- Requires-Dist: sphinx-copybutton ~=0.5.2 ; extra == 'docs'
727
+ Requires-Dist: ipython!=8.7.0; extra == "docs"
728
+ Requires-Dist: nbsphinx>=0.9.2; extra == "docs"
729
+ Requires-Dist: docutils; extra == "docs"
730
+ Requires-Dist: setuptools-scm; extra == "docs"
731
+ Requires-Dist: sphinx~=8.1.3; extra == "docs"
732
+ Requires-Dist: pydata-sphinx-theme~=0.16.1; extra == "docs"
733
+ Requires-Dist: sphinxcontrib-spelling; extra == "docs"
734
+ Requires-Dist: sphinx-design~=0.6.1; extra == "docs"
735
+ Requires-Dist: sphinx-copybutton~=0.5.2; extra == "docs"
736
736
  Provides-Extra: nbval
737
- Requires-Dist: ipykernel ; extra == 'nbval'
738
- Requires-Dist: ipython !=8.7.0 ; extra == 'nbval'
739
- Requires-Dist: matplotlib ~=3.8.0 ; extra == 'nbval'
740
- Requires-Dist: nbformat ; extra == 'nbval'
741
- Requires-Dist: nbval >=0.10.0 ; extra == 'nbval'
742
- Requires-Dist: seaborn ~=0.11.2 ; extra == 'nbval'
737
+ Requires-Dist: ipykernel; extra == "nbval"
738
+ Requires-Dist: ipython!=8.7.0; extra == "nbval"
739
+ Requires-Dist: matplotlib~=3.9.0; extra == "nbval"
740
+ Requires-Dist: nbformat; extra == "nbval"
741
+ Requires-Dist: nbval>=0.10.0; extra == "nbval"
742
+ Requires-Dist: seaborn~=0.13.2; extra == "nbval"
743
+ Dynamic: license-file
743
744
 
744
745
  |License| |Docs| |DOI|
745
746
 
@@ -775,14 +776,14 @@ this unique characteristic of such a dataset into account.
775
776
  Requirements
776
777
  ============
777
778
 
778
- - Python 3.9 or later
779
+ - Python 3.10 or later
779
780
  - ecos
780
781
  - joblib
781
782
  - numexpr
782
783
  - numpy
783
784
  - osqp
784
785
  - pandas 1.4.0 or later
785
- - scikit-learn 1.4 or 1.5
786
+ - scikit-learn 1.6
786
787
  - scipy
787
788
  - C/C++ compiler
788
789
 
@@ -0,0 +1,57 @@
1
+ scikit_survival-0.24.1.dist-info/RECORD,,
2
+ scikit_survival-0.24.1.dist-info/WHEEL,sha256=TmyW8D9OPImQItPFLlTWg3ThBsUQjFY1sQx0hG5nmd4,136
3
+ scikit_survival-0.24.1.dist-info/top_level.txt,sha256=fPkcFA-XQGbwnD_ZXOvaOWmSd34Qezr26Mn99nYPvAg,7
4
+ scikit_survival-0.24.1.dist-info/METADATA,sha256=dg43_aZQq6kxDldl8S3mgqRvOZYxMP5UXswJqipPI14,48948
5
+ scikit_survival-0.24.1.dist-info/licenses/COPYING,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
6
+ sksurv/functions.py,sha256=Y0hmtcF1llMkS-ZZOBLDhYUnThko8PGYvYKPtFDReSg,3677
7
+ sksurv/metrics.py,sha256=l6WbcKkb-Ry3tYiLkLs4jMGPbDQOcNW-xG2l_Msg9gs,37358
8
+ sksurv/nonparametric.py,sha256=KVWiASlfNpUGvmaT4RzdQsiBrkAIB6WTjFU4slUyzqo,29020
9
+ sksurv/util.py,sha256=0iTd7gKP8toxQSePYqRa376P9ZVpYF7sv2bFwTNtVAo,13208
10
+ sksurv/__init__.py,sha256=IfdVMjYlvlXe5-Et9-1b2LyujeidQZPuLJltgbTM6ag,3591
11
+ sksurv/preprocessing.py,sha256=gJiMD-b_ybnb-jTpEsmQwr-4dMFeS2T2Dkw69p1Y7IQ,5204
12
+ sksurv/exceptions.py,sha256=CRun7zrKzcZ9zinni5b2cMaV-pU-pw1UnXpRV2h3z_4,801
13
+ sksurv/testing.py,sha256=2oeCsTzEiVRKDRb3iSJLKn03hBO2IrUq-2U5TfvOYK4,4295
14
+ sksurv/compare.py,sha256=zcWPl0rjRvMRS02r1681Q5Xbz-6WLV5fjAgPzRdquUg,4089
15
+ sksurv/base.py,sha256=VfCS3AcFnoVxc-h_6KYQONSelUnI0611lmMmUOb4c-Q,3771
16
+ sksurv/column.py,sha256=dlh1HvsXqMnIRGgm60Expp2FpinqcHbHWDNn2lxM5k0,6469
17
+ sksurv/tree/tree.py,sha256=_z8BtU00Xles-T8kSQV1IB74DhrI94A_AaQC6CFaLOk,26569
18
+ sksurv/tree/__init__.py,sha256=7RUjPZtGrVYiHY4roDXdEDM7RVBSsbY_CXWmyqZk2ts,64
19
+ sksurv/tree/_criterion.cpython-310-darwin.so,sha256=1oCglqO0YSRHimcz-Qgl6mki73tkZwUmlcnGvfF0Uvc,225488
20
+ sksurv/ensemble/boosting.py,sha256=luPw2qEOYTZaVZCC6_Sfz_tbnR0pZy6HKx457HNi-sY,62091
21
+ sksurv/ensemble/_coxph_loss.cpython-310-darwin.so,sha256=gAPfVfZ_8YAaihMBAwVu3eP72ekspX17Jaf14Y3bvjY,204784
22
+ sksurv/ensemble/__init__.py,sha256=7kZAzxFpJGtgLQfhoOqZUyGUubIs_Kw3RgyUsAd1Fq0,191
23
+ sksurv/ensemble/survival_loss.py,sha256=mhIbuOqz7t-nuygswZD0d0are2R0EQ3d3yHMRdxOKIk,5942
24
+ sksurv/ensemble/forest.py,sha256=0NgC1yUOznWCMnc5rTgVMemtfXoX3GULJoWX_xNQv3E,35981
25
+ sksurv/kernels/clinical.py,sha256=27U1fDAlhrZeQEANelDFPWw3aXrTIwWqxUEKo8u_t9I,10763
26
+ sksurv/kernels/__init__.py,sha256=_aZIFutv7kUTlkHJlP52zBDkpUXnKIlPPf3cikuAmCA,77
27
+ sksurv/kernels/_clinical_kernel.cpython-310-darwin.so,sha256=wPWhtEaHDohQ0L8umJldv9NtYjmhD5-WYmXkazL4hCQ,205336
28
+ sksurv/bintrees/__init__.py,sha256=l6Fe4PAMByrABpGzZ5W8KHieEYG-rh-DADo2QiEMLrU,727
29
+ sksurv/bintrees/_binarytrees.cpython-310-darwin.so,sha256=G1oCoSgjcM92VSPoYulnI88ZzBOjyrOeJ0ayLkJAv1c,111232
30
+ sksurv/datasets/__init__.py,sha256=EPzJ50wd-cZ6mWuHFPRRRMqgt14WzM32HGxDrlOp9Q4,361
31
+ sksurv/datasets/base.py,sha256=ZTJuH0SLnCQJUVB2Bw61DkhNjIoqRoc6op7rVDVXvKI,24265
32
+ sksurv/datasets/data/cgvhd.arff,sha256=0lxUqY74JaMpC_vWJC4RWJy6vTmQwCg1yrUxjX65VX8,5214
33
+ sksurv/datasets/data/GBSG2.arff,sha256=jBuh302AIWtYaV1rvJ9RKEZkqzcSThAdVt8ImFFkWwQ,26204
34
+ sksurv/datasets/data/actg320.arff,sha256=8GE2kIU8Nvx7m5Ns-uTJW6Rgtk3xmJzBzMEmtynq5FU,45446
35
+ sksurv/datasets/data/bmt.arff,sha256=yRCh87tAlsBQAocliDquyP28lsnQhCTNU0vJatgH6ns,509
36
+ sksurv/datasets/data/breast_cancer_GSE7390-metastasis.arff,sha256=Iz9MHAay7imf_8ug-YgfbtZqNWbMvsMLUATw0pi1JXA,264743
37
+ sksurv/datasets/data/flchain.arff,sha256=vyYA7EN90ZBx9zva2C3mgXgEV9EUHsNu1VGwAm5uV3M,343058
38
+ sksurv/datasets/data/whas500.arff,sha256=9kBAyROYh1E3gi7KMGqScgjfaJaAjNl2SvcGVyL6U9Y,27772
39
+ sksurv/datasets/data/veteran.arff,sha256=cdvJ4jXzzC7RCzolTjn5hcCSNG0chFc27SGxP74mNFY,5260
40
+ sksurv/io/arffwrite.py,sha256=68FZRU4KKJ5dIaOZwhK-L7R47gPK9oHorQVBdD0my18,4464
41
+ sksurv/io/__init__.py,sha256=LacpKG9UKO_RefPXc6umPaGFGPOGzA-FZra_MCRWCxk,92
42
+ sksurv/io/arffread.py,sha256=cQqdKoCgCcd8FHJVGnsmpRWeaGqnYiauRJ4oANOkri8,1839
43
+ sksurv/meta/__init__.py,sha256=VLA0VhLxZhF3z35md5Z4-nhw6BSSCfR6L7YOBGk1w1A,216
44
+ sksurv/meta/stacking.py,sha256=PO8Cgc1SKFCUwpIEcCuFvA3PLp-qBgkRYbNyz-7DJp0,12280
45
+ sksurv/meta/ensemble_selection.py,sha256=VFWGiHRXK3lfndF3etU9BJnaEK_MBSVMdVcdAyrEdiA,24031
46
+ sksurv/meta/base.py,sha256=mV6653v4txKKHJqcJXVT-J-ARNN9rDfzIq02xoEy93I,1437
47
+ sksurv/linear_model/coxph.py,sha256=gEi0otT6Vmt9Fxi_PhUWChrCJ2CtGMJhb3vA7jtWFSg,20871
48
+ sksurv/linear_model/__init__.py,sha256=58Lt5Tj3xGqRS4uZfVR5avKQNZubHD6RSknVDyzLTso,152
49
+ sksurv/linear_model/coxnet.py,sha256=v5lfcldVViB5QDGIM6bMVS1SK60CjtmTYoQXqdG0AIA,20016
50
+ sksurv/linear_model/_coxnet.cpython-310-darwin.so,sha256=8H3r6MftcTFLYd_A44tgv14a0aAfXo1mJAs290hvFeI,130528
51
+ sksurv/linear_model/aft.py,sha256=TSiYEsPwYIyHpRu-11F0-i985D2Lwi_HLJ1aztiPaoU,7411
52
+ sksurv/svm/naive_survival_svm.py,sha256=FaAS1_pzTSa1ivOzObJ3IFMILc7inKNUkefr7rEPNe0,7978
53
+ sksurv/svm/__init__.py,sha256=7BRFkatw9wbtsY-aes9cnz31VPpIjZ-383LuDmucDsw,328
54
+ sksurv/svm/_minlip.cpython-310-darwin.so,sha256=w1ylI4tZvYRhI3YXmMFBMRczSpYTfjHXxxgKvcon3rU,204976
55
+ sksurv/svm/_prsvm.cpython-310-darwin.so,sha256=Hm8kMZDnRIcwKvL9zRZvhTJAT7ix7TPOMIb0KSZQURI,204832
56
+ sksurv/svm/survival_svm.py,sha256=Qbpdzm3mhBI-ajGW4TonFTDxYdt8sKoDFiV5X5buqbA,43595
57
+ sksurv/svm/minlip.py,sha256=tDXyQaz5q4jdiiZYw_Gfc8rSyez0D8T2VbFmXv7zZdQ,21935
@@ -1,5 +1,6 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.0)
2
+ Generator: setuptools (78.0.2)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp310-cp310-macosx_11_0_arm64
5
+ Generator: delocate 0.13.0
5
6
 
sksurv/__init__.py CHANGED
@@ -19,7 +19,7 @@ def _get_version(name):
19
19
  def show_versions():
20
20
  sys_info = {
21
21
  "Platform": platform.platform(),
22
- "Python version": f"{platform.python_implementation()} {platform}",
22
+ "Python version": f"{platform.python_implementation()} {platform.python_version()}",
23
23
  "Python interpreter": sys.executable,
24
24
  }
25
25
 
@@ -44,7 +44,7 @@ def show_versions():
44
44
  max(map(len, deps)),
45
45
  max(map(len, sys_info.keys())),
46
46
  )
47
- fmt = "{0:<%ds}: {1}" % minwidth
47
+ fmt = f"{{0:<{minwidth}s}}: {{1}}"
48
48
 
49
49
  print("SYSTEM")
50
50
  print("------")
sksurv/base.py CHANGED
@@ -99,5 +99,7 @@ class SurvivalAnalysisMixin:
99
99
  result = concordance_index_censored(y[name_event], y[name_time], risk_score)
100
100
  return result[0]
101
101
 
102
- def _more_tags(self):
103
- return {"requires_y": True}
102
+ def __sklearn_tags__(self):
103
+ tags = super().__sklearn_tags__()
104
+ tags.target_tags.required = True
105
+ return tags
@@ -2,7 +2,9 @@ from .base import (
2
2
  get_x_y, # noqa: F401
3
3
  load_aids, # noqa: F401
4
4
  load_arff_files_standardized, # noqa: F401
5
+ load_bmt, # noqa: F401
5
6
  load_breast_cancer, # noqa: F401
7
+ load_cgvhd, # noqa: F401
6
8
  load_flchain, # noqa: F401
7
9
  load_gbsg2, # noqa: F401
8
10
  load_veterans_lung_cancer, # noqa: F401
sksurv/datasets/base.py CHANGED
@@ -12,6 +12,8 @@ __all__ = [
12
12
  "get_x_y",
13
13
  "load_arff_files_standardized",
14
14
  "load_aids",
15
+ "load_bmt",
16
+ "load_cgvhd",
15
17
  "load_breast_cancer",
16
18
  "load_flchain",
17
19
  "load_gbsg2",
@@ -26,13 +28,17 @@ def _get_data_path(name):
26
28
  return files(__package__) / "data" / name
27
29
 
28
30
 
29
- def _get_x_y_survival(dataset, col_event, col_time, val_outcome):
31
+ def _get_x_y_survival(dataset, col_event, col_time, val_outcome, competing_risks=False):
30
32
  if col_event is None or col_time is None:
31
33
  y = None
32
34
  x_frame = dataset
33
35
  else:
34
- y = np.empty(dtype=[(col_event, bool), (col_time, np.float64)], shape=dataset.shape[0])
35
- y[col_event] = (dataset[col_event] == val_outcome).values
36
+ event_type = np.int64 if competing_risks else bool
37
+ y = np.empty(dtype=[(col_event, event_type), (col_time, np.float64)], shape=dataset.shape[0])
38
+ if competing_risks:
39
+ y[col_event] = dataset[col_event].values
40
+ else:
41
+ y[col_event] = (dataset[col_event] == val_outcome).values
36
42
  y[col_time] = dataset[col_time].values
37
43
 
38
44
  x_frame = dataset.drop([col_event, col_time], axis=1)
@@ -51,7 +57,7 @@ def _get_x_y_other(dataset, col_label):
51
57
  return x_frame, y
52
58
 
53
59
 
54
- def get_x_y(data_frame, attr_labels, pos_label=None, survival=True):
60
+ def get_x_y(data_frame, attr_labels, pos_label=None, survival=True, competing_risks=False):
55
61
  """Split data frame into features and labels.
56
62
 
57
63
  Parameters
@@ -75,6 +81,9 @@ def get_x_y(data_frame, attr_labels, pos_label=None, survival=True):
75
81
  survival : bool, optional, default: True
76
82
  Whether to return `y` that can be used for survival analysis.
77
83
 
84
+ competing_risks : bool, optional, default: False
85
+ Whether `y` refers to competing risks situation. Only used if `survival` is True
86
+
78
87
  Returns
79
88
  -------
80
89
  X : pandas.DataFrame, shape = (n_samples, n_columns - len(attr_labels))
@@ -89,9 +98,9 @@ def get_x_y(data_frame, attr_labels, pos_label=None, survival=True):
89
98
  if survival:
90
99
  if len(attr_labels) != 2:
91
100
  raise ValueError(f"expected sequence of length two for attr_labels, but got {len(attr_labels)}")
92
- if pos_label is None:
101
+ if pos_label is None and not competing_risks:
93
102
  raise ValueError("pos_label needs to be specified if survival=True")
94
- return _get_x_y_survival(data_frame, attr_labels[0], attr_labels[1], pos_label)
103
+ return _get_x_y_survival(data_frame, attr_labels[0], attr_labels[1], pos_label, competing_risks)
95
104
 
96
105
  return _get_x_y_other(data_frame, attr_labels)
97
106
 
@@ -434,3 +443,147 @@ def load_flchain():
434
443
  """
435
444
  fn = _get_data_path("flchain.arff")
436
445
  return get_x_y(loadarff(fn), attr_labels=["death", "futime"], pos_label="dead")
446
+
447
+
448
+ def load_bmt():
449
+ """Load and return response to hematopoietic stem cell transplantation (HSCT) for acute leukemia patients.
450
+
451
+ The dataset has 35 samples and 1 feature "dis" indicating the type of leukemia::
452
+
453
+ 0=ALL (Acute Lymphoblastic Leukemia)
454
+ 1=AML (Acute Myeloid Leukemia)
455
+
456
+ The endpoint (status) is defined as
457
+
458
+ +-------+------------------------------------+---------------------+
459
+ | Value | Description | Count (%) |
460
+ +=======+====================================+=====================+
461
+ | 0 | Survival (Right-censored data) | 11 patients (31.4%) |
462
+ +-------+------------------------------------+---------------------+
463
+ | 1 | Transplant related mortality (TRM) | 9 events (25.7%) |
464
+ +-------+------------------------------------+---------------------+
465
+ | 2 | Relapse | 15 events (42.8%) |
466
+ +-------+------------------------------------+---------------------+
467
+
468
+ See [1]_ for further description and [2]_ for the dataset.
469
+
470
+ Returns
471
+ -------
472
+ x : pandas.DataFrame
473
+ The measurements for each patient.
474
+
475
+ y : structured array with 2 fields
476
+ *status*: Integer indicating the endpoint: 0-(survival i.e. right censored data), 1-(TRM), 2-(relapse)
477
+
478
+ *ftime*: total length of follow-up or time of event.
479
+
480
+ References
481
+ ----------
482
+ .. [1] https://doi.org/10.1038/sj.bmt.1705727
483
+ Scrucca, L., Santucci, A. & Aversa, F.:
484
+ "Competing risk analysis using R: an easy guide for clinicians. Bone Marrow Transplant 40, 381–387 (2007)"
485
+
486
+ .. [2] https://luca-scr.github.io/R/bmt.csv
487
+ """
488
+ full_path = _get_data_path("bmt.arff")
489
+ data = loadarff(full_path)
490
+ data["ftime"] = data["ftime"].astype(int)
491
+ return get_x_y(data, attr_labels=["status", "ftime"], competing_risks=True)
492
+
493
+
494
+ def load_cgvhd():
495
+ r"""Load and return data from multicentre randomized clinical trial
496
+ initiated for patients with a myeloid malignancy who were to
497
+ undergo an allogeneic bone marrow transplant.
498
+
499
+ The dataset is a 100 patient subsample of the full data set. See [2]_ for further details.
500
+
501
+ +-------+------------+----------------------------------------------+-------------------------------------------+
502
+ | Index | Name | Description | Encoding |
503
+ +=======+============+==============================================+===========================================+
504
+ | 1 | dx | Diagnosis | | AML=acute myeloid leukaemia |
505
+ | | | | | CML=chronic myeloid leukaemia |
506
+ +-------+------------+----------------------------------------------+-------------------------------------------+
507
+ | 2 | tx | Randomized treatment | | BM=cell harvested from the bone marrow |
508
+ | | | | | PB=cell harvested from peripheral blood |
509
+ +-------+------------+----------------------------------------------+-------------------------------------------+
510
+ | 3 | extent | Extent of disease | L=limited, E=extensive |
511
+ +-------+------------+----------------------------------------------+-------------------------------------------+
512
+ | 4 | agvhdgd | Grade of acute GVHD | |
513
+ +-------+------------+----------------------------------------------+-------------------------------------------+
514
+ | 5 | age | Age | Years |
515
+ +-------+------------+----------------------------------------------+-------------------------------------------+
516
+ | 6 | survtime | Time from date of transplant to death | Years |
517
+ | | | or last follow-up | |
518
+ +-------+------------+----------------------------------------------+-------------------------------------------+
519
+ | 7 | reltime | Time from date of transplant to relapse | Years |
520
+ | | | or last follow-up | |
521
+ +-------+------------+----------------------------------------------+-------------------------------------------+
522
+ | 8 | agvhtime | Time from date of transplant to acute GVHD | Years |
523
+ | | | or last follow-up | |
524
+ +-------+------------+----------------------------------------------+-------------------------------------------+
525
+ | 9 | cgvhtime | Time from date of transplant to chronic GVHD | Years |
526
+ | | | or last follow-up | |
527
+ +-------+------------+----------------------------------------------+-------------------------------------------+
528
+ | 10 | stat | Status | 1=Dead, 0=Alive |
529
+ +-------+------------+----------------------------------------------+-------------------------------------------+
530
+ | 11 | rcens | Relapse | 1=Yes, 0=No |
531
+ +-------+------------+----------------------------------------------+-------------------------------------------+
532
+ | 12 | agvh | Acute GVHD | 1=Yes, 0=No |
533
+ +-------+------------+----------------------------------------------+-------------------------------------------+
534
+ | 13 | cgvh | Chronic GVHD | 1=Yes, 0=No |
535
+ +-------+------------+----------------------------------------------+-------------------------------------------+
536
+ | 14 | stnum | patient ID | |
537
+ +-------+------------+----------------------------------------------+-------------------------------------------+
538
+
539
+ Columns 6,7 and 9 contain the time to death, relapse and CGVHD
540
+ calculated in years (survtime, reltime, cgvhtime) and the
541
+ respective indicator variables are in columns 10,11 and 13 (stat,
542
+ rcens, cgvh). The earliest time that any of these events happened
543
+ is calculated by taking the minimum of the observed times. The
544
+ censoring variable cens is coded as 0 when no events were
545
+ observed, 1 if CGVHD was observed as first event, 2 if a relapse
546
+ was observed as the first event and 3 if death occurred before
547
+ either of the events: The endpoint (status) is therefore defined as
548
+
549
+ +-------+-------------------------------------------+-----------------+
550
+ | Value | Description | Count (%) |
551
+ +=======+===========================================+=================+
552
+ | 0 | Survival (Right-censored data) | 4 patients (4%) |
553
+ +-------+-------------------------------------------+-----------------+
554
+ | 1 | Chronic graft versus host disease (CGVHD) | 86 events (86%) |
555
+ +-------+-------------------------------------------+-----------------+
556
+ | 2 | Relapse (TRM) | 5 events (5%) |
557
+ +-------+-------------------------------------------+-----------------+
558
+ | 3 | Death | 5 events (5%) |
559
+ +-------+-------------------------------------------+-----------------+
560
+
561
+ The dataset has been obtained from [1]_.
562
+
563
+ Returns
564
+ -------
565
+ x : pandas.DataFrame
566
+ The measurements for each patient.
567
+
568
+ y : structured array with 2 fields
569
+ *status*: Integer indicating the endpoint: 0: right censored data; 1: CGVHD; 2: relapse; 3: death.
570
+
571
+ *ftime*: total length of follow-up or time of event.
572
+
573
+ References
574
+ ----------
575
+ .. [1] https://sites.google.com/view/melaniapintiliemscstatistics/home/statistics
576
+
577
+ .. [2] Melania Pintilie: "Competing Risks: A Practical Perspective". John Wiley & Sons, 2006
578
+ """
579
+ full_path = _get_data_path("cgvhd.arff")
580
+ data = loadarff(full_path)
581
+ data["ftime"] = data[["survtime", "reltime", "cgvhtime"]].min(axis=1)
582
+ data["status"] = (
583
+ ((data["ftime"] == data["cgvhtime"]) & (data["cgvh"] == "1")).astype(int)
584
+ + 2 * ((data["ftime"] == data["reltime"]) & (data["rcens"] == "1")).astype(int)
585
+ + 3 * ((data["ftime"] == data["survtime"]) & (data["stat"] == "1")).astype(int)
586
+ )
587
+ data = data[["ftime", "status", "dx", "tx", "extent", "age"]]
588
+
589
+ return get_x_y(data, attr_labels=["status", "ftime"], competing_risks=True)
@@ -0,0 +1,46 @@
1
+ % Scrucca L., Santucci A., Aversa F. (2007)
2
+ % Competing risks analysis using R: an easy guide for clinicians.
3
+ % Bone Marrow Transplantation 40, 381-387.
4
+ % https://luca-scr.github.io/R/bmt.csv
5
+ @RELATION BMT
6
+
7
+ @ATTRIBUTE dis {0,1}
8
+ @ATTRIBUTE ftime NUMERIC
9
+ @ATTRIBUTE status {0,1,2}
10
+
11
+ @DATA
12
+ 0,13,2
13
+ 0,1,1
14
+ 0,72,0
15
+ 0,7,2
16
+ 0,8,2
17
+ 1,67,0
18
+ 0,9,2
19
+ 0,5,2
20
+ 1,70,0
21
+ 1,4,0
22
+ 1,7,0
23
+ 1,68,0
24
+ 0,1,2
25
+ 1,10,2
26
+ 1,7,2
27
+ 1,3,1
28
+ 1,4,1
29
+ 1,4,1
30
+ 1,3,1
31
+ 1,3,1
32
+ 0,22,2
33
+ 1,8,1
34
+ 1,2,2
35
+ 0,0,2
36
+ 0,0,1
37
+ 0,35,0
38
+ 1,35,0
39
+ 0,4,2
40
+ 0,14,2
41
+ 0,26,2
42
+ 0,3,2
43
+ 1,2,0
44
+ 1,8,0
45
+ 1,32,0
46
+ 0,12,1
@@ -0,0 +1,118 @@
1
+ @RELATION CGVHD
2
+
3
+ @ATTRIBUTE dx {CML, AML}
4
+ @ATTRIBUTE tx {PB, BM}
5
+ @ATTRIBUTE extent {L, E}
6
+ @ATTRIBUTE agvhdgd NUMERIC
7
+ @ATTRIBUTE age NUMERIC
8
+ @ATTRIBUTE survtime NUMERIC
9
+ @ATTRIBUTE reltime NUMERIC
10
+ @ATTRIBUTE agvhtime NUMERIC
11
+ @ATTRIBUTE cgvhtime NUMERIC
12
+ @ATTRIBUTE stat {0, 1}
13
+ @ATTRIBUTE rcens {0, 1}
14
+ @ATTRIBUTE agvh {1, 0}
15
+ @ATTRIBUTE cgvh {1, 0}
16
+ @ATTRIBUTE stnum NUMERIC
17
+
18
+ @DATA
19
+ CML,PB,L,1,36,4.895,4.895,0.099,0.52,0,0,1,1,1
20
+ AML,PB,L,3,57,3.474,0.753,0.101,0.408,1,1,1,1,2
21
+ CML,PB,L,0,48,4.95,4.95,4.95,0.348,0,0,0,1,3
22
+ AML,PB,L,2,52,4.643,4.643,0.057,0.482,0,0,1,1,4
23
+ AML,PB,L,3,45,4.066,4.066,0.137,0.378,0,0,1,1,5
24
+ AML,PB,L,3,47,1.558,0.416,0.055,1.558,1,1,1,0,6
25
+ CML,PB,L,1,40,4.512,4.512,0.09,0.381,0,0,1,1,7
26
+ AML,PB,L,3,38,4.041,4.041,0.082,0.914,0,0,1,1,8
27
+ AML,PB,L,2,41,4.164,4.164,0.055,0.923,0,0,1,1,9
28
+ CML,PB,L,0,50,4.011,4.011,4.011,0.397,0,0,0,1,10
29
+ CML,PB,L,1,56,3.945,3.945,0.047,0.479,0,0,1,1,11
30
+ CML,PB,L,2,56,4.361,4.361,0.079,0.991,0,0,1,1,12
31
+ AML,PB,L,1,54,0.841,0.654,0.077,0.474,1,1,1,1,13
32
+ CML,PB,L,3,25,2.951,2.951,0.164,0.339,0,0,1,1,14
33
+ CML,PB,L,4,40,0.586,0.586,0.055,0.277,1,0,1,1,15
34
+ CML,PB,L,0,41,3.559,3.559,3.559,0.367,0,0,0,1,16
35
+ CML,PB,L,2,57,3.422,3.422,0.131,0.742,0,0,1,1,17
36
+ CML,PB,L,3,62,0.408,0.408,0.408,0.408,0,0,1,1,18
37
+ CML,PB,L,1,29,3.428,3.428,0.09,0.958,0,0,1,1,19
38
+ AML,PB,L,1,44,0.063,0.063,0.014,0.063,1,0,1,0,20
39
+ CML,PB,L,2,40,1.572,1.572,0.09,0.282,1,0,1,1,21
40
+ CML,PB,L,1,54,1.013,1.013,0.093,0.413,1,0,1,1,22
41
+ AML,PB,L,2,37,3.023,3.023,0.074,0.394,0,0,1,1,23
42
+ AML,PB,L,1,58,2.979,2.979,0.079,0.342,0,0,1,1,24
43
+ CML,PB,L,3,39,2.817,2.817,0.049,0.367,0,0,1,1,25
44
+ CML,PB,L,2,31,2.804,2.804,0.137,0.277,0,0,1,1,26
45
+ CML,PB,L,2,45,2.609,2.609,0.252,0.367,0,0,1,1,27
46
+ AML,PB,L,0,48,2.508,2.508,2.508,0.331,0,0,0,1,28
47
+ CML,PB,L,0,53,0.665,0.665,0.665,0.32,1,0,0,1,29
48
+ CML,PB,L,0,29,2.497,2.497,2.497,0.329,0,0,0,1,30
49
+ CML,PB,L,0,27,1.799,1.799,1.799,0.444,1,0,0,1,31
50
+ AML,PB,L,3,45,0.471,0.438,0.071,0.471,1,1,1,0,32
51
+ CML,PB,L,1,39,2.031,2.031,0.112,0.964,0,0,1,1,33
52
+ CML,PB,L,3,49,2.073,2.073,0.063,0.564,0,0,1,1,34
53
+ AML,PB,L,1,37,0.999,0.75,0.274,0.402,1,1,1,1,35
54
+ AML,PB,L,3,53,0.427,0.427,0.055,0.277,1,0,1,1,36
55
+ CML,PB,L,1,48,1.766,1.766,0.216,0.4,0,0,1,1,37
56
+ AML,PB,L,1,59,1.555,1.555,0.178,0.446,0,0,1,1,38
57
+ CML,PB,L,2,33,1.67,1.67,0.11,0.474,0,0,1,1,39
58
+ CML,PB,L,0,38,1.607,1.607,1.607,0.329,0,0,0,1,40
59
+ CML,PB,L,4,37,1.511,1.511,0.055,0.323,0,0,1,1,41
60
+ AML,PB,L,3,41,1.287,1.287,0.049,0.392,0,0,1,1,42
61
+ AML,PB,E,1,64,1.227,1.227,0.23,0.496,0,0,1,1,43
62
+ CML,PB,L,3,32,1.3,1.3,0.063,0.63,0,0,1,1,44
63
+ CML,PB,L,0,41,1.27,1.27,1.27,0.383,0,0,0,1,45
64
+ AML,PB,E,1,56,1.205,1.205,0.074,1.205,0,0,1,0,46
65
+ CML,PB,L,1,50,1.147,1.147,0.131,0.361,0,0,1,1,47
66
+ CML,PB,L,3,37,1.109,1.109,0.055,0.277,0,0,1,1,48
67
+ CML,PB,L,0,27,0.994,0.994,0.994,0.287,0,0,0,1,49
68
+ CML,BM,L,3,45,4.572,4.572,0.066,0.619,0,0,1,1,50
69
+ AML,BM,L,3,45,4.616,4.616,0.101,0.452,0,0,1,1,51
70
+ AML,BM,L,2,42,4.0,4.0,0.027,0.29,0,0,1,1,52
71
+ CML,BM,L,0,22,4.238,4.238,4.238,0.479,0,0,0,1,53
72
+ AML,BM,L,4,47,0.11,0.11,0.074,0.11,1,0,1,0,54
73
+ AML,BM,L,2,48,4.03,4.03,0.101,0.857,0,0,1,1,55
74
+ AML,BM,L,2,49,3.124,2.527,0.115,1.993,1,1,1,1,56
75
+ CML,BM,L,2,38,0.515,0.515,0.079,0.463,1,0,1,1,57
76
+ CML,BM,L,1,39,4.222,3.149,0.085,0.496,0,1,1,1,58
77
+ CML,BM,L,3,41,4.027,4.027,0.104,0.422,0,0,1,1,59
78
+ CML,BM,L,2,46,1.969,1.969,0.038,0.307,1,0,1,1,60
79
+ AML,BM,L,0,24,3.792,3.792,3.792,0.701,0,0,0,1,61
80
+ AML,BM,L,3,32,0.427,0.427,0.041,0.279,1,0,1,1,62
81
+ CML,BM,L,0,36,3.34,3.34,3.34,0.419,0,0,0,1,63
82
+ CML,BM,L,1,53,3.504,0.72,0.112,0.616,0,1,1,1,64
83
+ CML,BM,L,0,52,3.685,3.685,3.685,0.331,0,0,0,1,65
84
+ CML,BM,L,1,59,0.181,0.181,0.049,0.181,1,0,1,0,66
85
+ CML,BM,L,3,42,0.736,0.736,0.09,0.567,1,0,1,1,67
86
+ CML,BM,L,1,65,0.287,0.287,0.052,0.287,1,0,1,0,68
87
+ CML,BM,E,0,60,0.057,0.057,0.057,0.057,0,0,0,0,69
88
+ CML,BM,L,2,61,3.107,3.107,0.088,0.764,0,0,1,1,70
89
+ CML,BM,L,1,55,3.088,3.088,0.11,0.381,0,0,1,1,71
90
+ AML,BM,E,0,48,0.446,0.274,0.446,0.446,1,1,0,0,72
91
+ AML,BM,E,0,49,2.776,2.776,2.776,2.776,0,0,0,0,73
92
+ CML,BM,L,0,36,0.693,0.172,0.693,0.635,1,1,0,1,74
93
+ AML,BM,L,1,48,2.01,2.01,0.077,0.553,0,0,1,1,75
94
+ CML,BM,L,0,47,2.374,2.374,2.374,0.287,0,0,0,1,76
95
+ AML,BM,L,3,43,1.079,1.079,0.088,0.345,1,0,1,1,77
96
+ CML,BM,L,0,56,2.604,2.604,2.604,0.375,0,0,0,1,78
97
+ CML,BM,L,1,56,2.478,2.478,0.17,0.517,0,0,1,1,79
98
+ CML,BM,L,0,36,2.338,2.338,2.338,0.457,0,0,0,1,80
99
+ CML,BM,L,2,52,2.3,2.3,0.049,0.345,0,0,1,1,81
100
+ CML,BM,E,1,44,0.219,0.219,0.145,0.219,1,0,1,0,82
101
+ AML,BM,L,3,32,2.127,2.127,0.118,0.422,0,0,1,1,83
102
+ AML,BM,L,1,44,2.034,2.034,0.096,0.479,0,0,1,1,84
103
+ CML,BM,L,0,45,2.034,2.034,2.034,0.29,0,0,0,1,85
104
+ AML,BM,L,3,48,2.007,2.007,0.088,0.35,0,0,1,1,86
105
+ CML,BM,L,0,48,1.183,1.183,1.183,0.372,0,0,0,1,87
106
+ AML,BM,L,3,42,0.375,0.375,0.096,0.277,1,0,1,1,88
107
+ AML,BM,E,2,24,0.353,0.301,0.096,0.353,1,1,1,0,89
108
+ CML,BM,L,2,26,1.566,1.566,0.137,0.474,0,0,1,1,90
109
+ CML,BM,L,2,34,1.588,1.588,0.129,0.465,0,0,1,1,91
110
+ CML,BM,L,0,57,1.243,1.243,1.243,0.433,0,0,0,1,92
111
+ CML,BM,L,3,51,1.555,1.555,0.09,0.359,0,0,1,1,93
112
+ AML,BM,L,2,54,1.202,1.202,0.192,1.202,0,0,1,0,94
113
+ AML,BM,E,0,20,1.251,1.251,1.251,0.408,0,0,0,1,95
114
+ AML,BM,L,2,39,1.114,1.114,0.074,0.402,0,0,1,1,96
115
+ AML,BM,L,0,49,1.15,1.15,1.15,0.35,0,0,0,1,97
116
+ CML,BM,L,1,42,0.997,0.997,0.142,0.411,0,0,1,1,98
117
+ CML,BM,L,0,44,1.057,1.057,1.057,0.301,0,0,0,1,99
118
+ CML,BM,L,1,56,1.125,1.125,0.129,0.32,0,0,1,1,100