Dataset Viewer
Auto-converted to Parquet
ID
int64
1
418
N_Days
int64
41
4.8k
Status
stringclasses
3 values
Drug
stringclasses
2 values
Age
int64
7.68k
26.5k
Sex
stringclasses
2 values
Ascites
stringclasses
2 values
Hepatomegaly
stringclasses
2 values
Spiders
stringclasses
2 values
Edema
stringclasses
3 values
Bilirubin
float64
0.38
33.5
Cholesterol
float64
120
1.78k
Albumin
float64
1.83
4.45
Copper
float64
4
588
Alk_Phos
float64
373
18.4k
SGOT
float64
32.6
767
Tryglicerides
float64
33
598
Platelets
float64
48.2
538
Prothrombin
float64
9.41
20
Stage
int64
1
4
1
400
D
D-penicillamine
19,274
F
Y
Y
Y
Y
17.484609
261
2.354231
156
2,399.489447
187.975332
172
200.828234
13.219344
4
2
4,500
C
D-penicillamine
18,891
M
N
Y
Y
N
1.238074
302
3.943873
54
9,857.692412
153.169455
88
146.783522
11.85043
3
3
1,012
D
D-penicillamine
23,294
M
N
Y
N
Y
1.442406
176
3.03232
210
755.111726
128.832591
55
99.706295
12.475093
2
4
1,925
D
D-penicillamine
17,055
F
N
Y
Y
N
2.043798
244
2.07434
64
9,032.578493
84.237979
92
152.59818
11.200436
2
5
1,504
CL
Placebo
12,262
F
N
Y
Y
N
4.990557
279
3.298827
143
990.984587
159.354589
72
125.183572
12.161391
3
6
2,503
D
Placebo
22,545
F
N
Y
N
N
0.921148
248
3.072885
50
1,180.741652
125.364232
63
null
13.110955
4
7
1,832
C
Placebo
17,304
F
Y
Y
N
N
1.004061
322
3.531406
52
959.628887
82.46126
213
130.123559
10.103746
4
8
2,466
D
Placebo
16,992
F
N
N
N
N
0.381979
280
3.395361
52
5,789.259252
39.500638
189
314.578846
12.386304
4
9
2,400
D
D-penicillamine
14,042
F
N
N
Y
N
4.113747
562
2.61339
79
3,118.948832
199.180443
88
216.232519
12.446582
3
10
51
D
Placebo
23,549
M
Y
N
Y
S
16.742029
200
2.363383
140
1,208.010791
206.607594
143
295.315385
11.570887
3
11
3,762
D
Placebo
18,131
M
N
Y
Y
N
1.745937
259
3.997214
46
1,412.404499
105.320917
79
223.349235
13.446319
2
12
304
D
Placebo
20,113
M
N
N
Y
N
4.624417
236
3.312418
94
801.424451
123.262731
95
62.679269
15.558594
3
13
3,577
C
Placebo
14,684
F
N
N
N
N
0.968815
281
3.416542
40
1,361.59792
124.545477
130
188.803658
11.971986
3
14
1,217
D
Placebo
20,106
M
Y
Y
N
S
0.900362
null
2.171666
43
956.677125
95.822688
null
162.887468
12.05384
2
15
3,584
D
D-penicillamine
23,045
F
N
N
N
N
0.884492
231
3.277446
173
12,720.447969
183.192131
96
224.254811
12.283282
3
16
3,672
C
Placebo
13,356
F
N
Y
N
N
0.763379
204
3.074714
28
928.128122
101.448225
58
146.283942
11.971716
3
17
769
D
Placebo
17,973
F
N
Y
N
N
3.168242
274
2.971016
159
2,098.954446
144.495526
128
219.733134
10.663035
4
18
131
D
D-penicillamine
17,642
M
N
Y
Y
N
15.314102
178
2.60115
588
1,402.807525
402.335428
200
184.679085
13.759859
4
19
4,232
C
D-penicillamine
16,939
F
N
Y
N
N
0.876965
235
3.122073
39
2,432.858448
120.718592
123
128.589165
11.898111
4
20
1,356
D
Placebo
21,103
M
N
Y
Y
N
6.369233
374
2.959727
140
2,369.37171
182.872068
135
261.449733
13.841866
4
21
3,445
C
Placebo
20,548
M
N
Y
Y
N
0.610842
252
3.726539
41
1,196.176118
89.56621
83
268.741653
13.956433
3
22
673
D
D-penicillamine
18,893
M
N
N
Y
S
3.844316
271
2.954801
464
1,949.946199
178.69105
55
134.457538
13.486517
4
23
264
D
Placebo
18,566
M
Y
Y
Y
N
17.685956
395
2.558031
558
8,222.832735
303.547518
191
192.470097
12.197149
4
24
4,079
D
D-penicillamine
15,475
M
N
Y
N
N
2.765962
456
3.645715
124
7,342.983825
312.183591
230
49.642557
11.061585
2
25
4,127
C
Placebo
15,034
F
Y
Y
N
N
0.950995
298
4.059444
40
859.391195
162.673554
66
261.279015
13.253784
3
26
1,444
D
Placebo
17,094
F
N
Y
Y
Y
6.645375
1,128
3.38249
53
3,784.257691
227.728361
166
321.639539
10.149381
4
27
77
D
Placebo
18,898
M
Y
Y
Y
N
23.788542
175
3.05849
221
5,218.12085
136.652983
168
56.870252
13.24619
3
28
549
D
Placebo
14,316
M
Y
Y
Y
S
23.189079
222
2.815045
209
2,780.336134
277.126818
195
114.309503
14.380647
3
29
4,509
C
Placebo
21,943
F
N
N
N
N
0.822272
370
3.509443
24
6,817.795452
107.61602
86
345.251236
10.984519
3
30
321
D
Placebo
13,502
F
N
Y
Y
N
3.882795
260
2.299374
172
10,091.475867
163.109868
158
125.495045
12.308753
2
31
3,839
D
Placebo
13,790
M
N
Y
N
N
5.18673
296
2.822784
114
13,314.562256
247.980085
101
167.29867
11.904867
3
32
4,523
C
Placebo
16,542
F
N
Y
Y
Y
2.082572
262
3.13842
101
8,716.40944
110.54765
158
156.990119
12.459265
3
33
3,170
D
Placebo
16,914
M
N
N
N
N
0.963966
210
3.025778
82
1,877.604768
320.773692
113
143.313478
13.050382
2
34
3,933
C
D-penicillamine
17,961
F
Y
N
N
S
0.947092
364
3.478623
37
2,460.722762
225.485667
64
219.759616
12.863364
2
35
2,847
D
Placebo
15,330
M
N
N
N
S
1.27048
314
2.885332
201
15,448.902481
101.056985
151
385.150608
10.569278
4
36
3,611
C
Placebo
19,669
M
N
N
N
N
0.396399
172
2.888928
18
826.953146
95.132132
96
254.5476
11.848795
3
37
223
D
D-penicillamine
20,567
F
Y
Y
N
N
8.41307
334
2.361468
150
9,670.824999
217.945061
118
94.381507
12.352623
3
38
3,244
D
Placebo
12,983
F
N
Y
Y
N
3.724461
383
3.20472
102
1,662.653733
183.811737
87
196.365092
12.1496
3
39
2,297
D
D-penicillamine
19,375
M
N
Y
N
N
0.917721
282
2.862291
52
12,261.105271
105.998706
111
538.160331
11.383389
4
40
4,467
C
D-penicillamine
15,075
M
N
Y
N
S
1.406157
null
3.172254
105
15,830.735739
121.519232
null
270.692896
12.378783
3
41
1,350
D
D-penicillamine
9,919
M
N
Y
N
Y
7.052355
null
3.06702
96
1,682.351948
216.490422
null
184.062162
12.795775
3
42
4,453
C
Placebo
10,355
M
N
Y
Y
N
2.787222
null
3.172865
122
11,850.09498
72.731871
null
303.636469
11.645709
4
43
4,556
C
D-penicillamine
16,108
F
N
N
N
N
1.528053
361
3.473918
36
6,526.958576
97.993429
89
150.78446
11.257046
4
44
3,428
D
Placebo
12,120
M
N
Y
Y
S
3.807508
299
3.359039
131
1,652.774343
175.615396
50
143.478745
14.000489
2
45
4,025
C
Placebo
14,518
M
Y
Y
N
N
0.717242
null
3.453953
19
2,172.358829
98.594011
null
349.36871
12.23172
4
46
2,256
D
D-penicillamine
15,427
F
N
Y
Y
S
6.186401
482
2.652077
161
14,656.55063
189.115958
165
375.590631
12.889148
3
47
2,576
C
Placebo
15,833
F
N
Y
N
N
0.600275
316
3.187187
68
1,946.848628
247.446668
71
303.403204
11.049886
3
48
4,427
C
Placebo
15,348
M
N
N
N
N
2.189616
259
3.429904
281
14,076.01767
238.333282
178
131.935108
11.992928
2
49
708
D
Placebo
20,258
F
N
Y
N
N
0.95183
null
3.189869
58
891.645288
153.291877
null
150.145898
12.102531
2
50
2,598
D
D-penicillamine
19,005
M
N
Y
N
N
1.365018
257
2.818668
43
1,486.649855
140.478061
73
126.243155
12.094541
4
51
3,853
D
Placebo
16,962
F
N
Y
Y
N
0.872148
276
3.430477
54
4,878.236769
154.634919
143
198.60486
12.28711
3
52
2,386
D
D-penicillamine
16,915
M
N
N
N
N
6.982913
614
3.503449
158
7,175.565758
271.219919
93
296.840538
11.204829
3
53
1,000
D
D-penicillamine
23,289
F
N
Y
N
N
2.651017
null
2.88821
94
7,871.763556
82.444981
null
139.332267
12.083642
4
54
1,434
D
D-penicillamine
12,043
F
Y
Y
Y
S
1.513852
288
3.074955
262
7,051.597867
94.575704
125
205.590756
11.799639
4
55
1,360
D
D-penicillamine
21,440
M
N
N
N
S
2.143182
416
3.074919
121
14,161.442195
116.158113
219
155.085158
12.428274
2
56
1,847
D
Placebo
9,772
M
N
Y
Y
N
1.345188
498
3.405774
88
18,383.298328
130.535943
319
234.947233
11.536879
4
57
3,282
D
D-penicillamine
18,353
M
N
Y
Y
N
2.815103
260
2.934215
231
15,092.025613
144.786204
94
201.677481
13.658136
2
58
4,459
C
D-penicillamine
14,678
M
N
Y
N
N
0.903275
242
3.562914
73
8,127.716325
82.926492
118
null
11.516753
4
59
2,224
D
D-penicillamine
12,685
F
N
Y
Y
N
0.836827
329
3.025314
49
10,236.498529
171.057115
124
253.353911
11.603757
4
60
4,365
C
D-penicillamine
18,785
M
Y
N
N
N
0.946235
604
3.305551
82
1,108.918948
89.637301
58
205.186754
12.207895
4
61
4,256
C
Placebo
14,557
M
N
N
N
N
0.751737
216
3.534123
28
771.295205
89.232092
188
208.959476
15.853998
2
62
3,090
D
Placebo
20,482
F
Y
Y
N
N
1.294935
302
2.537534
58
2,012.169123
55.786791
112
288.009098
14.768881
2
63
859
D
Placebo
16,012
F
N
N
Y
N
27.412425
932
2.928765
95
6,531.557932
355.509508
133
139.914716
12.702018
3
64
1,487
D
Placebo
22,024
M
N
Y
N
N
2.272138
373
2.974749
52
1,412.197274
225.119003
188
145.941305
11.2224
3
65
3,992
C
D-penicillamine
12,264
F
N
N
N
N
1.628738
256
3.274777
74
962.098545
192.173659
108
371.928387
10.619791
3
66
4,191
D
D-penicillamine
14,150
M
N
Y
N
Y
1.715063
427
3.574134
105
2,495.97479
277.685234
171
93.923791
12.030295
4
67
2,769
D
Placebo
16,959
M
Y
Y
N
N
1.295893
466
3.874658
84
2,536.199135
475.871413
185
201.579804
10.642468
3
68
4,039
C
D-penicillamine
9,352
M
N
N
N
N
0.92594
174
3.689167
58
826.888704
94.858508
46
171.553095
11.336753
3
69
1,170
D
D-penicillamine
15,930
F
N
Y
Y
N
21.873196
652
3.072836
159
4,219.547008
331.823788
184
170.843267
14.616741
4
70
3,458
C
D-penicillamine
19,245
M
N
N
N
N
0.667595
null
4.238414
20
833.523724
69.75643
null
202.306309
11.675259
3
71
4,196
C
Placebo
15,750
F
N
Y
N
S
1.288625
258
3.256489
79
2,936.809049
164.705692
76
328.007653
12.717972
4
72
4,184
C
Placebo
8,918
M
N
N
N
N
0.556748
320
3.431456
51
1,654.240348
168.903675
80
205.88867
10.662905
2
73
4,190
C
Placebo
12,259
M
N
Y
N
Y
0.844278
132
3.060649
17
521.716178
72.44191
56
181.984411
12.74765
3
74
1,827
D
D-penicillamine
15,994
F
N
Y
Y
N
10.49492
558
3.535165
280
1,239.916992
135.887745
309
243.505162
11.983082
2
75
1,191
D
D-penicillamine
15,982
M
Y
Y
Y
N
22.164031
674
2.135682
207
2,564.334649
275.315558
598
235.620144
12.350503
2
76
71
D
D-penicillamine
16,545
F
N
Y
Y
S
12.413837
394
2.616137
111
2,621.322046
220.468099
243
144.965898
11.843165
4
77
326
D
Placebo
16,309
F
N
Y
Y
N
7.80657
244
3.133206
199
2,050.031584
233.921412
91
94.950948
13.273033
2
78
1,690
D
D-penicillamine
15,904
F
Y
Y
N
N
6.861856
436
2.840289
75
2,778.553929
207.566969
104
148.852714
11.367409
3
79
3,707
C
D-penicillamine
15,096
F
N
Y
Y
N
0.943577
315
3.678329
13
1,849.447688
216.293813
70
364.64324
12.908096
3
80
890
D
Placebo
24,247
M
N
Y
N
N
10.320598
247
3.49161
269
1,633.595116
278.596802
91
294.751396
13.352583
3
81
2,540
D
D-penicillamine
21,441
F
N
Y
Y
S
17.700281
448
3.487863
34
1,508.773792
73.530945
318
346.6685
12.147361
4
82
3,574
D
D-penicillamine
22,497
M
N
Y
N
N
5.804759
472
4.076647
154
2,220.199419
155.6787
272
300.737883
11.587205
2
83
2,278
D
D-penicillamine
17,553
M
N
Y
N
N
1.81489
250
3.162206
48
1,363.900419
107.981043
100
70.956959
14.011774
4
84
4,032
C
Placebo
18,944
F
N
N
N
N
0.525094
263
3.263724
29
1,646.120431
196.022995
74
163.884859
11.863019
4
85
3,358
D
Placebo
16,010
M
N
Y
N
N
2.425938
262
2.95757
58
2,580.478314
134.203125
84
177.855531
12.775015
3
86
1,657
D
D-penicillamine
17,810
F
N
Y
Y
N
5.362084
1,600
2.712162
75
3,298.713846
119.469335
174
152.346424
11.81199
4
87
198
D
D-penicillamine
11,121
M
N
N
N
N
1.316684
345
4.234952
75
2,672.681392
338.087726
72
374.673901
11.920085
2
88
2,452
C
Placebo
13,052
M
N
N
N
N
0.685938
296
3.346436
37
1,224.099847
115.221144
83
317.291047
13.809656
3
89
1,741
D
D-penicillamine
17,715
F
N
Y
N
S
2.095096
408
3.507239
50
1,366.810493
161.371242
98
170.621932
11.933394
3
90
2,689
D
D-penicillamine
10,025
M
N
N
N
N
1.958548
660
3.614759
94
2,475.764517
201.658695
155
324.278194
12.647366
4
91
460
D
Placebo
14,760
M
N
Y
Y
N
6.132943
325
3.004117
110
3,414.771102
359.480176
56
344.954769
12.656452
4
92
388
D
D-penicillamine
25,484
M
Y
N
Y
S
1.927676
206
2.793282
36
2,051.972723
118.081625
70
94.816588
14.730575
3
93
3,913
C
D-penicillamine
12,030
F
N
Y
N
N
1.512971
353
3.173879
73
2,259.599491
314.965289
68
277.885392
13.109642
4
94
750
D
D-penicillamine
18,106
M
N
Y
Y
N
3.929639
201
2.943923
178
1,557.407368
237.794261
69
116.946726
12.913283
2
95
130
D
Placebo
15,404
F
Y
Y
Y
N
19.722055
null
2.615361
182
802.278392
177.850875
null
372.539471
12.306304
3
96
3,850
C
D-penicillamine
17,083
M
N
Y
N
N
1.287317
null
3.208375
33
1,670.899176
155.629346
null
296.226759
10.83947
3
97
611
D
Placebo
24,216
M
N
Y
N
N
2.375076
420
2.863545
62
4,230.359149
121.08029
91
257.952897
13.037968
4
98
2,956
D
D-penicillamine
8,533
M
N
Y
N
Y
1.082741
239
3.362214
77
2,240.571523
145.667583
101
205.35653
11.204495
4
99
3,820
C
Placebo
15,873
M
N
Y
N
N
2.157575
460
3.105627
148
1,742.013142
133.233165
118
123.267327
11.692702
3
100
552
D
Placebo
17,144
M
N
Y
Y
N
2.84982
178
2.676977
145
971.145907
282.128414
122
87.604504
14.522537
2
End of preview. Expand in Data Studio

