InsurAutoML 0.2.7b0__tar.gz → 0.2.9__tar.gz
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.
- insurautoml-0.2.9/InsurAutoML/VERSION +1 -0
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/__init__.py +189 -262
- insurautoml-0.2.9/InsurAutoML/_optional.py +94 -0
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/balancing/__init__.py +80 -80
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/balancing/base.py +61 -61
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/balancing/mixed_sampling.py +221 -215
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/balancing/over_sampling.py +295 -284
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/balancing/under_sampling.py +755 -705
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/base.py +271 -269
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/constant.py +290 -285
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/datasets/__init__.py +151 -151
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/datasets/image.py +89 -96
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/datasets/tabular.py +1755 -2338
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/datasets/text.py +136 -137
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/encoding/__init__.py +49 -45
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/encoding/base.py +71 -55
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/encoding/encoding.py +284 -276
- insurautoml-0.2.9/InsurAutoML/ext/__init__.py +56 -0
- InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/_encoder_hyperparameter.py → insurautoml-0.2.9/InsurAutoML/ext/suppsplit/__init__.py +41 -42
- InsurAutoML-0.2.7b0/InsurAutoML/utils/_c/_stat.pyx → insurautoml-0.2.9/InsurAutoML/ext/suppsplit/suppsplit/__init__.py +42 -41
- insurautoml-0.2.9/InsurAutoML/ext/suppsplit/suppsplit/split.py +160 -0
- insurautoml-0.2.9/InsurAutoML/ext/suppsplit/suppsplit/utils.py +106 -0
- insurautoml-0.2.9/InsurAutoML/ext/suppsplit/suppsplit_cpp/bindings.cpp +149 -0
- insurautoml-0.2.9/InsurAutoML/ext/suppsplit/suppsplit_cpp/sPlit.cpp +140 -0
- insurautoml-0.2.9/InsurAutoML/ext/suppsplit/suppsplit_cpp/sp.cpp +246 -0
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/feature_selection/__init__.py +144 -184
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/feature_selection/base.py +76 -76
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/feature_selection/embed.py +422 -422
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/feature_selection/filter.py +470 -315
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/feature_selection/hybrid.py +830 -823
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/feature_selection/sklearn.py +911 -905
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/feature_selection/wrapper.py +574 -576
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/hpo/DL.py +85 -85
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/hpo/ML.py +842 -841
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/hpo/__init__.py +60 -53
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/hpo/base.py +2062 -2049
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/hpo/ensemble.py +486 -492
- insurautoml-0.2.9/InsurAutoML/hpo/informed/ML.py +402 -0
- insurautoml-0.2.9/InsurAutoML/hpo/informed/__init__.py +64 -0
- insurautoml-0.2.9/InsurAutoML/hpo/informed/base.py +1221 -0
- insurautoml-0.2.9/InsurAutoML/hpo/informed/fixed.py +181 -0
- insurautoml-0.2.9/InsurAutoML/hpo/informed/informed_ensemble.py +497 -0
- insurautoml-0.2.9/InsurAutoML/hpo/informed/utils.py +488 -0
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/hpo/utils.py +619 -555
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/hyperparameters/__init__.py +145 -139
- insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/balancing_hyperparameter.py +115 -0
- insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/classifier_hyperparameter.py +365 -0
- insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/encoder_hyperparameter.py +68 -0
- insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/feature_selection_hyperparameter.py +274 -0
- insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/imputer_hyperparameter.py +109 -0
- insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/prep_hyperparameter.py +68 -0
- insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/regressor_hyperparameter.py +387 -0
- insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/scaling_hyperparameter.py +80 -0
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/imputation/__init__.py +83 -82
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/imputation/base.py +292 -267
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/imputation/clustering.py +1116 -1113
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/imputation/multiple.py +642 -549
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/imputation/nn.py +793 -782
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/FNN.py +520 -520
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/ML.py +39 -39
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/RNN.py +635 -632
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/__init__.py +244 -320
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/base.py +142 -142
- insurautoml-0.2.9/InsurAutoML/model/catboost.py +120 -0
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/clustering.py +69 -69
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/gam.py +141 -139
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/lightgbm.py +451 -451
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/sklearn_classifiers.py +1355 -1356
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/sklearn_regressors.py +1284 -1275
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/xgboost.py +288 -288
- {InsurAutoML-0.2.7b0/InsurAutoML/utils/_c → insurautoml-0.2.9/InsurAutoML/prep}/__init__.py +46 -53
- insurautoml-0.2.9/InsurAutoML/prep/pipeline.py +316 -0
- insurautoml-0.2.9/InsurAutoML/prep/prep.py +41 -0
- insurautoml-0.2.9/InsurAutoML/prep/utils.py +168 -0
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/scaling/__init__.py +77 -77
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/scaling/base.py +37 -37
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/scaling/scaling.py +866 -868
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/__init__.py +82 -81
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/base.py +394 -374
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/data.py +899 -860
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/eda.py +223 -218
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/file.py +126 -118
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/metadata.py +440 -433
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/optimize.py +2569 -1832
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/stats.py +752 -509
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/tensor.py +263 -263
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/version.py +52 -52
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9/InsurAutoML.egg-info}/PKG-INFO +352 -250
- insurautoml-0.2.9/InsurAutoML.egg-info/SOURCES.txt +137 -0
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML.egg-info/requires.txt +14 -18
- insurautoml-0.2.9/InsurAutoML.egg-info/top_level.txt +5 -0
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/LICENSE +21 -21
- InsurAutoML-0.2.7b0/README.md → insurautoml-0.2.9/PKG-INFO +352 -230
- InsurAutoML-0.2.7b0/InsurAutoML.egg-info/PKG-INFO → insurautoml-0.2.9/README.md +291 -250
- insurautoml-0.2.9/pyproject.toml +120 -0
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/setup.cfg +4 -4
- insurautoml-0.2.9/setup.py +379 -0
- insurautoml-0.2.9/tests/test_balancing/test_balancing.py +72 -0
- insurautoml-0.2.9/tests/test_base.py +72 -0
- insurautoml-0.2.9/tests/test_datasets/test_datasets_hf.py +164 -0
- insurautoml-0.2.9/tests/test_datasets/test_datasets_tabular.py +343 -0
- insurautoml-0.2.9/tests/test_encoder/test_encoder.py +95 -0
- insurautoml-0.2.9/tests/test_feature_selection/test_feature_selection.py +261 -0
- insurautoml-0.2.9/tests/test_feature_selection/test_feature_selection_more.py +736 -0
- insurautoml-0.2.9/tests/test_feature_selection/test_feature_selection_wrapper.py +226 -0
- insurautoml-0.2.9/tests/test_hpo/test_hpo.py +434 -0
- insurautoml-0.2.9/tests/test_hpo/test_hpo_2.py +435 -0
- insurautoml-0.2.9/tests/test_hpo/test_hpo_3.py +531 -0
- insurautoml-0.2.9/tests/test_hpo/test_hpo_ensemble.py +212 -0
- insurautoml-0.2.9/tests/test_hpo/test_hpo_ensemble_voting.py +237 -0
- insurautoml-0.2.9/tests/test_hpo/test_hpo_spaces.py +147 -0
- insurautoml-0.2.9/tests/test_hyperparameters/test_hyperparameters.py +109 -0
- insurautoml-0.2.9/tests/test_imputer/test_imputer.py +245 -0
- insurautoml-0.2.9/tests/test_imputer/test_imputer_clustering.py +381 -0
- insurautoml-0.2.9/tests/test_imputer/test_imputer_more.py +424 -0
- insurautoml-0.2.9/tests/test_imputer/test_imputer_nn.py +257 -0
- insurautoml-0.2.9/tests/test_informed/conftest.py +110 -0
- insurautoml-0.2.9/tests/test_informed/test_informed_automl.py +172 -0
- insurautoml-0.2.9/tests/test_informed/test_informed_ensemble.py +185 -0
- insurautoml-0.2.9/tests/test_informed/test_informed_objective.py +217 -0
- insurautoml-0.2.9/tests/test_informed/test_informed_pipeline.py +138 -0
- insurautoml-0.2.9/tests/test_informed/test_informed_prep.py +175 -0
- insurautoml-0.2.9/tests/test_model/test_model.py +208 -0
- insurautoml-0.2.9/tests/test_model/test_model_2.py +350 -0
- insurautoml-0.2.9/tests/test_model/test_model_nn.py +343 -0
- insurautoml-0.2.9/tests/test_scaling/test_scaling.py +148 -0
- insurautoml-0.2.9/tests/test_utils/test_metadata.py +73 -0
- insurautoml-0.2.9/tests/test_utils/test_optional.py +151 -0
- insurautoml-0.2.9/tests/test_utils/test_utils.py +126 -0
- insurautoml-0.2.9/tests/test_utils/test_utils_base.py +223 -0
- insurautoml-0.2.9/tests/test_utils/test_utils_data.py +218 -0
- insurautoml-0.2.9/tests/test_utils/test_utils_data_extra.py +398 -0
- insurautoml-0.2.9/tests/test_utils/test_utils_metadata_extra.py +290 -0
- insurautoml-0.2.9/tests/test_utils/test_utils_optimize.py +222 -0
- insurautoml-0.2.9/tests/test_utils/test_utils_optimize_more.py +272 -0
- insurautoml-0.2.9/tests/test_utils/test_utils_stat.py +189 -0
- insurautoml-0.2.9/tests/test_utils/test_utils_stats_extra.py +288 -0
- insurautoml-0.2.9/tests/test_utils/test_utils_tensor.py +143 -0
- InsurAutoML-0.2.7b0/InsurAutoML/feature_selection/autosklearn.py +0 -644
- InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/__init__.py +0 -47
- InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/_balancing_hyperparameter.py +0 -105
- InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/_classifier_hyperparameter.py +0 -269
- InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/_feature_selection_hyperparameter.py +0 -272
- InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/_imputer_hyperparameter.py +0 -74
- InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/_regressor_hyperparameter.py +0 -282
- InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/_scaling_hyperparameter.py +0 -55
- InsurAutoML-0.2.7b0/InsurAutoML/model/autosklearn.py +0 -1552
- InsurAutoML-0.2.7b0/InsurAutoML/utils/_c/_base.pyx +0 -154
- InsurAutoML-0.2.7b0/InsurAutoML.egg-info/SOURCES.txt +0 -80
- InsurAutoML-0.2.7b0/InsurAutoML.egg-info/not-zip-safe +0 -1
- InsurAutoML-0.2.7b0/InsurAutoML.egg-info/top_level.txt +0 -1
- InsurAutoML-0.2.7b0/setup.py +0 -484
- {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML.egg-info/dependency_links.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.2.9
|
|
@@ -1,262 +1,189 @@
|
|
|
1
|
-
"""
|
|
2
|
-
File Name: __init__.py
|
|
3
|
-
Author: Panyi Dong
|
|
4
|
-
GitHub: https://github.com/PanyiDong/
|
|
5
|
-
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
|
|
6
|
-
|
|
7
|
-
Project: InsurAutoML
|
|
8
|
-
Latest Version: 0.2.
|
|
9
|
-
Relative Path: /InsurAutoML/__init__.py
|
|
10
|
-
File Created: Wednesday, 16th November 2022 7:23:10 pm
|
|
11
|
-
Author: Panyi Dong (panyid2@illinois.edu)
|
|
12
|
-
|
|
13
|
-
-----
|
|
14
|
-
Last Modified: Thursday,
|
|
15
|
-
Modified By: Panyi Dong (panyid2@illinois.edu)
|
|
16
|
-
|
|
17
|
-
-----
|
|
18
|
-
MIT License
|
|
19
|
-
|
|
20
|
-
Copyright (c) 2022 -
|
|
21
|
-
|
|
22
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
23
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
24
|
-
in the Software without restriction, including without limitation the rights
|
|
25
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
26
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
27
|
-
furnished to do so, subject to the following conditions:
|
|
28
|
-
|
|
29
|
-
The above copyright notice and this permission notice shall be included in all
|
|
30
|
-
copies or substantial portions of the Software.
|
|
31
|
-
|
|
32
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
33
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
34
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
35
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
36
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
37
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
38
|
-
SOFTWARE.
|
|
39
|
-
"""
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
from .
|
|
43
|
-
from .
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
#
|
|
55
|
-
#
|
|
56
|
-
#
|
|
57
|
-
|
|
58
|
-
#
|
|
59
|
-
|
|
60
|
-
#
|
|
61
|
-
#
|
|
62
|
-
#
|
|
63
|
-
#
|
|
64
|
-
#
|
|
65
|
-
#
|
|
66
|
-
#
|
|
67
|
-
#
|
|
68
|
-
#
|
|
69
|
-
#
|
|
70
|
-
|
|
71
|
-
#
|
|
72
|
-
|
|
73
|
-
#
|
|
74
|
-
#
|
|
75
|
-
#
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
# from .
|
|
87
|
-
|
|
88
|
-
#
|
|
89
|
-
#
|
|
90
|
-
#
|
|
91
|
-
#
|
|
92
|
-
#
|
|
93
|
-
#
|
|
94
|
-
#
|
|
95
|
-
#
|
|
96
|
-
#
|
|
97
|
-
#
|
|
98
|
-
#
|
|
99
|
-
#
|
|
100
|
-
|
|
101
|
-
#
|
|
102
|
-
|
|
103
|
-
#
|
|
104
|
-
#
|
|
105
|
-
#
|
|
106
|
-
#
|
|
107
|
-
#
|
|
108
|
-
#
|
|
109
|
-
#
|
|
110
|
-
#
|
|
111
|
-
#
|
|
112
|
-
#
|
|
113
|
-
|
|
114
|
-
#
|
|
115
|
-
|
|
116
|
-
#
|
|
117
|
-
#
|
|
118
|
-
#
|
|
119
|
-
#
|
|
120
|
-
#
|
|
121
|
-
#
|
|
122
|
-
#
|
|
123
|
-
#
|
|
124
|
-
#
|
|
125
|
-
|
|
126
|
-
#
|
|
127
|
-
|
|
128
|
-
#
|
|
129
|
-
#
|
|
130
|
-
#
|
|
131
|
-
#
|
|
132
|
-
#
|
|
133
|
-
#
|
|
134
|
-
|
|
135
|
-
#
|
|
136
|
-
|
|
137
|
-
# from
|
|
138
|
-
#
|
|
139
|
-
#
|
|
140
|
-
#
|
|
141
|
-
#
|
|
142
|
-
#
|
|
143
|
-
#
|
|
144
|
-
#
|
|
145
|
-
#
|
|
146
|
-
#
|
|
147
|
-
#
|
|
148
|
-
#
|
|
149
|
-
#
|
|
150
|
-
#
|
|
151
|
-
#
|
|
152
|
-
#
|
|
153
|
-
#
|
|
154
|
-
#
|
|
155
|
-
#
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
#
|
|
161
|
-
|
|
162
|
-
#
|
|
163
|
-
|
|
164
|
-
#
|
|
165
|
-
|
|
166
|
-
#
|
|
167
|
-
# "
|
|
168
|
-
# "
|
|
169
|
-
# "
|
|
170
|
-
#
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
"
|
|
180
|
-
"train_test_split",
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
|
|
190
|
-
"t_score",
|
|
191
|
-
"ANOVA",
|
|
192
|
-
"as_dataframe",
|
|
193
|
-
"type_of_task",
|
|
194
|
-
"formatting",
|
|
195
|
-
"Timer",
|
|
196
|
-
"unify_nan",
|
|
197
|
-
"remove_index_columns",
|
|
198
|
-
"get_missing_matrix",
|
|
199
|
-
"SimpleImputer", # _missing
|
|
200
|
-
"DummyImputer",
|
|
201
|
-
"JointImputer",
|
|
202
|
-
"ExpectationMaximization",
|
|
203
|
-
"KNNImputer",
|
|
204
|
-
"MissForestImputer",
|
|
205
|
-
"MICE",
|
|
206
|
-
"GAIN",
|
|
207
|
-
"AAI_kNN",
|
|
208
|
-
"KMI",
|
|
209
|
-
"CMI",
|
|
210
|
-
"k_Prototype_NN",
|
|
211
|
-
"DataEncoding", # _encoding
|
|
212
|
-
"MinMaxScale", # _scaling
|
|
213
|
-
"Standardize",
|
|
214
|
-
"Normalize",
|
|
215
|
-
"RobustScale",
|
|
216
|
-
"PowerTransformer",
|
|
217
|
-
"QuantileTransformer",
|
|
218
|
-
"Winsorization",
|
|
219
|
-
"Feature_Manipulation",
|
|
220
|
-
"Feature_Truncation",
|
|
221
|
-
"SimpleRandomOverSampling", # _imbalance
|
|
222
|
-
"SimpleRandomUnderSampling",
|
|
223
|
-
"TomekLink",
|
|
224
|
-
"EditedNearestNeighbor",
|
|
225
|
-
"CondensedNearestNeighbor",
|
|
226
|
-
"OneSidedSelection",
|
|
227
|
-
"CNN_TomekLink",
|
|
228
|
-
"Smote",
|
|
229
|
-
"Smote_TomekLink",
|
|
230
|
-
"Smote_ENN",
|
|
231
|
-
"LDASelection", # _feature_selection
|
|
232
|
-
"PCA_FeatureSelection",
|
|
233
|
-
"RBFSampler",
|
|
234
|
-
"FeatureFilter",
|
|
235
|
-
"ASFFS",
|
|
236
|
-
"GeneticAlgorithm",
|
|
237
|
-
"densifier", # from sklearn
|
|
238
|
-
"extra_trees_preproc_for_classification",
|
|
239
|
-
"extra_trees_preproc_for_regression",
|
|
240
|
-
"fast_ica",
|
|
241
|
-
"feature_agglomeration",
|
|
242
|
-
"kernel_pca",
|
|
243
|
-
"kitchen_sinks",
|
|
244
|
-
"liblinear_svc_preprocessor",
|
|
245
|
-
"nystroem_sampler",
|
|
246
|
-
"pca",
|
|
247
|
-
"polynomial",
|
|
248
|
-
"random_trees_embedding",
|
|
249
|
-
# 'select_percentile',
|
|
250
|
-
"select_percentile_classification",
|
|
251
|
-
"select_percentile_regression",
|
|
252
|
-
"select_rates_classification",
|
|
253
|
-
"select_rates_regression",
|
|
254
|
-
"truncatedSVD",
|
|
255
|
-
"classifiers", # _model
|
|
256
|
-
"regressors",
|
|
257
|
-
"AutoTabular", # _model_selection
|
|
258
|
-
"AutoTabularClassifier",
|
|
259
|
-
"AutoTabularRegressor",
|
|
260
|
-
"AutoTextClassifier",
|
|
261
|
-
"AutoNextWordPrediction",
|
|
262
|
-
]
|
|
1
|
+
"""
|
|
2
|
+
File Name: __init__.py
|
|
3
|
+
Author: Panyi Dong
|
|
4
|
+
GitHub: https://github.com/PanyiDong/
|
|
5
|
+
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
|
|
6
|
+
|
|
7
|
+
Project: InsurAutoML
|
|
8
|
+
Latest Version: 0.2.6
|
|
9
|
+
Relative Path: /InsurAutoML/__init__.py
|
|
10
|
+
File Created: Wednesday, 16th November 2022 7:23:10 pm
|
|
11
|
+
Author: Panyi Dong (panyid2@illinois.edu)
|
|
12
|
+
|
|
13
|
+
-----
|
|
14
|
+
Last Modified: Thursday, 4th December 2025 1:14:46 pm
|
|
15
|
+
Modified By: Panyi Dong (panyid2@illinois.edu)
|
|
16
|
+
|
|
17
|
+
-----
|
|
18
|
+
MIT License
|
|
19
|
+
|
|
20
|
+
Copyright (c) 2022 - 2025, Panyi Dong
|
|
21
|
+
|
|
22
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
23
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
24
|
+
in the Software without restriction, including without limitation the rights
|
|
25
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
26
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
27
|
+
furnished to do so, subject to the following conditions:
|
|
28
|
+
|
|
29
|
+
The above copyright notice and this permission notice shall be included in all
|
|
30
|
+
copies or substantial portions of the Software.
|
|
31
|
+
|
|
32
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
33
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
34
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
35
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
36
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
37
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
38
|
+
SOFTWARE.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
from .version import _get_version
|
|
42
|
+
from .base import no_processing, load_data, set_seed
|
|
43
|
+
from .hpo import (
|
|
44
|
+
AutoTabular,
|
|
45
|
+
AutoTabularClassifier,
|
|
46
|
+
AutoTabularRegressor,
|
|
47
|
+
InformedAutoTabular,
|
|
48
|
+
InformedAutoTabularRegressor,
|
|
49
|
+
InformedAutoTabularClassifier,
|
|
50
|
+
# AutoTextClassifier,
|
|
51
|
+
# AutoNextWordPrediction,
|
|
52
|
+
)
|
|
53
|
+
from .utils import (
|
|
54
|
+
# random_guess,
|
|
55
|
+
# random_index,
|
|
56
|
+
# random_list,
|
|
57
|
+
# is_date,
|
|
58
|
+
# feature_rounding,
|
|
59
|
+
train_test_split,
|
|
60
|
+
# minloc,
|
|
61
|
+
# maxloc,
|
|
62
|
+
# True_index,
|
|
63
|
+
# nan_cov,
|
|
64
|
+
# class_means,
|
|
65
|
+
# empirical_covariance,
|
|
66
|
+
# class_cov,
|
|
67
|
+
# Pearson_Corr,
|
|
68
|
+
# MI,
|
|
69
|
+
# t_score,
|
|
70
|
+
# ANOVA,
|
|
71
|
+
# as_dataframe,
|
|
72
|
+
type_of_task,
|
|
73
|
+
# formatting,
|
|
74
|
+
# Timer,
|
|
75
|
+
# unify_nan,
|
|
76
|
+
# remove_index_columns,
|
|
77
|
+
# get_missing_matrix,
|
|
78
|
+
EDA,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
__version__ = _get_version()
|
|
82
|
+
|
|
83
|
+
# read version from file
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# from ._encoding import DataEncoding
|
|
87
|
+
|
|
88
|
+
# from ._imputation import (
|
|
89
|
+
# SimpleImputer,
|
|
90
|
+
# DummyImputer,
|
|
91
|
+
# JointImputer,
|
|
92
|
+
# ExpectationMaximization,
|
|
93
|
+
# KNNImputer,
|
|
94
|
+
# MissForestImputer,
|
|
95
|
+
# MICE,
|
|
96
|
+
# GAIN,
|
|
97
|
+
# AAI_kNN,
|
|
98
|
+
# KMI,
|
|
99
|
+
# CMI,
|
|
100
|
+
# k_Prototype_NN,
|
|
101
|
+
# )
|
|
102
|
+
|
|
103
|
+
# from ._balancing import (
|
|
104
|
+
# SimpleRandomOverSampling,
|
|
105
|
+
# SimpleRandomUnderSampling,
|
|
106
|
+
# TomekLink,
|
|
107
|
+
# EditedNearestNeighbor,
|
|
108
|
+
# CondensedNearestNeighbor,
|
|
109
|
+
# OneSidedSelection,
|
|
110
|
+
# CNN_TomekLink,
|
|
111
|
+
# Smote,
|
|
112
|
+
# Smote_TomekLink,
|
|
113
|
+
# Smote_ENN,
|
|
114
|
+
# )
|
|
115
|
+
|
|
116
|
+
# from ._scaling import (
|
|
117
|
+
# MinMaxScale,
|
|
118
|
+
# Standardize,
|
|
119
|
+
# Normalize,
|
|
120
|
+
# RobustScale,
|
|
121
|
+
# PowerTransformer,
|
|
122
|
+
# QuantileTransformer,
|
|
123
|
+
# Winsorization,
|
|
124
|
+
# Feature_Manipulation,
|
|
125
|
+
# Feature_Truncation,
|
|
126
|
+
# )
|
|
127
|
+
|
|
128
|
+
# from ._feature_selection import (
|
|
129
|
+
# PCA_FeatureSelection,
|
|
130
|
+
# LDASelection,
|
|
131
|
+
# FeatureFilter,
|
|
132
|
+
# RBFSampler,
|
|
133
|
+
# ASFFS,
|
|
134
|
+
# GeneticAlgorithm,
|
|
135
|
+
# )
|
|
136
|
+
|
|
137
|
+
# extracted from sklearn
|
|
138
|
+
# not all used in the pipeline
|
|
139
|
+
# from ._feature_selection import (
|
|
140
|
+
# Densifier,
|
|
141
|
+
# ExtraTreesPreprocessorClassification,
|
|
142
|
+
# ExtraTreesPreprocessorRegression,
|
|
143
|
+
# FastICA,
|
|
144
|
+
# FeatureAgglomeration,
|
|
145
|
+
# KernelPCA,
|
|
146
|
+
# RandomKitchenSinks,
|
|
147
|
+
# LibLinear_Preprocessor,
|
|
148
|
+
# Nystroem,
|
|
149
|
+
# PCA,
|
|
150
|
+
# PolynomialFeatures,
|
|
151
|
+
# RandomTreesEmbedding,
|
|
152
|
+
# SelectPercentileClassification,
|
|
153
|
+
# SelectPercentileRegression,
|
|
154
|
+
# SelectClassificationRates,
|
|
155
|
+
# SelectRegressionRates,
|
|
156
|
+
# TruncatedSVD,
|
|
157
|
+
# )
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
# from ._model import classifiers, regressors
|
|
161
|
+
|
|
162
|
+
# base = {"load_data": load_data}
|
|
163
|
+
|
|
164
|
+
# encoders = {"DataEncoding": DataEncoding}
|
|
165
|
+
|
|
166
|
+
# model_selection = {
|
|
167
|
+
# "AutoTabular": AutoTabular,
|
|
168
|
+
# "AutoTabularClassifier": AutoTabularClassifier,
|
|
169
|
+
# "AutoTabularRegressor": AutoTabularRegressor,
|
|
170
|
+
# "AutoTextClassifier": AutoTextClassifier,
|
|
171
|
+
# "AutoNextWordPrediction": AutoNextWordPrediction,
|
|
172
|
+
# }
|
|
173
|
+
|
|
174
|
+
# public names of the package (the submodules export the individual components,
|
|
175
|
+
# e.g. InsurAutoML.encoding, InsurAutoML.imputation, InsurAutoML.model)
|
|
176
|
+
__all__ = [
|
|
177
|
+
"load_data", # _base
|
|
178
|
+
"no_processing",
|
|
179
|
+
"set_seed",
|
|
180
|
+
"train_test_split", # _utils
|
|
181
|
+
"type_of_task",
|
|
182
|
+
"EDA",
|
|
183
|
+
"AutoTabular", # _model_selection
|
|
184
|
+
"AutoTabularClassifier",
|
|
185
|
+
"AutoTabularRegressor",
|
|
186
|
+
"InformedAutoTabular",
|
|
187
|
+
"InformedAutoTabularRegressor",
|
|
188
|
+
"InformedAutoTabularClassifier",
|
|
189
|
+
]
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"""
|
|
2
|
+
File: _optional.py
|
|
3
|
+
Author: Panyi Dong
|
|
4
|
+
GitHub: https://github.com/PanyiDong/
|
|
5
|
+
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)
|
|
6
|
+
|
|
7
|
+
Project: InsurAutoML
|
|
8
|
+
Relative Path: /InsurAutoML/_optional.py
|
|
9
|
+
|
|
10
|
+
Availability of the optional "informed" installation.
|
|
11
|
+
|
|
12
|
+
The informed pipelines (InformedAutoTabular*, InsurAutoML.prep) need the compiled
|
|
13
|
+
C++ extension in InsurAutoML.ext (SPlit) and the extra Python
|
|
14
|
+
dependencies (missforest, ...). They are only built/installed with
|
|
15
|
+
|
|
16
|
+
INFORMEDAUTOML=1 pip install "InsurAutoML[informed]"
|
|
17
|
+
|
|
18
|
+
The checks below do not import anything, so a default installation can import
|
|
19
|
+
InsurAutoML without the optional components.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
import importlib.util
|
|
25
|
+
import os
|
|
26
|
+
from importlib.machinery import EXTENSION_SUFFIXES
|
|
27
|
+
from typing import List
|
|
28
|
+
|
|
29
|
+
INFORMED_INSTALL_CMD = 'INFORMEDAUTOML=1 pip install "InsurAutoML[informed]"'
|
|
30
|
+
# an existing (normal) installation is kept by pip as "already satisfied", reinstall
|
|
31
|
+
# InsurAutoML itself to build the C++ extension
|
|
32
|
+
INFORMED_REINSTALL_CMD = (
|
|
33
|
+
"INFORMEDAUTOML=1 pip install --force-reinstall --no-deps --no-cache-dir "
|
|
34
|
+
"InsurAutoML"
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
# Python packages only needed by the informed pipelines
|
|
38
|
+
INFORMED_PACKAGES = ["missforest"]
|
|
39
|
+
|
|
40
|
+
# compiled extensions: (sub-package of InsurAutoML.ext, extension module name)
|
|
41
|
+
INFORMED_EXTENSIONS = [
|
|
42
|
+
("suppsplit", "suppsplit_cpp"),
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
_EXT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ext")
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class InformedNotInstalledError(ImportError):
|
|
49
|
+
"""The optional informed installation is missing."""
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def missing_informed_components() -> List[str]:
|
|
53
|
+
"""Names of the missing informed components (empty if all are available)."""
|
|
54
|
+
missing = [
|
|
55
|
+
package
|
|
56
|
+
for package in INFORMED_PACKAGES
|
|
57
|
+
if importlib.util.find_spec(package) is None
|
|
58
|
+
]
|
|
59
|
+
for subpackage, module in INFORMED_EXTENSIONS:
|
|
60
|
+
# look for the compiled extension file (e.g. suppsplit_cpp.cpython-312-*.so)
|
|
61
|
+
# without importing; the C++ source folder has the same name as the module
|
|
62
|
+
folder = os.path.join(_EXT_DIR, subpackage)
|
|
63
|
+
if not any(
|
|
64
|
+
os.path.isfile(os.path.join(folder, module + suffix))
|
|
65
|
+
for suffix in EXTENSION_SUFFIXES
|
|
66
|
+
):
|
|
67
|
+
missing.append("InsurAutoML.ext.{}.{}".format(subpackage, module))
|
|
68
|
+
|
|
69
|
+
return missing
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def informed_available() -> bool:
|
|
73
|
+
"""Whether the informed pipelines can be used."""
|
|
74
|
+
return len(missing_informed_components()) == 0
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def informed_not_installed_error(feature: str = "InformedAutoTabular") -> ImportError:
|
|
78
|
+
"""Error asking the user to install the informed version."""
|
|
79
|
+
return InformedNotInstalledError(
|
|
80
|
+
"{} is not available, the InformedAutoML version is not installed "
|
|
81
|
+
"(missing: {}).\nInstall it with:\n {}\nIf InsurAutoML is already installed, "
|
|
82
|
+
"also rebuild it with the C++ extension:\n {}".format(
|
|
83
|
+
feature,
|
|
84
|
+
", ".join(missing_informed_components()),
|
|
85
|
+
INFORMED_INSTALL_CMD,
|
|
86
|
+
INFORMED_REINSTALL_CMD,
|
|
87
|
+
)
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def require_informed(feature: str = "InformedAutoTabular") -> None:
|
|
92
|
+
"""Raise InformedNotInstalledError if the informed installation is missing."""
|
|
93
|
+
if not informed_available():
|
|
94
|
+
raise informed_not_installed_error(feature)
|