mljar-supervised 1.4.0rc2__py3-none-any.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.
Files changed (117) hide show
  1. mljar_supervised-1.4.0rc2.dist-info/METADATA +759 -0
  2. mljar_supervised-1.4.0rc2.dist-info/RECORD +117 -0
  3. mljar_supervised-1.4.0rc2.dist-info/WHEEL +5 -0
  4. mljar_supervised-1.4.0rc2.dist-info/licenses/LICENSE +21 -0
  5. mljar_supervised-1.4.0rc2.dist-info/licenses/LICENSE-pytabkit.txt +201 -0
  6. mljar_supervised-1.4.0rc2.dist-info/top_level.txt +1 -0
  7. supervised/__init__.py +14 -0
  8. supervised/algorithms/__init__.py +0 -0
  9. supervised/algorithms/_pytabkit_compat.py +128 -0
  10. supervised/algorithms/_realmlp_backend.py +84 -0
  11. supervised/algorithms/_sdm_backend.py +75 -0
  12. supervised/algorithms/_tabm_backend.py +221 -0
  13. supervised/algorithms/algorithm.py +169 -0
  14. supervised/algorithms/baseline.py +90 -0
  15. supervised/algorithms/catboost.py +451 -0
  16. supervised/algorithms/decision_tree.py +310 -0
  17. supervised/algorithms/extra_trees.py +178 -0
  18. supervised/algorithms/factory.py +28 -0
  19. supervised/algorithms/knn.py +277 -0
  20. supervised/algorithms/lightgbm.py +418 -0
  21. supervised/algorithms/linear.py +213 -0
  22. supervised/algorithms/nn.py +201 -0
  23. supervised/algorithms/random_forest.py +183 -0
  24. supervised/algorithms/realmlp.py +586 -0
  25. supervised/algorithms/realmlp_resources.py +153 -0
  26. supervised/algorithms/registry.py +85 -0
  27. supervised/algorithms/sdm.py +577 -0
  28. supervised/algorithms/sklearn.py +197 -0
  29. supervised/algorithms/tabm.py +345 -0
  30. supervised/algorithms/tabm_resources.py +94 -0
  31. supervised/algorithms/xgboost.py +420 -0
  32. supervised/apps/__init__.py +5 -0
  33. supervised/apps/generator.py +231 -0
  34. supervised/apps/local_runner.py +120 -0
  35. supervised/apps/metadata.py +380 -0
  36. supervised/apps/publisher.py +497 -0
  37. supervised/apps/templates.py +633 -0
  38. supervised/automl.py +680 -0
  39. supervised/base_automl.py +2758 -0
  40. supervised/callbacks/__init__.py +0 -0
  41. supervised/callbacks/callback.py +25 -0
  42. supervised/callbacks/callback_list.py +33 -0
  43. supervised/callbacks/early_stopping.py +224 -0
  44. supervised/callbacks/learner_time_constraint.py +47 -0
  45. supervised/callbacks/max_iters_constraint.py +16 -0
  46. supervised/callbacks/metric_logger.py +48 -0
  47. supervised/callbacks/terminate_on_nan.py +28 -0
  48. supervised/callbacks/total_time_constraint.py +79 -0
  49. supervised/ensemble.py +588 -0
  50. supervised/exceptions.py +20 -0
  51. supervised/fairness/__init__.py +0 -0
  52. supervised/fairness/certificate.py +129 -0
  53. supervised/fairness/metrics.py +654 -0
  54. supervised/fairness/optimization.py +414 -0
  55. supervised/fairness/plots.py +131 -0
  56. supervised/fairness/report.py +169 -0
  57. supervised/fairness/utils.py +40 -0
  58. supervised/model_framework.py +779 -0
  59. supervised/preprocessing/__init__.py +0 -0
  60. supervised/preprocessing/datetime_transformer.py +106 -0
  61. supervised/preprocessing/encoding_selector.py +31 -0
  62. supervised/preprocessing/exclude_missing_target.py +46 -0
  63. supervised/preprocessing/goldenfeatures_transformer.py +310 -0
  64. supervised/preprocessing/ip_transformer.py +94 -0
  65. supervised/preprocessing/kmeans_transformer.py +119 -0
  66. supervised/preprocessing/label_binarizer.py +81 -0
  67. supervised/preprocessing/label_encoder.py +116 -0
  68. supervised/preprocessing/preprocessing.py +705 -0
  69. supervised/preprocessing/preprocessing_categorical.py +115 -0
  70. supervised/preprocessing/preprocessing_missing.py +105 -0
  71. supervised/preprocessing/preprocessing_utils.py +201 -0
  72. supervised/preprocessing/scale.py +92 -0
  73. supervised/preprocessing/text_transformer.py +73 -0
  74. supervised/tuner/__init__.py +0 -0
  75. supervised/tuner/custom_parameters.py +62 -0
  76. supervised/tuner/data_info.py +83 -0
  77. supervised/tuner/hill_climbing.py +80 -0
  78. supervised/tuner/mljar_tuner.py +1566 -0
  79. supervised/tuner/optuna/__init__.py +0 -0
  80. supervised/tuner/optuna/catboost.py +148 -0
  81. supervised/tuner/optuna/extra_trees.py +80 -0
  82. supervised/tuner/optuna/knn.py +64 -0
  83. supervised/tuner/optuna/lightgbm.py +170 -0
  84. supervised/tuner/optuna/nn.py +68 -0
  85. supervised/tuner/optuna/random_forest.py +77 -0
  86. supervised/tuner/optuna/tuner.py +338 -0
  87. supervised/tuner/optuna/xgboost.py +136 -0
  88. supervised/tuner/preprocessing_tuner.py +147 -0
  89. supervised/tuner/random_parameters.py +22 -0
  90. supervised/tuner/time_controller.py +273 -0
  91. supervised/utils/__init__.py +11 -0
  92. supervised/utils/additional_metrics.py +992 -0
  93. supervised/utils/additional_plots.py +228 -0
  94. supervised/utils/artifact_paths.py +14 -0
  95. supervised/utils/automl_plots.py +329 -0
  96. supervised/utils/blueprint.py +494 -0
  97. supervised/utils/column_scan.py +58 -0
  98. supervised/utils/common.py +39 -0
  99. supervised/utils/config.py +25 -0
  100. supervised/utils/constants.py +4 -0
  101. supervised/utils/data_validation.py +48 -0
  102. supervised/utils/feature_importance.py +266 -0
  103. supervised/utils/importance.py +150 -0
  104. supervised/utils/jsonencoder.py +33 -0
  105. supervised/utils/leaderboard_plots.py +153 -0
  106. supervised/utils/learning_curves.py +145 -0
  107. supervised/utils/metric.py +470 -0
  108. supervised/utils/report_structured.py +718 -0
  109. supervised/utils/shap.py +383 -0
  110. supervised/utils/subsample.py +17 -0
  111. supervised/utils/utils.py +94 -0
  112. supervised/validation/__init__.py +0 -0
  113. supervised/validation/validation_step.py +38 -0
  114. supervised/validation/validator_base.py +36 -0
  115. supervised/validation/validator_custom.py +88 -0
  116. supervised/validation/validator_kfold.py +135 -0
  117. supervised/validation/validator_split.py +111 -0