This dataset contains clinical information about patients with primary biliary cholangitis (PBC). The data includes laboratory values, clinical features, and survival information for patients with this chronic liver disease.

Dataset Summary

  • Total Samples: 418
  • Features: 20
  • Task: Survival analysis and prediction of disease progression
  • Format: CSV/Parquet

Features

Patient Information

  • ID: Patient identifier (integer)
  • N_Days: Number of days between registration and the earliest of death, transplantion, or study analysis time (integer)
  • Status: Patient status at last follow-up (C=censored, D=dead, CL=lost to follow-up) (categorical)
  • Drug: Drug treatment (D-penicillamine or Placebo) (categorical)
  • Age: Age in days (integer)
  • Sex: Sex (M=male, F=female) (categorical)

Clinical Features

  • Ascites: Presence of ascites (Y/N) (binary)
  • Hepatomegaly: Presence of hepatomegaly (Y/N) (binary)
  • Spiders: Presence of spider angiomata (Y/N) (binary)
  • Edema: Presence of edema (N=none, S=edema without diuretics, Y=edema despite diuretics) (categorical)
  • Stage: Histologic stage of disease (1-4) (ordinal)

Laboratory Values

  • Bilirubin: Serum bilirubin (mg/dl) (continuous)
  • Cholesterol: Serum cholesterol (mg/dl) (continuous)
  • Albumin: Serum albumin (g/dl) (continuous)
  • Copper: Urine copper (μg/day) (continuous)
  • Alk_Phos: Alkaline phosphatase (U/liter) (continuous)
  • SGOT: Serum glutamic-oxaloacetic transaminase (U/ml) (continuous)
  • Tryglicerides: Triglycerides (mg/dl) (continuous)
  • Platelets: Platelet count (continuous)
  • Prothrombin: Prothrombin time (seconds) (continuous)

