autogluon.tabular 1.5.1b20260105__py3-none-any.whl → 1.5.1b20260116__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.
Potentially problematic release.
This version of autogluon.tabular might be problematic. Click here for more details.
- autogluon/tabular/__init__.py +1 -0
- autogluon/tabular/configs/config_helper.py +18 -6
- autogluon/tabular/configs/feature_generator_presets.py +3 -1
- autogluon/tabular/configs/hyperparameter_configs.py +42 -9
- autogluon/tabular/configs/presets_configs.py +38 -14
- autogluon/tabular/configs/zeroshot/zeroshot_portfolio_2023.py +84 -14
- autogluon/tabular/configs/zeroshot/zeroshot_portfolio_2025.py +48 -48
- autogluon/tabular/configs/zeroshot/zeroshot_portfolio_cpu_2025_12_18.py +774 -1
- autogluon/tabular/configs/zeroshot/zeroshot_portfolio_gpu_2025_12_18.py +421 -1
- autogluon/tabular/experimental/_scikit_mixin.py +6 -2
- autogluon/tabular/experimental/_tabular_classifier.py +3 -1
- autogluon/tabular/experimental/_tabular_regressor.py +3 -1
- autogluon/tabular/experimental/plot_leaderboard.py +73 -19
- autogluon/tabular/learner/abstract_learner.py +160 -42
- autogluon/tabular/learner/default_learner.py +78 -22
- autogluon/tabular/models/__init__.py +2 -2
- autogluon/tabular/models/_utils/rapids_utils.py +3 -1
- autogluon/tabular/models/abstract/abstract_torch_model.py +2 -0
- autogluon/tabular/models/automm/automm_model.py +12 -3
- autogluon/tabular/models/automm/ft_transformer.py +5 -1
- autogluon/tabular/models/catboost/callbacks.py +2 -2
- autogluon/tabular/models/catboost/catboost_model.py +93 -29
- autogluon/tabular/models/catboost/catboost_softclass_utils.py +4 -1
- autogluon/tabular/models/catboost/catboost_utils.py +3 -1
- autogluon/tabular/models/ebm/ebm_model.py +8 -13
- autogluon/tabular/models/ebm/hyperparameters/parameters.py +1 -0
- autogluon/tabular/models/ebm/hyperparameters/searchspaces.py +1 -0
- autogluon/tabular/models/fastainn/callbacks.py +20 -3
- autogluon/tabular/models/fastainn/hyperparameters/searchspaces.py +11 -1
- autogluon/tabular/models/fastainn/quantile_helpers.py +10 -2
- autogluon/tabular/models/fastainn/tabular_nn_fastai.py +65 -18
- autogluon/tabular/models/fasttext/fasttext_model.py +3 -1
- autogluon/tabular/models/image_prediction/image_predictor.py +7 -2
- autogluon/tabular/models/knn/knn_model.py +41 -8
- autogluon/tabular/models/lgb/callbacks.py +32 -9
- autogluon/tabular/models/lgb/hyperparameters/searchspaces.py +3 -1
- autogluon/tabular/models/lgb/lgb_model.py +150 -34
- autogluon/tabular/models/lgb/lgb_utils.py +12 -4
- autogluon/tabular/models/lr/hyperparameters/searchspaces.py +5 -1
- autogluon/tabular/models/lr/lr_model.py +40 -10
- autogluon/tabular/models/lr/lr_rapids_model.py +22 -13
- autogluon/tabular/models/mitra/_internal/__init__.py +1 -1
- autogluon/tabular/models/mitra/_internal/config/__init__.py +1 -1
- autogluon/tabular/models/mitra/_internal/config/config_pretrain.py +36 -40
- autogluon/tabular/models/mitra/_internal/config/config_run.py +2 -14
- autogluon/tabular/models/mitra/_internal/config/enums.py +27 -26
- autogluon/tabular/models/mitra/_internal/core/__init__.py +1 -1
- autogluon/tabular/models/mitra/_internal/core/callbacks.py +14 -21
- autogluon/tabular/models/mitra/_internal/core/get_loss.py +10 -12
- autogluon/tabular/models/mitra/_internal/core/get_optimizer.py +17 -32
- autogluon/tabular/models/mitra/_internal/core/get_scheduler.py +12 -27
- autogluon/tabular/models/mitra/_internal/core/prediction_metrics.py +16 -21
- autogluon/tabular/models/mitra/_internal/core/trainer_finetune.py +130 -111
- autogluon/tabular/models/mitra/_internal/data/__init__.py +1 -1
- autogluon/tabular/models/mitra/_internal/data/collator.py +30 -26
- autogluon/tabular/models/mitra/_internal/data/dataset_finetune.py +18 -26
- autogluon/tabular/models/mitra/_internal/data/dataset_split.py +10 -7
- autogluon/tabular/models/mitra/_internal/data/preprocessor.py +70 -100
- autogluon/tabular/models/mitra/_internal/models/__init__.py +1 -1
- autogluon/tabular/models/mitra/_internal/models/base.py +7 -10
- autogluon/tabular/models/mitra/_internal/models/embedding.py +46 -56
- autogluon/tabular/models/mitra/_internal/models/tab2d.py +140 -120
- autogluon/tabular/models/mitra/_internal/utils/__init__.py +1 -1
- autogluon/tabular/models/mitra/_internal/utils/set_seed.py +3 -1
- autogluon/tabular/models/mitra/mitra_model.py +16 -11
- autogluon/tabular/models/mitra/sklearn_interface.py +178 -162
- autogluon/tabular/models/realmlp/realmlp_model.py +28 -15
- autogluon/tabular/models/rf/compilers/onnx.py +1 -1
- autogluon/tabular/models/rf/rf_model.py +45 -12
- autogluon/tabular/models/rf/rf_quantile.py +4 -2
- autogluon/tabular/models/tabdpt/tabdpt_model.py +8 -17
- autogluon/tabular/models/tabicl/tabicl_model.py +8 -1
- autogluon/tabular/models/tabm/_tabm_internal.py +6 -4
- autogluon/tabular/models/tabm/rtdl_num_embeddings.py +80 -127
- autogluon/tabular/models/tabm/tabm_model.py +8 -4
- autogluon/tabular/models/tabm/tabm_reference.py +53 -85
- autogluon/tabular/models/tabpfnmix/_internal/core/callbacks.py +7 -16
- autogluon/tabular/models/tabpfnmix/_internal/core/collator.py +16 -24
- autogluon/tabular/models/tabpfnmix/_internal/core/dataset_split.py +5 -7
- autogluon/tabular/models/tabpfnmix/_internal/core/enums.py +0 -2
- autogluon/tabular/models/tabpfnmix/_internal/core/get_loss.py +0 -1
- autogluon/tabular/models/tabpfnmix/_internal/core/get_optimizer.py +7 -18
- autogluon/tabular/models/tabpfnmix/_internal/core/get_scheduler.py +3 -14
- autogluon/tabular/models/tabpfnmix/_internal/core/trainer_finetune.py +79 -64
- autogluon/tabular/models/tabpfnmix/_internal/core/y_transformer.py +3 -5
- autogluon/tabular/models/tabpfnmix/_internal/data/dataset_finetune.py +17 -30
- autogluon/tabular/models/tabpfnmix/_internal/data/preprocessor.py +15 -35
- autogluon/tabular/models/tabpfnmix/_internal/models/foundation/embedding.py +21 -38
- autogluon/tabular/models/tabpfnmix/_internal/models/foundation/foundation_transformer.py +33 -51
- autogluon/tabular/models/tabpfnmix/_internal/results/prediction_metrics.py +4 -4
- autogluon/tabular/models/tabpfnmix/_internal/tabpfnmix_classifier.py +32 -12
- autogluon/tabular/models/tabpfnmix/_internal/tabpfnmix_regressor.py +32 -13
- autogluon/tabular/models/tabpfnmix/tabpfnmix_model.py +55 -19
- autogluon/tabular/models/tabpfnv2/tabpfnv2_5_model.py +21 -48
- autogluon/tabular/models/tabprep/prep_mixin.py +34 -26
- autogluon/tabular/models/tabular_nn/compilers/onnx.py +36 -8
- autogluon/tabular/models/tabular_nn/torch/tabular_nn_torch.py +130 -36
- autogluon/tabular/models/tabular_nn/torch/tabular_torch_dataset.py +8 -4
- autogluon/tabular/models/tabular_nn/torch/torch_network_modules.py +26 -5
- autogluon/tabular/models/tabular_nn/utils/categorical_encoders.py +41 -24
- autogluon/tabular/models/tabular_nn/utils/data_preprocessor.py +33 -8
- autogluon/tabular/models/tabular_nn/utils/nn_architecture_utils.py +21 -6
- autogluon/tabular/models/xgboost/callbacks.py +9 -3
- autogluon/tabular/models/xgboost/xgboost_model.py +59 -11
- autogluon/tabular/models/xt/xt_model.py +1 -0
- autogluon/tabular/predictor/interpretable_predictor.py +3 -1
- autogluon/tabular/predictor/predictor.py +409 -128
- autogluon/tabular/registry/__init__.py +1 -1
- autogluon/tabular/registry/_ag_model_registry.py +4 -5
- autogluon/tabular/registry/_model_registry.py +1 -0
- autogluon/tabular/testing/fit_helper.py +55 -15
- autogluon/tabular/testing/generate_datasets.py +1 -1
- autogluon/tabular/testing/model_fit_helper.py +10 -4
- autogluon/tabular/trainer/abstract_trainer.py +644 -230
- autogluon/tabular/trainer/auto_trainer.py +19 -8
- autogluon/tabular/trainer/model_presets/presets.py +33 -9
- autogluon/tabular/trainer/model_presets/presets_distill.py +16 -2
- autogluon/tabular/version.py +1 -1
- {autogluon_tabular-1.5.1b20260105.dist-info → autogluon_tabular-1.5.1b20260116.dist-info}/METADATA +26 -26
- {autogluon_tabular-1.5.1b20260105.dist-info → autogluon_tabular-1.5.1b20260116.dist-info}/RECORD +127 -135
- autogluon/tabular/models/tabpfnv2/rfpfn/__init__.py +0 -20
- autogluon/tabular/models/tabpfnv2/rfpfn/configs.py +0 -40
- autogluon/tabular/models/tabpfnv2/rfpfn/scoring_utils.py +0 -201
- autogluon/tabular/models/tabpfnv2/rfpfn/sklearn_based_decision_tree_tabpfn.py +0 -1464
- autogluon/tabular/models/tabpfnv2/rfpfn/sklearn_based_random_forest_tabpfn.py +0 -747
- autogluon/tabular/models/tabpfnv2/rfpfn/sklearn_compat.py +0 -863
- autogluon/tabular/models/tabpfnv2/rfpfn/utils.py +0 -106
- autogluon/tabular/models/tabpfnv2/tabpfnv2_model.py +0 -466
- /autogluon.tabular-1.5.1b20260105-py3.11-nspkg.pth → /autogluon.tabular-1.5.1b20260116-py3.11-nspkg.pth +0 -0
- {autogluon_tabular-1.5.1b20260105.dist-info → autogluon_tabular-1.5.1b20260116.dist-info}/WHEEL +0 -0
- {autogluon_tabular-1.5.1b20260105.dist-info → autogluon_tabular-1.5.1b20260116.dist-info}/licenses/LICENSE +0 -0
- {autogluon_tabular-1.5.1b20260105.dist-info → autogluon_tabular-1.5.1b20260116.dist-info}/licenses/NOTICE +0 -0
- {autogluon_tabular-1.5.1b20260105.dist-info → autogluon_tabular-1.5.1b20260116.dist-info}/namespace_packages.txt +0 -0
- {autogluon_tabular-1.5.1b20260105.dist-info → autogluon_tabular-1.5.1b20260116.dist-info}/top_level.txt +0 -0
- {autogluon_tabular-1.5.1b20260105.dist-info → autogluon_tabular-1.5.1b20260116.dist-info}/zip-safe +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import einops
|
|
3
2
|
import einx
|
|
4
3
|
import torch
|
|
@@ -6,43 +5,35 @@ import torch.nn as nn
|
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
class Tab2DEmbeddingX(torch.nn.Module):
|
|
9
|
-
|
|
10
8
|
def __init__(self, dim: int) -> None:
|
|
11
9
|
super().__init__()
|
|
12
10
|
|
|
13
11
|
self.dim = dim
|
|
14
12
|
self.x_embedding = nn.Linear(1, dim)
|
|
15
13
|
|
|
16
|
-
|
|
17
14
|
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
|
18
|
-
|
|
19
|
-
x = einx.rearrange('b s f -> b s f 1', x)
|
|
15
|
+
x = einx.rearrange("b s f -> b s f 1", x)
|
|
20
16
|
x = self.x_embedding(x)
|
|
21
17
|
|
|
22
18
|
return x
|
|
23
19
|
|
|
24
|
-
|
|
25
20
|
|
|
26
21
|
class Tab2DQuantileEmbeddingX(torch.nn.Module):
|
|
27
|
-
|
|
28
22
|
def __init__(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
self,
|
|
24
|
+
dim: int,
|
|
25
|
+
) -> None:
|
|
33
26
|
super().__init__()
|
|
34
27
|
|
|
35
28
|
self.dim = dim
|
|
36
29
|
|
|
37
|
-
|
|
38
30
|
def forward(
|
|
39
|
-
self,
|
|
40
|
-
x_support: torch.Tensor,
|
|
41
|
-
x_query__: torch.Tensor,
|
|
31
|
+
self,
|
|
32
|
+
x_support: torch.Tensor,
|
|
33
|
+
x_query__: torch.Tensor,
|
|
42
34
|
padding_mask: torch.Tensor,
|
|
43
35
|
feature_mask: torch.Tensor,
|
|
44
36
|
) -> tuple[torch.Tensor, torch.Tensor]:
|
|
45
|
-
|
|
46
37
|
"""
|
|
47
38
|
Syntax:
|
|
48
39
|
b = batch size
|
|
@@ -52,44 +43,44 @@ class Tab2DQuantileEmbeddingX(torch.nn.Module):
|
|
|
52
43
|
"""
|
|
53
44
|
|
|
54
45
|
batch_size = padding_mask.shape[0]
|
|
55
|
-
seq_len = einx.sum(
|
|
56
|
-
feature_count = einx.sum(
|
|
46
|
+
seq_len = einx.sum("b [s]", ~padding_mask)
|
|
47
|
+
feature_count = einx.sum("b [f]", ~feature_mask)
|
|
57
48
|
|
|
58
49
|
# By setting the padded tokens to 9999 we ensure they don't participate in the quantile calculation
|
|
59
50
|
x_support[padding_mask] = 9999
|
|
60
51
|
|
|
61
52
|
q = torch.arange(1, 1000, dtype=torch.float, device=x_support.device) / 1000
|
|
62
53
|
quantiles = torch.quantile(x_support, q=q, dim=1)
|
|
63
|
-
quantiles = einx.rearrange(
|
|
64
|
-
x_support = einx.rearrange(
|
|
65
|
-
x_query__ = einx.rearrange(
|
|
54
|
+
quantiles = einx.rearrange("q b f -> (b f) q", quantiles)
|
|
55
|
+
x_support = einx.rearrange("b s f -> (b f) s", x_support).contiguous()
|
|
56
|
+
x_query__ = einx.rearrange("b s f -> (b f) s", x_query__).contiguous()
|
|
66
57
|
|
|
67
58
|
bucketize = torch.vmap(torch.bucketize, in_dims=(0, 0), out_dims=0)
|
|
68
|
-
x_support = bucketize(x_support, quantiles).float()
|
|
59
|
+
x_support = bucketize(x_support, quantiles).float()
|
|
69
60
|
x_query__ = bucketize(x_query__, quantiles).float()
|
|
70
|
-
x_support = einx.rearrange(
|
|
71
|
-
x_query__ = einx.rearrange(
|
|
61
|
+
x_support = einx.rearrange("(b f) s -> b s f", x_support, b=batch_size).contiguous()
|
|
62
|
+
x_query__ = einx.rearrange("(b f) s -> b s f", x_query__, b=batch_size).contiguous()
|
|
72
63
|
|
|
73
64
|
# If 30% is padded, the minimum will have quantile 0.0 and the maximum will have quantile 0.7 times max_length.
|
|
74
65
|
# Here we correct the quantiles so that the minimum has quantile 0.0 and the maximum has quantile 1.0.
|
|
75
|
-
x_support = x_support / seq_len[:, None, None]
|
|
66
|
+
x_support = x_support / seq_len[:, None, None]
|
|
76
67
|
x_query__ = x_query__ / seq_len[:, None, None]
|
|
77
68
|
|
|
78
69
|
# Make sure that the padding is not used in the calculation of the mean
|
|
79
70
|
x_support[padding_mask] = 0
|
|
80
|
-
x_support_mean = einx.sum(
|
|
71
|
+
x_support_mean = einx.sum("b [s] f", x_support, keepdims=True) / seq_len[:, None, None]
|
|
81
72
|
|
|
82
73
|
x_support = x_support - x_support_mean
|
|
83
74
|
x_query__ = x_query__ - x_support_mean
|
|
84
75
|
|
|
85
76
|
# Make sure that the padding is not used in the calculation of the variance
|
|
86
77
|
x_support[padding_mask] = 0
|
|
87
|
-
x_support_var = einx.sum(
|
|
78
|
+
x_support_var = einx.sum("b [s] f", x_support**2, keepdims=True) / seq_len[:, None, None]
|
|
88
79
|
|
|
89
80
|
x_support = x_support / x_support_var.sqrt()
|
|
90
81
|
x_query__ = x_query__ / x_support_var.sqrt()
|
|
91
82
|
|
|
92
|
-
# In case an x_support feature column contains one unique feature, set the feature to zero
|
|
83
|
+
# In case an x_support feature column contains one unique feature, set the feature to zero
|
|
93
84
|
x_support = torch.where(x_support_var == 0, 0, x_support)
|
|
94
85
|
x_query__ = torch.where(x_support_var == 0, 0, x_query__)
|
|
95
86
|
|
|
@@ -97,7 +88,6 @@ class Tab2DQuantileEmbeddingX(torch.nn.Module):
|
|
|
97
88
|
|
|
98
89
|
|
|
99
90
|
class Tab2DEmbeddingY(torch.nn.Module):
|
|
100
|
-
|
|
101
91
|
def __init__(self, dim: int, n_classes: int) -> None:
|
|
102
92
|
super().__init__()
|
|
103
93
|
|
|
@@ -106,14 +96,14 @@ class Tab2DEmbeddingY(torch.nn.Module):
|
|
|
106
96
|
self.y_embedding_support = nn.Linear(1, dim)
|
|
107
97
|
self.y_embedding_query = nn.Embedding(1, dim)
|
|
108
98
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
99
|
+
def forward(
|
|
100
|
+
self, y_support: torch.Tensor, padding_obs_support: torch.Tensor, n_obs_query: int
|
|
101
|
+
) -> tuple[torch.Tensor, torch.Tensor]:
|
|
112
102
|
batch_size = y_support.shape[0]
|
|
113
103
|
|
|
114
104
|
y_support = y_support.type(torch.float32)
|
|
115
105
|
y_support = y_support / self.n_classes - 0.5
|
|
116
|
-
y_support = einops.rearrange(y_support,
|
|
106
|
+
y_support = einops.rearrange(y_support, "b n -> b n 1")
|
|
117
107
|
|
|
118
108
|
y_support = self.y_embedding_support(y_support)
|
|
119
109
|
y_support[padding_obs_support] = 0
|
|
@@ -122,44 +112,44 @@ class Tab2DEmbeddingY(torch.nn.Module):
|
|
|
122
112
|
y_query = self.y_embedding_query(y_query)
|
|
123
113
|
|
|
124
114
|
return y_support, y_query
|
|
125
|
-
|
|
126
115
|
|
|
127
|
-
class Tab2DEmbeddingYClasses(torch.nn.Module):
|
|
128
116
|
|
|
117
|
+
class Tab2DEmbeddingYClasses(torch.nn.Module):
|
|
129
118
|
def __init__(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
119
|
+
self,
|
|
120
|
+
dim: int,
|
|
121
|
+
n_classes: int,
|
|
122
|
+
) -> None:
|
|
135
123
|
super().__init__()
|
|
136
124
|
|
|
137
125
|
self.n_classes = n_classes
|
|
138
126
|
self.dim = dim
|
|
139
127
|
|
|
140
|
-
self.y_embedding = nn.Embedding(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
128
|
+
self.y_embedding = nn.Embedding(
|
|
129
|
+
n_classes,
|
|
130
|
+
dim,
|
|
131
|
+
)
|
|
132
|
+
self.y_mask = nn.Embedding(1, dim) # masking is also modeled as a separate class
|
|
145
133
|
|
|
134
|
+
def forward(
|
|
135
|
+
self, y_support: torch.Tensor, padding_obs_support: torch.Tensor, n_obs_query: int
|
|
136
|
+
) -> tuple[torch.Tensor, torch.Tensor]:
|
|
146
137
|
batch_size = y_support.shape[0]
|
|
147
138
|
n_obs_support = y_support.shape[1]
|
|
148
139
|
|
|
149
140
|
y_support = y_support.type(torch.int64)
|
|
150
|
-
y_support = einops.rearrange(y_support,
|
|
151
|
-
y_support[padding_obs_support] = 0
|
|
141
|
+
y_support = einops.rearrange(y_support, "b n -> b n 1")
|
|
142
|
+
y_support[padding_obs_support] = 0 # padded tokens are -100 -> set it to zero so nn.Embedding can handle it
|
|
152
143
|
y_support = self.y_embedding(y_support)
|
|
153
|
-
y_support[padding_obs_support] = 0
|
|
154
|
-
|
|
144
|
+
y_support[padding_obs_support] = 0 # just to make sure, set it to zero again
|
|
145
|
+
|
|
155
146
|
y_query = torch.zeros((batch_size, n_obs_query, 1), device=y_support.device, dtype=torch.int64)
|
|
156
147
|
y_query = self.y_mask(y_query)
|
|
157
148
|
|
|
158
149
|
return y_support, y_query
|
|
159
|
-
|
|
160
150
|
|
|
161
|
-
class Tab2DEmbeddingYRegression(torch.nn.Module):
|
|
162
151
|
|
|
152
|
+
class Tab2DEmbeddingYRegression(torch.nn.Module):
|
|
163
153
|
def __init__(self, dim: int) -> None:
|
|
164
154
|
super().__init__()
|
|
165
155
|
|
|
@@ -167,16 +157,16 @@ class Tab2DEmbeddingYRegression(torch.nn.Module):
|
|
|
167
157
|
self.y_embedding = nn.Linear(1, dim)
|
|
168
158
|
self.y_mask = nn.Embedding(1, dim)
|
|
169
159
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
160
|
+
def forward(
|
|
161
|
+
self, y_support: torch.Tensor, padding_obs_support: torch.Tensor, n_obs_query: int
|
|
162
|
+
) -> tuple[torch.Tensor, torch.Tensor]:
|
|
173
163
|
batch_size = y_support.shape[0]
|
|
174
164
|
y_support = y_support.type(torch.float32)
|
|
175
|
-
y_support = einops.rearrange(y_support,
|
|
165
|
+
y_support = einops.rearrange(y_support, "b n -> b n 1")
|
|
176
166
|
y_support = self.y_embedding(y_support)
|
|
177
167
|
y_support[padding_obs_support] = 0
|
|
178
168
|
|
|
179
169
|
y_query = torch.zeros((batch_size, n_obs_query, 1), device=y_support.device, dtype=torch.int64)
|
|
180
170
|
y_query = self.y_mask(y_query)
|
|
181
171
|
|
|
182
|
-
return y_support, y_query
|
|
172
|
+
return y_support, y_query
|