mstz commited on
Commit
e0f7bbf
·
1 Parent(s): 562ef45

Update arhythmia.py

Browse files
Files changed (1) hide show
  1. arhythmia.py +286 -0
arhythmia.py CHANGED
@@ -305,6 +305,288 @@ features_types_per_config = {
305
  "qrsa_on_V6": datasets.Value("float64"),
306
  "qrsta_on_V6": datasets.Value("float64"),
307
  "type_of_arhythmia": datasets.ClassLabel(num_classes=13, names=["no_arhythmia"] + [f"arhythmia_of_type_{f}" for f in range(11)] + ["unknown_arhythmia"])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  }
309
  }
310
  features_per_config = {k: datasets.Features(features_types_per_config[k]) for k in features_types_per_config}
@@ -371,4 +653,8 @@ class Arhythmia(datasets.GeneratorBasedBuilder):
371
  }
372
  data.loc[:, "type_of_arhythmia"] = data["type_of_arhythmia"].apply(lambda x: label_encoding[x])
373
 
 
 
 
 
374
  return data[list(features_types_per_config[config].keys())]
 
305
  "qrsa_on_V6": datasets.Value("float64"),
306
  "qrsta_on_V6": datasets.Value("float64"),
307
  "type_of_arhythmia": datasets.ClassLabel(num_classes=13, names=["no_arhythmia"] + [f"arhythmia_of_type_{f}" for f in range(11)] + ["unknown_arhythmia"])