@@ -0,0 +1,117 @@
1
+ mljar_supervised-1.4.0rc2.dist-info/licenses/LICENSE,sha256=F30c0zOLSlK65-rn_v1JEtNTvVkLf2WV7frt9YQ1Kwc,1073
2
+ mljar_supervised-1.4.0rc2.dist-info/licenses/LICENSE-pytabkit.txt,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
3
+ supervised/__init__.py,sha256=oAmri965W_dA4TxHJ_UmQiJk0IPdxviPCyHrI92tTC4,265
4
+ supervised/automl.py,sha256=JFp0P2CD4WGXkWbU7NX9LFEFocfTVdr9nEfubhUmJY4,32555
5
+ supervised/base_automl.py,sha256=kM2zxGZjZnOJ3N3RXBbPHk8WTSHppFxZTdpQ84LE0UY,111606
6
+ supervised/ensemble.py,sha256=FIC6a7vM88zYzPEdTTJYUZ29RSUcsd11qO5PUFIuCPA,23252
7
+ supervised/exceptions.py,sha256=5MGDYjIu-BzP3C9B5b2YZ7uTpzjrnsrkoBSYZacjA8o,517
8
+ supervised/model_framework.py,sha256=a99NRJt3ijPQY5yJIjYqqtx2gvdMVeQLI1QoQU4hTUQ,32067
9
+ supervised/algorithms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ supervised/algorithms/_pytabkit_compat.py,sha256=9IOHEaS2lMzTMZ8SXO5ZWIJLirZjsEvIwWREEen30aI,4519
11
+ supervised/algorithms/_realmlp_backend.py,sha256=nr-RIFVUl4J_Bgz5X3hGnXAzviQsgxLB0-B7ax_wnxg,2778
12
+ supervised/algorithms/_sdm_backend.py,sha256=YBQgLsWSzQF50x3ZEJP-x1LDQ7vfiV1hYYESsJUTXuM,2945
13
+ supervised/algorithms/_tabm_backend.py,sha256=yryGbdjdrbvF5FiV7SJHV-ubQM3X3BpjlWnukC48M0A,8984
14
+ supervised/algorithms/algorithm.py,sha256=nuPFYHAb11y5q1yuYQXYKtsKlsZ8XqqeT9PqmPCTj9o,5144
15
+ supervised/algorithms/baseline.py,sha256=zD8j2teM5vmlS-8aTS-I8uWbwiT0NH87sdBEVhHNurI,2475
16
+ supervised/algorithms/catboost.py,sha256=3Vj_3mgWhd4yE4XFBB4pUGS_jPGfRysky2nBZ4CPMEI,15306
17
+ supervised/algorithms/decision_tree.py,sha256=PfYmBHXNdKriuBi0pVEfPotTAG6gXJ5OJWm1yakfIZY,9461
18
+ supervised/algorithms/extra_trees.py,sha256=ccI0eyq0TYKcVfNG6pM_8_T1bQkTg61vgGw8yMo_6do,5201
19
+ supervised/algorithms/factory.py,sha256=8GYpCzCxLN8e5qbROXxztBacDJeNLoyDKfDprfWYWSM,911
20
+ supervised/algorithms/knn.py,sha256=VutwSP4mIXjkzQeFm3OL1YE1KSjsS9kOJhmhxsMjeWo,9194
21
+ supervised/algorithms/lightgbm.py,sha256=ka0QPwq1n02rQwbksL5RO0XML_gtzadsoGztKGR58nk,12737
22
+ supervised/algorithms/linear.py,sha256=o_AQ8Dt8O2amc7J5PpqrY1uZk5AYGwK0eT5wb1myQIE,5873
23
+ supervised/algorithms/nn.py,sha256=3duw2LNblREIt77XS3iUUGMpf0WH6bB0T9WyB2qSaV0,5628
24
+ supervised/algorithms/random_forest.py,sha256=rbZ6LGJ5uxYTKYffDa9k8W4YIU4A153PXrVJj3b5tQs,5322
25
+ supervised/algorithms/realmlp.py,sha256=uOSxy1rcHmf8nBV5Z-tn1FBzuwPGvdasrP3xSfTyG9U,21357
26
+ supervised/algorithms/realmlp_resources.py,sha256=WSRuOh1CbI3vb87r3Qbp4cd_CtgIWZp11vPsg8Wk4dI,6153
27
+ supervised/algorithms/registry.py,sha256=uT2TP3JrhcLYijaxRaObUCEMoUIjSVc5UB-mEI9t0tM,2691
28
+ supervised/algorithms/sdm.py,sha256=9xLrbh7krCCAw8_cS7RsWuPARsnxARmiuZ2fRyjXFPo,23330
29
+ supervised/algorithms/sklearn.py,sha256=air9ih-pDQ-Oi6eBUa982iPF5G15Eb7gPvWl_2XkG7M,6245
30
+ supervised/algorithms/tabm.py,sha256=t8ZMvt42jE71C0qqR8gdf1s05HBbVQskaQ59H4iPReI,12161
31
+ supervised/algorithms/tabm_resources.py,sha256=eIvOdSG6M6YhbIEjRxsJa84hkjSMQvQjM38o8HUGyOw,3398
32
+ supervised/algorithms/xgboost.py,sha256=iWyWkU5ZGOTTeduDRJf5HJTU20dqLkL8thXBL7jcmsI,12913
33
+ supervised/apps/__init__.py,sha256=tUptgib0Udwcjc9-1JD2dw4IpS-_-fRKFjZC0ruD2nU,264
34
+ supervised/apps/generator.py,sha256=JGhsyyi-tAXfaApDe63E-oGxnXSEVihLSlGsEW1uWMY,8088
35
+ supervised/apps/local_runner.py,sha256=qHQNdNcLTKFqKcwIJgdqvcaOyHEI3Fo_5RW4ldk-vAs,3614
36
+ supervised/apps/metadata.py,sha256=SucKb46Cx6LP-dzgGz6anLaW3_wfO8Ck9sVmyuWv-60,12592
37
+ supervised/apps/publisher.py,sha256=tVGWSNsZaF_ffOzF0WQHKCrGYxlbWN8wWggDzS6mSJw,17695
38
+ supervised/apps/templates.py,sha256=7WyXnRhurwX7ujGYRUbOK1da6j-C9sFfBbH2sUM2w1c,22281
39
+ supervised/callbacks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
+ supervised/callbacks/callback.py,sha256=voqhdjnlsAc1zrtm4i74ysSwRLI-AIl60PB9Ji5Jhnw,592
41
+ supervised/callbacks/callback_list.py,sha256=tstUgUsLhe4aILjxfbA0NGdqtVhDVvvmuIZOydo3DSg,1027
42
+ supervised/callbacks/early_stopping.py,sha256=F-ZgyuaxVCRO8d-zn-O7L2ZnL3_154pyClJyoE_DgMw,9506
43
+ supervised/callbacks/learner_time_constraint.py,sha256=JuQVkRnZ_FzigZeoMfWz5K8h-5muJw-ap34eYMPpOzw,1701
44
+ supervised/callbacks/max_iters_constraint.py,sha256=FuCUAbwPj6MFj0e1IpbPu-VTd4NuKtf996xAEOZLsnU,568
45
+ supervised/callbacks/metric_logger.py,sha256=z1DTERDa0KTvE5Zh3cVI4zir5HBo5THrIxJW8eTlg5Y,1847
46
+ supervised/callbacks/terminate_on_nan.py,sha256=YzpSLYoP6VJcEptHSUZD7rKbEA3Bwf66Db2iPAWP4qs,933
47
+ supervised/callbacks/total_time_constraint.py,sha256=_qHl1gDmFuNlUMVC6RWPCkG8ggdZOm0kPnR2mB4ZogU,3353
48
+ supervised/fairness/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
+ supervised/fairness/certificate.py,sha256=7S56cudhCsKaPuwpqbMQzCMRfAB2s45B4BU0G3lCE0s,4014
50
+ supervised/fairness/metrics.py,sha256=p5Z1HTBTtWJ44mvXtv354zbPRmNiHtfi7WK7nSSQsq0,26141
51
+ supervised/fairness/optimization.py,sha256=L2M8eXmp9L4yVZg8wOA2C3BBAL_SO1JdSTHsSZ9JDfQ,15001
52
+ supervised/fairness/plots.py,sha256=GWxN3rCEPaHn4mOrR-pOCsdaE47gQkH4z9ZKLar1ETE,4049
53
+ supervised/fairness/report.py,sha256=cUE2cQaacH6stZ0udTpLVDH37StppCnHI5dT2WrUmM4,6468
54
+ supervised/fairness/utils.py,sha256=tJXO1rLrxSnCogxOyRUk7iGN5iXvOHg_yIKqhww4uTE,701
55
+ supervised/preprocessing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
+ supervised/preprocessing/datetime_transformer.py,sha256=GY8ru25XiGufo0bvxMpN_6O63KeCi0NvEFde7ujVg8w,3535
57
+ supervised/preprocessing/encoding_selector.py,sha256=jFpF4Wch3g57T6AgvUEqC5655BYLMsvQ40YfB0y2o2A,933
58
+ supervised/preprocessing/exclude_missing_target.py,sha256=DitRhlFo91o7XBjt8EO-nEiNXa1BchmGbjDkj3OOldE,1517
59
+ supervised/preprocessing/goldenfeatures_transformer.py,sha256=QAFBAdLA79mObMshVX0ZS-nvQlh5PQ-bZc62i7nqr_0,10846
60
+ supervised/preprocessing/ip_transformer.py,sha256=0eO-F-UP--lGf8MdyJQ6S7fpE8fI-fcEYe_8HII_F20,3364
61
+ supervised/preprocessing/kmeans_transformer.py,sha256=cCqrDpZtywhVG_4yD3llTWe0QhVKvS4KGUibJbh9VGc,3970
62
+ supervised/preprocessing/label_binarizer.py,sha256=oIhdD9GeilHo361yUIeqMsLBRsCb9GNV20iZspBHEqM,2700
63
+ supervised/preprocessing/label_encoder.py,sha256=jfJrtBthltuj4YEbxMkRqiuQmaSxYslFnvO1XaPhpb4,4825
64
+ supervised/preprocessing/preprocessing.py,sha256=5Ch0VGjN4YHTvfFgsjvC1fAo97-0FFh8SHjp9k6ps4w,28787
65
+ supervised/preprocessing/preprocessing_categorical.py,sha256=ayaZ6YOOc1WJNnOgSe-9SC7gCHtLcD4-dFdQL3n5CCg,4530
66
+ supervised/preprocessing/preprocessing_missing.py,sha256=jIEfbf5hu0-3L-mGIjtp75rbC1fXVByUaaGi7hUj8d8,4129
67
+ supervised/preprocessing/preprocessing_utils.py,sha256=SgV_fp6ewhJRRKiyw4ezeB4z-v_QILfWN0cuftL4iYc,6229
68
+ supervised/preprocessing/scale.py,sha256=umR_j24PQpTeNs1z4WF2j4oqWyKIj-NA1_WesssO5no,3779
69
+ supervised/preprocessing/text_transformer.py,sha256=eY1qgEyiEU2XzarnKGg1SOtAV_35G2sxL7B80MXXheM,2585
70
+ supervised/tuner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
71
+ supervised/tuner/custom_parameters.py,sha256=9IS73oZ0sOTklpQKiHfk4sMJS4hjOpgHhi5CcswoGQc,2225
72
+ supervised/tuner/data_info.py,sha256=gmV1s6sW1tEvUnbzaSNyRjql2h1mPz8Lsmr6Pb40J5g,3462
73
+ supervised/tuner/hill_climbing.py,sha256=FlHAFxE6Jw0cJc1lp5bQ5PV4zMtKZfQxbiPzJSXwxiU,2346
74
+ supervised/tuner/mljar_tuner.py,sha256=AO4h_b65BtzcFbf_IaTDXoTp3VVAjJHKQFXV7skAK6E,61349
75
+ supervised/tuner/preprocessing_tuner.py,sha256=6VhcdUDrSR5iw3pBMwpXK1AKXQce9JM2TwkKSzlEy08,6469
76
+ supervised/tuner/random_parameters.py,sha256=3VNstZQmzaSKiU2gm7iR7DkjzZ5NSOq4JwcGKKvuSg8,564
77
+ supervised/tuner/time_controller.py,sha256=M0USrnnMpybA0knA0G3Old8h8o50AppaW2SxyGwyiwY,8944
78
+ supervised/tuner/optuna/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
79
+ supervised/tuner/optuna/catboost.py,sha256=vHEl8v1M1jTVH2nY4IFyGIoBccpfBu8g-z86lskQB8k,5539
80
+ supervised/tuner/optuna/extra_trees.py,sha256=hydXetsghgwxhjVz21KUUTvFtMfLPW50DUvQVLOGhaI,2510
81
+ supervised/tuner/optuna/knn.py,sha256=QRiFR5g7h8hcs6tXev1ym2YFfqmVo9MZLazLYRnfH4Q,1910
82
+ supervised/tuner/optuna/lightgbm.py,sha256=V1lWO__MFgashjvCDIjCHiw-k7HlxC42Tq-8UNVRNHk,6049
83
+ supervised/tuner/optuna/nn.py,sha256=OVEsL3nbf_e399cSxWa6ABId7KTfz2sesSqiUOynP40,2190
84
+ supervised/tuner/optuna/random_forest.py,sha256=PWw_zUVuvw4N_I4hZ8YdTbQQMkff3gT2TL9i3jg4PM0,2511
85
+ supervised/tuner/optuna/tuner.py,sha256=HoWw4XfWOE4fjQ9ofZpaPpZG98p_feWCL3XsZwmlM2s,11681
86
+ supervised/tuner/optuna/xgboost.py,sha256=qEeS4QqAUGg-X3xZaVvQ1B1CMimdbmr7YoNIWDy-fpQ,4975
87
+ supervised/utils/__init__.py,sha256=bNfSKVX2-H2GgtQO5IwPPBHxZWZBU_F1kfl13QVwijg,259
88
+ supervised/utils/additional_metrics.py,sha256=7s5gqDknrHD4BzOcyEJaURgG2eQdfDntugBq9-1b4SI,38427
89
+ supervised/utils/additional_plots.py,sha256=mX0ScTYbKxEIgfuEPcjFQbRiCFj5QZ_5WrdKIugFrEw,8148
90
+ supervised/utils/artifact_paths.py,sha256=123UBw0tEUoSuV4koDbt2zyFCJJiDSmSUGTjCMHk4w0,501
91
+ supervised/utils/automl_plots.py,sha256=pvUE3YUQ-ZjwiHOxTtl5NzEGXfrPsRLWbOAsi4ymUNY,14760
92
+ supervised/utils/blueprint.py,sha256=Fxa-7eouZ7OfWdTZIty4hnrlrrSqelH5xrpAawORD6A,18205
93
+ supervised/utils/column_scan.py,sha256=X6b3aSvrQhboaZFjKjGuh1lMMXI20l4pjdTjM79ok9A,2200
94
+ supervised/utils/common.py,sha256=lBe8NAk93Ig8X0d2qsgRcYGMHAd_gKEyhoS6xr_WAms,1052
95
+ supervised/utils/config.py,sha256=rQ2BSAO3Uy33Gfa2CJ9QuIxmHbVM0ukGmABYQ-o1JXg,524
96
+ supervised/utils/constants.py,sha256=nBCex_lwIF2QyXX-m2US2AHGGIR4i99Pdw6szpuRykk,173
97
+ supervised/utils/data_validation.py,sha256=G6serv0Yl5armM_1fcHmMpUuBOXtItWcds2PkuPjXJA,1481
98
+ supervised/utils/feature_importance.py,sha256=5aSpmPsqz3MtTN1RjpBqFbqI_TZYO6wrNi5lN-t4K4U,10777
99
+ supervised/utils/importance.py,sha256=eph1OzeJ1SdzIi19KZTastZD0gyMWH67uwieBhr-4x4,5101
100
+ supervised/utils/jsonencoder.py,sha256=hJj8Qe0xNsP3DGQgqrW4KvVVez4IqlU2s6rfJWlZ9qw,823
101
+ supervised/utils/leaderboard_plots.py,sha256=n72Tjv3pfOCYGGIP8yeR-RWYsedI9Du1vnn-672h3tY,5523
102
+ supervised/utils/learning_curves.py,sha256=Va6luMon1yYwZnDcpLyJqiHAB5TLutTqw4Pg8lt-LI4,4972
103
+ supervised/utils/metric.py,sha256=U62Q_VDL8fPR3gbNnSHp7BAy-hlXhz_HflGUWmPxsm4,14070
104
+ supervised/utils/report_structured.py,sha256=E2SDA-WPe1wFLh8gUi53-Pa-ZfYO38X1pnB3G-jm9k0,25921
105
+ supervised/utils/shap.py,sha256=zcfFhh5tICTVW4fHSWrEyy2sbhUifYf0Xx0e9f4vCQk,12679
106
+ supervised/utils/subsample.py,sha256=LQLBBey9YKB95xpdY2EiknOT_YrdzCGTWFUduFapClE,424
107
+ supervised/utils/utils.py,sha256=bvOPhemvQ5xbdxaz0u3DLn_dixurJ0fNR4zhT2k-koE,3083
108
+ supervised/validation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
109
+ supervised/validation/validation_step.py,sha256=qw9_gLeeiCw2L01-pdLpNGbV9N79Bydt4582uyKrKdM,1297
110
+ supervised/validation/validator_base.py,sha256=e74K2mqJPLYWsg6s3Uce3Nj1xkL_5epgBeNRRGrId5g,989
111
+ supervised/validation/validator_custom.py,sha256=g9AWJnDHJouhV_p3ONwJhszRR-PjmW1X34st0UMSZlQ,2990
112
+ supervised/validation/validator_kfold.py,sha256=sZ82lsawAfvnbtCxeKAQmtKKkDW0E4R4C-XIaI-AAhQ,4915
113
+ supervised/validation/validator_split.py,sha256=tElSVBHwyDxobY5cXXOVGab0OFnh30BHvJhKh6ugj20,3695
114
+ mljar_supervised-1.4.0rc2.dist-info/METADATA,sha256=SDipY6tE3HL0FlH_TrUAPHc1GZ3ISUdklOymLur8_Vw,32118
115
+ mljar_supervised-1.4.0rc2.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
116
+ mljar_supervised-1.4.0rc2.dist-info/top_level.txt,sha256=ShMnWfsjqWoXIvvw2WArpKSrpfVo1K9fnN5vMOqCqro,11
117
+ mljar_supervised-1.4.0rc2.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 MLJAR Sp. z o.o.
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.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright {yyyy} {name of copyright owner}
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1 @@
1
+ supervised
supervised/__init__.py ADDED
@@ -0,0 +1,14 @@
1
+ __version__ = "1.4.0rc2"
2
+
3
+ import numpy as np
4
+
5
+
6
+ def _ensure_numpy_compat():
7
+ if not hasattr(np, "in1d"):
8
+ # NumPy 2.4 removed np.in1d; some dependencies still use it.
9
+ np.in1d = np.isin
10
+
11
+
12
+ _ensure_numpy_compat()
13
+
14
+ from supervised.automl import AutoML
File without changes
@@ -0,0 +1,128 @@
1
+ """Scoped compatibility for the supported pytabkit 1.7 backend.
2
+
3
+ pytabkit 1.7.2/1.7.3 use the old sklearn finite-check keyword through 1.7.
4
+ Lightning 2.6 still constructs the deprecated torch LeafSpec directly.
5
+ Use the replacement APIs during our calls, without changing installed packages
6
+ or suppressing deprecation warnings. Remove these bridges when upstream fixes
7
+ are included in the supported dependency range.
8
+ """
9
+
10
+ import inspect
11
+ import logging
12
+ import threading
13
+ import warnings
14
+ from contextlib import ExitStack, contextmanager
15
+
16
+ from sklearn.utils.validation import check_array, check_X_y
17
+
18
+
19
+ _backend_lock = threading.RLock()
20
+
21
+
22
+ def _finite_check(check, *args, **kwargs):
23
+ keyword = (
24
+ "ensure_all_finite"
25
+ if "ensure_all_finite" in inspect.signature(check).parameters
26
+ else "force_all_finite"
27
+ )
28
+ old_keyword = (
29
+ "force_all_finite" if keyword == "ensure_all_finite" else "ensure_all_finite"
30
+ )
31
+ if old_keyword in kwargs:
32
+ kwargs[keyword] = kwargs.pop(old_keyword)
33
+ return check(*args, **kwargs)
34
+
35
+
36
+ def _check_X_y(*args, **kwargs):
37
+ return _finite_check(check_X_y, *args, **kwargs)
38
+
39
+
40
+ def _check_array(*args, **kwargs):
41
+ return _finite_check(check_array, *args, **kwargs)
42
+
43
+
44
+ def _leaf_spec():
45
+ from torch.utils._pytree import tree_flatten
46
+
47
+ # Let torch construct its current leaf representation (also works on 2.7).
48
+ return tree_flatten(None)[1]
49
+
50
+
51
+ class _BackendLogFilter(logging.Filter):
52
+ def __init__(self):
53
+ super().__init__()
54
+ self.thread = threading.get_ident()
55
+
56
+ def filter(self, record):
57
+ # Preserve warnings/errors and logs from unrelated threads.
58
+ return record.thread != self.thread or record.levelno >= logging.WARNING
59
+
60
+
61
+ @contextmanager
62
+ def backend_context():
63
+ from pytabkit.models.sklearn import sklearn_base
64
+ from pytorch_lightning.utilities import _pytree
65
+
66
+ # Upstream helpers are module globals. Serialize MLJAR backend calls and
67
+ # restore every replacement even if fit/predict raises; nested calls work.
68
+ with _backend_lock, ExitStack() as stack:
69
+ for module, name, replacement in [
70
+ (sklearn_base, "check_X_y_wrapper", _check_X_y),
71
+ (sklearn_base, "check_array_wrapper", _check_array),
72
+ (_pytree, "LeafSpec", _leaf_spec),
73
+ ]:
74
+ original = getattr(module, name)
75
+ stack.callback(setattr, module, name, original)
76
+ setattr(module, name, replacement)
77
+
78
+ prefixes = ("pytorch_lightning", "lightning")
79
+ names = set(prefixes) | {
80
+ name
81
+ for name in list(logging.Logger.manager.loggerDict)
82
+ if name.startswith(tuple(prefix + "." for prefix in prefixes))
83
+ }
84
+ log_filter = _BackendLogFilter()
85
+ for name in names:
86
+ logger = logging.getLogger(name)
87
+ logger.addFilter(log_filter)
88
+ stack.callback(logger.removeFilter, log_filter)
89
+
90
+ # NNAlgInterface.fit changes this unrelated logger as well as warning
91
+ # filters. Do not let those upstream settings leak into user code.
92
+ lightning_logger = logging.getLogger("lightning")
93
+ stack.callback(lightning_logger.setLevel, lightning_logger.level)
94
+ stack.callback(
95
+ setattr, lightning_logger, "propagate", lightning_logger.propagate
96
+ )
97
+ stack.enter_context(warnings.catch_warnings())
98
+ yield
99
+
100
+
101
+ class PytabkitCompatibilityMixin:
102
+ def fit(self, *args, **kwargs):
103
+ with backend_context():
104
+ return super().fit(*args, **kwargs)
105
+
106
+ def _predict_raw(self, *args, **kwargs):
107
+ with backend_context():
108
+ return super()._predict_raw(*args, **kwargs)
109
+
110
+
111
+ @contextmanager
112
+ def single_bin_diagnostics():
113
+ # Two distinct values legitimately produce a single interval. The encoder
114
+ # handles it correctly; the adapter records its count in training_info.
115
+ # Keep bin validation and all other warnings active.
116
+ with warnings.catch_warnings():
117
+ warnings.filterwarnings(
118
+ "ignore",
119
+ message=(
120
+ r"The \d+-th feature has just two bin edges, which means only one bin\."
121
+ r" Strictly speaking, using a single bin for the piecewise-linear encoding"
122
+ r" should not break anything, but it is the same as using"
123
+ r" sklearn\.preprocessing\.MinMaxScaler\Z"
124
+ ),
125
+ category=UserWarning,
126
+ module=r"pytabkit\.models\.nn_models\.rtdl_num_embeddings\Z",
127
+ )
128
+ yield
@@ -0,0 +1,84 @@
1
+ """Optional pytabkit adapter. Imported only when RealMLP is used.
2
+
3
+ Capture upstream epoch metrics without redirecting stdout or monkey-patching
4
+ global Lightning classes. Keep this small adapter covered against pytabkit 1.7.
5
+ """
6
+
7
+ import re
8
+ import warnings
9
+
10
+ from pytabkit import RealMLP_TD_Classifier, RealMLP_TD_Regressor
11
+ from pytabkit.models.alg_interfaces.nn_interfaces import NNAlgInterface
12
+
13
+ from supervised.algorithms._pytabkit_compat import PytabkitCompatibilityMixin
14
+
15
+
16
+ class HistoryLogger:
17
+ def __init__(self, logger, history):
18
+ self.logger = logger
19
+ self.history = history
20
+
21
+ def get_verbosity_level(self):
22
+ return self.logger.get_verbosity_level()
23
+
24
+ def log(self, verbosity, content):
25
+ match = re.match(r"Epoch (\d+)/(\d+): val (\S+) =\s*(\S+)", content)
26
+ if match:
27
+ self.history.append(
28
+ {
29
+ "epoch": int(match[1]),
30
+ "metric": match[3],
31
+ "validation": float(match[4]),
32
+ }
33
+ )
34
+ self.logger.log(verbosity, content)
35
+
36
+ def force_log(self, content):
37
+ self.logger.force_log(content)
38
+
39
+
40
+ class HistoryInterface(NNAlgInterface):
41
+ def fit(self, ds, idxs_list, interface_resources, logger, tmp_folders, name):
42
+ self.history = []
43
+ return super().fit(
44
+ ds,
45
+ idxs_list,
46
+ interface_resources,
47
+ HistoryLogger(logger, self.history),
48
+ tmp_folders,
49
+ name,
50
+ )
51
+
52
+ def predict(self, ds):
53
+ # pytabkit 1.7.2 omits the fit-time DummyLogger when constructing its
54
+ # prediction Trainer, unintentionally enabling Lightning's CSV logger.
55
+ from pytorch_lightning.loggers.logger import DummyLogger
56
+
57
+ self.min_trainer_kwargs["logger"] = DummyLogger()
58
+ with warnings.catch_warnings():
59
+ if str(self.device) == "cpu":
60
+ # Portable RealMLP artifacts intentionally reload on CPU. This
61
+ # is a supported inference path, not an accidental GPU fallback.
62
+ warnings.filterwarnings(
63
+ "ignore",
64
+ message=(
65
+ r"GPU available but not used\. You can set it by doing "
66
+ r"`Trainer\(accelerator='gpu'\)`\.\Z"
67
+ ),
68
+ category=UserWarning,
69
+ module=r"pytorch_lightning\.trainer\.setup\Z",
70
+ )
71
+ return super().predict(ds)
72
+
73
+
74
+ class HistoryMixin(PytabkitCompatibilityMixin):
75
+ def _create_alg_interface(self, n_cv):
76
+ return HistoryInterface(**self.get_config())
77
+
78
+
79
+ class RealMLPClassifier(HistoryMixin, RealMLP_TD_Classifier):
80
+ pass
81
+
82
+
83
+ class RealMLPRegressor(HistoryMixin, RealMLP_TD_Regressor):
84
+ pass
@@ -0,0 +1,75 @@
1
+ """Lazy SDM/PyTorch adapter. Frozen weights are loaded from pinned local files."""
2
+
3
+ import numpy as np
4
+ import pandas as pd
5
+ import torch
6
+ import sdm
7
+ from sdm.models.callback import Callback
8
+
9
+
10
+ class DeadlineCallback(Callback):
11
+ def __init__(self, check_time):
12
+ self.check_time = check_time
13
+
14
+ def on_model_forward_end(self, model, out):
15
+ self.check_time()
16
+ return out
17
+
18
+
19
+ def load_network(algorithm, ml_task, checkpoint_path, device, size="small"):
20
+ task = "regression" if ml_task == "regression" else "classification"
21
+ cls = sdm.models.KumoTabular if algorithm == "Kumo" else sdm.models.TabICLv2
22
+ kwargs = {"size": size} if algorithm == "Kumo" else {}
23
+ model = cls(task=task, pretrained=False, device="meta", **kwargs)
24
+ state = torch.load(checkpoint_path, map_location=device, weights_only=True)
25
+ if algorithm == "TabICLv2":
26
+ from sdm.models.tabiclv2.ckpt import remap_ckpt
27
+
28
+ state = remap_ckpt(state["state_dict"], is_classifier=task == "classification")
29
+ model.models[task].load_state_dict(state, assign=True)
30
+ model.eval()
31
+ model.requires_grad_(False)
32
+ return model
33
+
34
+
35
+ def predict_batch(learner, frame):
36
+ # Public forward API: bounded uncached inference, sequential ensemble members.
37
+ # Resetting the generator reproduces the same recipe for each query batch.
38
+ types = {
39
+ c: "categorical" if isinstance(t, pd.CategoricalDtype) else "numerical"
40
+ for c, t in learner.context.dtypes.items()
41
+ }
42
+ context = sdm.TableTensor.from_pandas(
43
+ learner.context, stypes=types, device=learner.device
44
+ )
45
+ query = sdm.TableTensor.from_pandas(frame, stypes=types, device=learner.device)
46
+ regression = learner.ml_task == "regression"
47
+ target = pd.DataFrame({"target": learner.context_y})
48
+ y = sdm.TableTensor.from_pandas(
49
+ target,
50
+ stypes={"target": "numerical" if regression else "categorical"},
51
+ device=learner.device,
52
+ )
53
+ with torch.inference_mode(), torch.amp.autocast(
54
+ torch.device(learner.device).type,
55
+ dtype=torch.float16,
56
+ enabled=learner.device.startswith("cuda"),
57
+ ):
58
+ out = learner.model(
59
+ x_context=context,
60
+ y_context=y,
61
+ x_query=query,
62
+ num_estimators=learner.params.get("num_estimators", 8),
63
+ estimator_batch_size=1,
64
+ generator=torch.Generator(learner.device).manual_seed(
65
+ learner.params.get("seed", 1234)
66
+ ),
67
+ callbacks=[DeadlineCallback(learner._check_time)],
68
+ )
69
+ if regression:
70
+ return out.numerical.float().mean(dim=-1).cpu().numpy()
71
+ columns = out.columns[sdm.Stype.numerical]
72
+ indices = [columns.index(str(i)) for i in range(len(learner.classes_))]
73
+ probabilities = out.numerical[..., indices].float().cpu().numpy()
74
+ probabilities = np.clip(probabilities, 0, 1)
75
+ return probabilities / probabilities.sum(axis=-1, keepdims=True)