Dataset Statistics

Status Distribution

  • C: 53.8%
  • CL: 6.0%
  • D: 40.2%

Sex Distribution

  • M: 59.8%
  • F: 40.2%

Age Statistics (years)

  • Range: 21.0 - 72.5 years
  • Mean ± SD: 45.7 ± 10.4 years
  • Median: 46.1 years

Disease Stage Distribution

  • Stage 1: 1.7%
  • Stage 2: 18.7%
  • Stage 3: 39.2%
  • Stage 4: 40.4%

Clinical Features Prevalence

  • Ascites: 80.7% absent19.3% present,
  • Hepatomegaly: 71.4% present, 28.6% absent
  • Spiders: 56.0% absent44.0% present,
  • Edema: 70.8% none, 19.9% without diuretics, 9.3% with diuretics

Laboratory Values Summary Statistics

Feature Mean ± SD Min 25% 50% 75% Max
Bilirubin 3.8 ± 5.2 0.4 0.9 1.6 4.1 33.5
Cholesterol 369.5 ± 231.9 120.0 249.5 309.5 400.0 1775.0
Albumin 3.2 ± 0.4 1.8 2.9 3.2 3.4 4.5
Copper 97.6 ± 85.6 4.0 41.2 73.0 123.0 588.0
Alk_Phos 2585.9 ± 2858.6 372.6 1136.8 1649.4 2600.8 18383.3
SGOT 172.4 ± 83.9 32.6 114.9 155.9 212.3 766.6
Tryglicerides 124.7 ± 65.1 33.0 84.2 108.0 151.0 598.0
Platelets 205.8 ± 83.2 48.2 143.4 200.8 252.4 538.2
Prothrombin 11.8 ± 1.3 9.4 10.9 11.6 12.3 20.0