308
+ },
309
+ "has_arhythmia": {
310
+ "age": datasets.Value("int8"),
311
+ "is_female": datasets.Value("bool"),
312
+ "height": datasets.Value("float64"),
313
+ "weight": datasets.Value("float64"),
314
+ "qrs_duration": datasets.Value("float64"),
315
+ "p_r_interval": datasets.Value("float64"),
316
+ "q_t_interval": datasets.Value("float64"),
317
+ "t_interval": datasets.Value("float64"),
318
+ "p_interval": datasets.Value("float64"),
319
+ "qrs": datasets.Value("float64"),
320
+ "t": datasets.Value("float64"),
321
+ "p": datasets.Value("float64"),
322
+ "qrst": datasets.Value("float64"),
323
+ "j": datasets.Value("float64"),
324
+ "heart_rate": datasets.Value("float64"),
325
+ "average_witdth_of_wave_q_on_DI": datasets.Value("float64"),
326
+ "average_witdth_of_wave_r_on_DI": datasets.Value("float64"),
327
+ "average_witdth_of_wave_s_on_DI": datasets.Value("float64"),
328
+ "average_witdth_of_wave_rprime_on_DI": datasets.Value("float64"),
329
+ "average_witdth_of_wave_sprime_on_DI": datasets.Value("float64"),
330
+ "number_of_deflections_on_DI": datasets.Value("float64"),
331
+ "type_of_ragged_r_wave_on_DI": datasets.Value("float64"),
332
+ "type_of_diphasic_derivation_of_r_wave_on_DI": datasets.Value("float64"),
333
+ "type_of_ragged_p_wave_on_DI": datasets.Value("float64"),
334
+ "type_of_diphasic_derivation_of_p_wave_on_DI": datasets.Value("float64"),
335
+ "type_of_ragged_t_wave_on_DI": datasets.Value("float64"),
336
+ "type_of_diphasic_derivation_of_t_wave_on_DI": datasets.Value("float64"),
337
+ "average_witdth_of_wave_q_on_DII": datasets.Value("float64"),
338
+ "average_witdth_of_wave_r_on_DII": datasets.Value("float64"),
339
+ "average_witdth_of_wave_s_on_DII": datasets.Value("float64"),
340
+ "average_witdth_of_wave_rprime_on_DII": datasets.Value("float64"),
341
+ "average_witdth_of_wave_sprime_on_DII": datasets.Value("float64"),
342
+ "number_of_deflections_on_DII": datasets.Value("float64"),
343
+ "type_of_ragged_r_wave_on_DII": datasets.Value("float64"),
344
+ "type_of_diphasic_derivation_of_r_wave_on_DII": datasets.Value("float64"),
345
+ "type_of_ragged_p_wave_on_DII": datasets.Value("float64"),
346
+ "type_of_diphasic_derivation_of_p_wave_on_DII": datasets.Value("float64"),
347
+ "type_of_ragged_t_wave_on_DII": datasets.Value("float64"),
348
+ "type_of_diphasic_derivation_of_t_wave_on_DII": datasets.Value("float64"),
349
+ "average_witdth_of_wave_q_on_DIII": datasets.Value("float64"),
350
+ "average_witdth_of_wave_r_on_DIII": datasets.Value("float64"),
351
+ "average_witdth_of_wave_s_on_DIII": datasets.Value("float64"),
352
+ "average_witdth_of_wave_rprime_on_DIII": datasets.Value("float64"),
353
+ "average_witdth_of_wave_sprime_on_DIII": datasets.Value("float64"),
354
+ "number_of_deflections_on_DIII": datasets.Value("float64"),
355
+ "type_of_ragged_r_wave_on_DIII": datasets.Value("float64"),
356
+ "type_of_diphasic_derivation_of_r_wave_on_DIII": datasets.Value("float64"),
357
+ "type_of_ragged_p_wave_on_DIII": datasets.Value("float64"),
358
+ "type_of_diphasic_derivation_of_p_wave_on_DIII": datasets.Value("float64"),
359
+ "type_of_ragged_t_wave_on_DIII": datasets.Value("float64"),
360
+ "type_of_diphasic_derivation_of_t_wave_on_DIII": datasets.Value("float64"),
361
+ "average_witdth_of_wave_q_on_AVR": datasets.Value("float64"),
362
+ "average_witdth_of_wave_r_on_AVR": datasets.Value("float64"),
363
+ "average_witdth_of_wave_s_on_AVR": datasets.Value("float64"),
364
+ "average_witdth_of_wave_rprime_on_AVR": datasets.Value("float64"),
365
+ "average_witdth_of_wave_sprime_on_AVR": datasets.Value("float64"),
366
+ "number_of_deflections_on_AVR": datasets.Value("float64"),
367
+ "type_of_ragged_r_wave_on_AVR": datasets.Value("float64"),
368
+ "type_of_diphasic_derivation_of_r_wave_on_AVR": datasets.Value("float64"),
369
+ "type_of_ragged_p_wave_on_AVR": datasets.Value("float64"),
370
+ "type_of_diphasic_derivation_of_p_wave_on_AVR": datasets.Value("float64"),
371
+ "type_of_ragged_t_wave_on_AVR": datasets.Value("float64"),
372
+ "type_of_diphasic_derivation_of_t_wave_on_AVR": datasets.Value("float64"),
373
+ "average_witdth_of_wave_q_on_AVL": datasets.Value("float64"),
374
+ "average_witdth_of_wave_r_on_AVL": datasets.Value("float64"),
375
+ "average_witdth_of_wave_s_on_AVL": datasets.Value("float64"),
376
+ "average_witdth_of_wave_rprime_on_AVL": datasets.Value("float64"),
377
+ "average_witdth_of_wave_sprime_on_AVL": datasets.Value("float64"),
378
+ "number_of_deflections_on_AVL": datasets.Value("float64"),
379
+ "type_of_ragged_r_wave_on_AVL": datasets.Value("float64"),
380
+ "type_of_diphasic_derivation_of_r_wave_on_AVL": datasets.Value("float64"),
381
+ "type_of_ragged_p_wave_on_AVL": datasets.Value("float64"),
382
+ "type_of_diphasic_derivation_of_p_wave_on_AVL": datasets.Value("float64"),
383
+ "type_of_ragged_t_wave_on_AVL": datasets.Value("float64"),
384
+ "type_of_diphasic_derivation_of_t_wave_on_AVL": datasets.Value("float64"),
385
+ "average_witdth_of_wave_q_on_AVF": datasets.Value("float64"),
386
+ "average_witdth_of_wave_r_on_AVF": datasets.Value("float64"),
387
+ "average_witdth_of_wave_s_on_AVF": datasets.Value("float64"),
388
+ "average_witdth_of_wave_rprime_on_AVF": datasets.Value("float64"),
389
+ "average_witdth_of_wave_sprime_on_AVF": datasets.Value("float64"),
390
+ "number_of_deflections_on_AVF": datasets.Value("float64"),
391
+ "type_of_ragged_r_wave_on_AVF": datasets.Value("float64"),
392
+ "type_of_diphasic_derivation_of_r_wave_on_AVF": datasets.Value("float64"),
393
+ "type_of_ragged_p_wave_on_AVF": datasets.Value("float64"),
394
+ "type_of_diphasic_derivation_of_p_wave_on_AVF": datasets.Value("float64"),
395
+ "type_of_ragged_t_wave_on_AVF": datasets.Value("float64"),
396
+ "type_of_diphasic_derivation_of_t_wave_on_AVF": datasets.Value("float64"),
397
+ "average_witdth_of_wave_q_on_V1": datasets.Value("float64"),
398
+ "average_witdth_of_wave_r_on_V1": datasets.Value("float64"),
399
+ "average_witdth_of_wave_s_on_V1": datasets.Value("float64"),
400
+ "average_witdth_of_wave_rprime_on_V1": datasets.Value("float64"),
401
+ "average_witdth_of_wave_sprime_on_V1": datasets.Value("float64"),
402
+ "number_of_deflections_on_V1": datasets.Value("float64"),
403
+ "type_of_ragged_r_wave_on_V1": datasets.Value("float64"),
404
+ "type_of_diphasic_derivation_of_r_wave_on_V1": datasets.Value("float64"),
405
+ "type_of_ragged_p_wave_on_V1": datasets.Value("float64"),
406
+ "type_of_diphasic_derivation_of_p_wave_on_V1": datasets.Value("float64"),
407
+ "type_of_ragged_t_wave_on_V1": datasets.Value("float64"),
408
+ "type_of_diphasic_derivation_of_t_wave_on_V1": datasets.Value("float64"),
409
+ "average_witdth_of_wave_q_on_V2": datasets.Value("float64"),
410
+ "average_witdth_of_wave_r_on_V2": datasets.Value("float64"),
411
+ "average_witdth_of_wave_s_on_V2": datasets.Value("float64"),
412
+ "average_witdth_of_wave_rprime_on_V2": datasets.Value("float64"),
413
+ "average_witdth_of_wave_sprime_on_V2": datasets.Value("float64"),
414
+ "number_of_deflections_on_V2": datasets.Value("float64"),
415
+ "type_of_ragged_r_wave_on_V2": datasets.Value("float64"),
416
+ "type_of_diphasic_derivation_of_r_wave_on_V2": datasets.Value("float64"),
417
+ "type_of_ragged_p_wave_on_V2": datasets.Value("float64"),
418
+ "type_of_diphasic_derivation_of_p_wave_on_V2": datasets.Value("float64"),
419
+ "type_of_ragged_t_wave_on_V2": datasets.Value("float64"),
420
+ "type_of_diphasic_derivation_of_t_wave_on_V2": datasets.Value("float64"),
421
+ "average_witdth_of_wave_q_on_V3": datasets.Value("float64"),
422
+ "average_witdth_of_wave_r_on_V3": datasets.Value("float64"),
423
+ "average_witdth_of_wave_s_on_V3": datasets.Value("float64"),
424
+ "average_witdth_of_wave_rprime_on_V3": datasets.Value("float64"),
425
+ "average_witdth_of_wave_sprime_on_V3": datasets.Value("float64"),
426
+ "number_of_deflections_on_V3": datasets.Value("float64"),
427
+ "type_of_ragged_r_wave_on_V3": datasets.Value("float64"),
428
+ "type_of_diphasic_derivation_of_r_wave_on_V3": datasets.Value("float64"),
429
+ "type_of_ragged_p_wave_on_V3": datasets.Value("float64"),
430
+ "type_of_diphasic_derivation_of_p_wave_on_V3": datasets.Value("float64"),
431
+ "type_of_ragged_t_wave_on_V3": datasets.Value("float64"),
432
+ "type_of_diphasic_derivation_of_t_wave_on_V3": datasets.Value("float64"),
433
+ "average_witdth_of_wave_q_on_V4": datasets.Value("float64"),
434
+ "average_witdth_of_wave_r_on_V4": datasets.Value("float64"),
435
+ "average_witdth_of_wave_s_on_V4": datasets.Value("float64"),
436
+ "average_witdth_of_wave_rprime_on_V4": datasets.Value("float64"),
437
+ "average_witdth_of_wave_sprime_on_V4": datasets.Value("float64"),
438
+ "number_of_deflections_on_V4": datasets.Value("float64"),
439
+ "type_of_ragged_r_wave_on_V4": datasets.Value("float64"),
440
+ "type_of_diphasic_derivation_of_r_wave_on_V4": datasets.Value("float64"),
441
+ "type_of_ragged_p_wave_on_V4": datasets.Value("float64"),
442
+ "type_of_diphasic_derivation_of_p_wave_on_V4": datasets.Value("float64"),
443
+ "type_of_ragged_t_wave_on_V4": datasets.Value("float64"),
444
+ "type_of_diphasic_derivation_of_t_wave_on_V4": datasets.Value("float64"),
445
+ "average_witdth_of_wave_q_on_V5": datasets.Value("float64"),
446
+ "average_witdth_of_wave_r_on_V5": datasets.Value("float64"),
447
+ "average_witdth_of_wave_s_on_V5": datasets.Value("float64"),
448
+ "average_witdth_of_wave_rprime_on_V5": datasets.Value("float64"),
449
+ "average_witdth_of_wave_sprime_on_V5": datasets.Value("float64"),
450
+ "number_of_deflections_on_V5": datasets.Value("float64"),
451
+ "type_of_ragged_r_wave_on_V5": datasets.Value("float64"),
452
+ "type_of_diphasic_derivation_of_r_wave_on_V5": datasets.Value("float64"),
453
+ "type_of_ragged_p_wave_on_V5": datasets.Value("float64"),
454
+ "type_of_diphasic_derivation_of_p_wave_on_V5": datasets.Value("float64"),
455
+ "type_of_ragged_t_wave_on_V5": datasets.Value("float64"),
456
+ "type_of_diphasic_derivation_of_t_wave_on_V5": datasets.Value("float64"),
457
+ "average_witdth_of_wave_q_on_V6": datasets.Value("float64"),
458
+ "average_witdth_of_wave_r_on_V6": datasets.Value("float64"),
459
+ "average_witdth_of_wave_s_on_V6": datasets.Value("float64"),
460
+ "average_witdth_of_wave_rprime_on_V6": datasets.Value("float64"),
461
+ "average_witdth_of_wave_sprime_on_V6": datasets.Value("float64"),
462
+ "number_of_deflections_on_V6": datasets.Value("float64"),
463
+ "type_of_ragged_r_wave_on_V6": datasets.Value("float64"),
464
+ "type_of_diphasic_derivation_of_r_wave_on_V6": datasets.Value("float64"),
465
+ "type_of_ragged_p_wave_on_V6": datasets.Value("float64"),
466
+ "type_of_diphasic_derivation_of_p_wave_on_V6": datasets.Value("float64"),
467
+ "type_of_ragged_t_wave_on_V6": datasets.Value("float64"),
468
+ "type_of_diphasic_derivation_of_t_wave_on_V6": datasets.Value("float64"),
469
+ "amplitude_of_jj_wave_on_DI": datasets.Value("float64"),
470
+ "amplitude_of_q_wave_on_DI": datasets.Value("float64"),
471
+ "amplitude_of_r_wave_on_DI": datasets.Value("float64"),
472
+ "amplitude_of_s_wave_on_DI": datasets.Value("float64"),
473
+ "amplitude_of_rprime_wave_on_DI": datasets.Value("float64"),
474
+ "amplitude_of_sprime_wave_on_DI": datasets.Value("float64"),
475
+ "amplitude_of_p_wave_on_DI": datasets.Value("float64"),
476
+ "amplitude_of_t_wave_on_DI": datasets.Value("float64"),
477
+ "qrsa_on_DI": datasets.Value("float64"),
478
+ "qrsta_on_DI": datasets.Value("float64"),
479
+ "amplitude_of_jj_wave_on_DII": datasets.Value("float64"),
480
+ "amplitude_of_q_wave_on_DII": datasets.Value("float64"),
481
+ "amplitude_of_r_wave_on_DII": datasets.Value("float64"),
482
+ "amplitude_of_s_wave_on_DII": datasets.Value("float64"),
483
+ "amplitude_of_rprime_wave_on_DII": datasets.Value("float64"),
484
+ "amplitude_of_sprime_wave_on_DII": datasets.Value("float64"),
485
+ "amplitude_of_p_wave_on_DII": datasets.Value("float64"),
486
+ "amplitude_of_t_wave_on_DII": datasets.Value("float64"),
487
+ "qrsa_on_DII": datasets.Value("float64"),
488
+ "qrsta_on_DII": datasets.Value("float64"),
489
+ "amplitude_of_jj_wave_on_DIII": datasets.Value("float64"),
490
+ "amplitude_of_q_wave_on_DIII": datasets.Value("float64"),
491
+ "amplitude_of_r_wave_on_DIII": datasets.Value("float64"),
492
+ "amplitude_of_s_wave_on_DIII": datasets.Value("float64"),
493
+ "amplitude_of_rprime_wave_on_DIII": datasets.Value("float64"),
494
+ "amplitude_of_sprime_wave_on_DIII": datasets.Value("float64"),
495
+ "amplitude_of_p_wave_on_DIII": datasets.Value("float64"),
496
+ "amplitude_of_t_wave_on_DIII": datasets.Value("float64"),
497
+ "qrsa_on_DIII": datasets.Value("float64"),
498
+ "qrsta_on_DIII": datasets.Value("float64"),
499
+ "amplitude_of_jj_wave_on_AVR": datasets.Value("float64"),
500
+ "amplitude_of_q_wave_on_AVR": datasets.Value("float64"),
501
+ "amplitude_of_r_wave_on_AVR": datasets.Value("float64"),
502
+ "amplitude_of_s_wave_on_AVR": datasets.Value("float64"),
503
+ "amplitude_of_rprime_wave_on_AVR": datasets.Value("float64"),
504
+ "amplitude_of_sprime_wave_on_AVR": datasets.Value("float64"),
505
+ "amplitude_of_p_wave_on_AVR": datasets.Value("float64"),
506
+ "amplitude_of_t_wave_on_AVR": datasets.Value("float64"),
507
+ "qrsa_on_AVR": datasets.Value("float64"),
508
+ "qrsta_on_AVR": datasets.Value("float64"),
509
+ "amplitude_of_jj_wave_on_AVL": datasets.Value("float64"),
510
+ "amplitude_of_q_wave_on_AVL": datasets.Value("float64"),
511
+ "amplitude_of_r_wave_on_AVL": datasets.Value("float64"),
512
+ "amplitude_of_s_wave_on_AVL": datasets.Value("float64"),
513
+ "amplitude_of_rprime_wave_on_AVL": datasets.Value("float64"),
514
+ "amplitude_of_sprime_wave_on_AVL": datasets.Value("float64"),
515
+ "amplitude_of_p_wave_on_AVL": datasets.Value("float64"),
516
+ "amplitude_of_t_wave_on_AVL": datasets.Value("float64"),
517
+ "qrsa_on_AVL": datasets.Value("float64"),
518
+ "qrsta_on_AVL": datasets.Value("float64"),
519
+ "amplitude_of_jj_wave_on_AVF": datasets.Value("float64"),
520
+ "amplitude_of_q_wave_on_AVF": datasets.Value("float64"),
521
+ "amplitude_of_r_wave_on_AVF": datasets.Value("float64"),
522
+ "amplitude_of_s_wave_on_AVF": datasets.Value("float64"),
523
+ "amplitude_of_rprime_wave_on_AVF": datasets.Value("float64"),
524
+ "amplitude_of_sprime_wave_on_AVF": datasets.Value("float64"),
525
+ "amplitude_of_p_wave_on_AVF": datasets.Value("float64"),
526
+ "amplitude_of_t_wave_on_AVF": datasets.Value("float64"),
527
+ "qrsa_on_AVF": datasets.Value("float64"),
528
+ "qrsta_on_AVF": datasets.Value("float64"),
529
+ "amplitude_of_jj_wave_on_V1": datasets.Value("float64"),
530
+ "amplitude_of_q_wave_on_V1": datasets.Value("float64"),
531
+ "amplitude_of_r_wave_on_V1": datasets.Value("float64"),
532
+ "amplitude_of_s_wave_on_V1": datasets.Value("float64"),
533
+ "amplitude_of_rprime_wave_on_V1": datasets.Value("float64"),
534
+ "amplitude_of_sprime_wave_on_V1": datasets.Value("float64"),
535
+ "amplitude_of_p_wave_on_V1": datasets.Value("float64"),
536
+ "amplitude_of_t_wave_on_V1": datasets.Value("float64"),
537
+ "qrsa_on_V1": datasets.Value("float64"),
538
+ "qrsta_on_V1": datasets.Value("float64"),
539
+ "amplitude_of_jj_wave_on_V2": datasets.Value("float64"),
540
+ "amplitude_of_q_wave_on_V2": datasets.Value("float64"),
541
+ "amplitude_of_r_wave_on_V2": datasets.Value("float64"),
542
+ "amplitude_of_s_wave_on_V2": datasets.Value("float64"),
543
+ "amplitude_of_rprime_wave_on_V2": datasets.Value("float64"),
544
+ "amplitude_of_sprime_wave_on_V2": datasets.Value("float64"),
545
+ "amplitude_of_p_wave_on_V2": datasets.Value("float64"),
546
+ "amplitude_of_t_wave_on_V2": datasets.Value("float64"),
547
+ "qrsa_on_V2": datasets.Value("float64"),
548
+ "qrsta_on_V2": datasets.Value("float64"),
549
+ "amplitude_of_jj_wave_on_V3": datasets.Value("float64"),
550
+ "amplitude_of_q_wave_on_V3": datasets.Value("float64"),
551
+ "amplitude_of_r_wave_on_V3": datasets.Value("float64"),
552
+ "amplitude_of_s_wave_on_V3": datasets.Value("float64"),
553
+ "amplitude_of_rprime_wave_on_V3": datasets.Value("float64"),
554
+ "amplitude_of_sprime_wave_on_V3": datasets.Value("float64"),
555
+ "amplitude_of_p_wave_on_V3": datasets.Value("float64"),
556
+ "amplitude_of_t_wave_on_V3": datasets.Value("float64"),
557
+ "qrsa_on_V3": datasets.Value("float64"),
558
+ "qrsta_on_V3": datasets.Value("float64"),
559
+ "amplitude_of_jj_wave_on_V4": datasets.Value("float64"),
560
+ "amplitude_of_q_wave_on_V4": datasets.Value("float64"),
561
+ "amplitude_of_r_wave_on_V4": datasets.Value("float64"),
562
+ "amplitude_of_s_wave_on_V4": datasets.Value("float64"),
563
+ "amplitude_of_rprime_wave_on_V4": datasets.Value("float64"),
564
+ "amplitude_of_sprime_wave_on_V4": datasets.Value("float64"),
565
+ "amplitude_of_p_wave_on_V4": datasets.Value("float64"),
566
+ "amplitude_of_t_wave_on_V4": datasets.Value("float64"),
567
+ "qrsa_on_V4": datasets.Value("float64"),
568
+ "qrsta_on_V4": datasets.Value("float64"),
569
+ "amplitude_of_jj_wave_on_V5": datasets.Value("float64"),
570
+ "amplitude_of_q_wave_on_V5": datasets.Value("float64"),
571
+ "amplitude_of_r_wave_on_V5": datasets.Value("float64"),
572
+ "amplitude_of_s_wave_on_V5": datasets.Value("float64"),
573
+ "amplitude_of_rprime_wave_on_V5": datasets.Value("float64"),
574
+ "amplitude_of_sprime_wave_on_V5": datasets.Value("float64"),
575
+ "amplitude_of_p_wave_on_V5": datasets.Value("float64"),
576
+ "amplitude_of_t_wave_on_V5": datasets.Value("float64"),
577
+ "qrsa_on_V5": datasets.Value("float64"),
578
+ "qrsta_on_V5": datasets.Value("float64"),
579
+ "amplitude_of_jj_wave_on_V6": datasets.Value("float64"),
580
+ "amplitude_of_q_wave_on_V6": datasets.Value("float64"),
581
+ "amplitude_of_r_wave_on_V6": datasets.Value("float64"),
582
+ "amplitude_of_s_wave_on_V6": datasets.Value("float64"),
583
+ "amplitude_of_rprime_wave_on_V6": datasets.Value("float64"),
584
+ "amplitude_of_sprime_wave_on_V6": datasets.Value("float64"),
585
+ "amplitude_of_p_wave_on_V6": datasets.Value("float64"),
586
+ "amplitude_of_t_wave_on_V6": datasets.Value("float64"),
587
+ "qrsa_on_V6": datasets.Value("float64"),
588
+ "qrsta_on_V6": datasets.Value("float64"),
589
+ "has_arhythmia": datasets.ClassLabel(num_classes=2, names=("no", "yes"))
590
  }
591
  }
592
  features_per_config = {k: datasets.Features(features_types_per_config[k]) for k in features_types_per_config}
 
653
  }
654
  data.loc[:, "type_of_arhythmia"] = data["type_of_arhythmia"].apply(lambda x: label_encoding[x])
655
 
656
+ if config == "has_arhythmia":
657
+ data.loc[:, "type_of_arhytmia"] = data["type_of_arhytmia"].apply(lambda x: 0 if x == 0 else 1)
658
+ data = data.rename(columns={"type_of_arhytmia": "has_arhythmia"})
659
+
660
  return data[list(features_types_per_config[config].keys())]