Usage

Loading the Dataset

import pandas as pd

# Load the dataset
df = pd.read_csv('cirrhosis_african_adjusted.csv')

# Display basic information
print(f"Dataset shape: {df.shape}")
print(f"Columns: {list(df.columns)}")

Survival Analysis Example

import pandas as pd
import matplotlib.pyplot as plt
from lifelines import KaplanMeierFitter

# Load the dataset
df = pd.read_csv('cirrhosis_african_adjusted.csv')

# Create Kaplan-Meier survival curves by treatment group
kmf = KaplanMeierFitter()
plt.figure(figsize=(10, 6))

for name, group in df.groupby('Drug'):
    # Skip if group is empty or has too few samples
    if len(group) > 0:
        kmf.fit(
            durations=group['N_Days'],
            event_observed=(group['Status'] == 'D').astype(int),
            label=name
        )
        kmf.plot_survival_function()

plt.title('Kaplan-Meier Survival Curves by Treatment')
plt.xlabel('Days')
plt.ylabel('Survival Probability')
plt.grid(True)

Predictive Modeling Example

import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score, classification_report

# Load and preprocess the data
df = pd.read_csv('cirrhosis_african_adjusted.csv')

# Create binary target (alive vs. dead)
df['Survived'] = (df['Status'] != 'D').astype(int)

# Select features
features = ['Age', 'Sex', 'Bilirubin', 'Albumin', 'Stage', 'Prothrombin']
X = pd.get_dummies(df[features], drop_first=True)
y = df['Survived']

# Split the data
X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.2, random_state=42, stratify=y
)

# Train a model
model = RandomForestClassifier(random_state=42)
model.fit(X_train, y_train)

# Evaluate
y_pred = model.predict(X_test)
print(f"Accuracy: {accuracy_score(y_test, y_pred):.3f}")
print("\nClassification Report:")
print(classification_report(y_test, y_pred))
Downloads last month
9

Collection including electricsheepafrica/Africa-Cirrhosis-prediction-Dataset