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.
Files changed (153) hide show
  1. insurautoml-0.2.9/InsurAutoML/VERSION +1 -0
  2. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/__init__.py +189 -262
  3. insurautoml-0.2.9/InsurAutoML/_optional.py +94 -0
  4. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/balancing/__init__.py +80 -80
  5. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/balancing/base.py +61 -61
  6. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/balancing/mixed_sampling.py +221 -215
  7. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/balancing/over_sampling.py +295 -284
  8. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/balancing/under_sampling.py +755 -705
  9. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/base.py +271 -269
  10. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/constant.py +290 -285
  11. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/datasets/__init__.py +151 -151
  12. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/datasets/image.py +89 -96
  13. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/datasets/tabular.py +1755 -2338
  14. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/datasets/text.py +136 -137
  15. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/encoding/__init__.py +49 -45
  16. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/encoding/base.py +71 -55
  17. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/encoding/encoding.py +284 -276
  18. insurautoml-0.2.9/InsurAutoML/ext/__init__.py +56 -0
  19. InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/_encoder_hyperparameter.py → insurautoml-0.2.9/InsurAutoML/ext/suppsplit/__init__.py +41 -42
  20. InsurAutoML-0.2.7b0/InsurAutoML/utils/_c/_stat.pyx → insurautoml-0.2.9/InsurAutoML/ext/suppsplit/suppsplit/__init__.py +42 -41
  21. insurautoml-0.2.9/InsurAutoML/ext/suppsplit/suppsplit/split.py +160 -0
  22. insurautoml-0.2.9/InsurAutoML/ext/suppsplit/suppsplit/utils.py +106 -0
  23. insurautoml-0.2.9/InsurAutoML/ext/suppsplit/suppsplit_cpp/bindings.cpp +149 -0
  24. insurautoml-0.2.9/InsurAutoML/ext/suppsplit/suppsplit_cpp/sPlit.cpp +140 -0
  25. insurautoml-0.2.9/InsurAutoML/ext/suppsplit/suppsplit_cpp/sp.cpp +246 -0
  26. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/feature_selection/__init__.py +144 -184
  27. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/feature_selection/base.py +76 -76
  28. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/feature_selection/embed.py +422 -422
  29. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/feature_selection/filter.py +470 -315
  30. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/feature_selection/hybrid.py +830 -823
  31. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/feature_selection/sklearn.py +911 -905
  32. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/feature_selection/wrapper.py +574 -576
  33. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/hpo/DL.py +85 -85
  34. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/hpo/ML.py +842 -841
  35. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/hpo/__init__.py +60 -53
  36. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/hpo/base.py +2062 -2049
  37. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/hpo/ensemble.py +486 -492
  38. insurautoml-0.2.9/InsurAutoML/hpo/informed/ML.py +402 -0
  39. insurautoml-0.2.9/InsurAutoML/hpo/informed/__init__.py +64 -0
  40. insurautoml-0.2.9/InsurAutoML/hpo/informed/base.py +1221 -0
  41. insurautoml-0.2.9/InsurAutoML/hpo/informed/fixed.py +181 -0
  42. insurautoml-0.2.9/InsurAutoML/hpo/informed/informed_ensemble.py +497 -0
  43. insurautoml-0.2.9/InsurAutoML/hpo/informed/utils.py +488 -0
  44. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/hpo/utils.py +619 -555
  45. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/hyperparameters/__init__.py +145 -139
  46. insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/balancing_hyperparameter.py +115 -0
  47. insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/classifier_hyperparameter.py +365 -0
  48. insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/encoder_hyperparameter.py +68 -0
  49. insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/feature_selection_hyperparameter.py +274 -0
  50. insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/imputer_hyperparameter.py +109 -0
  51. insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/prep_hyperparameter.py +68 -0
  52. insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/regressor_hyperparameter.py +387 -0
  53. insurautoml-0.2.9/InsurAutoML/hyperparameters/ray/scaling_hyperparameter.py +80 -0
  54. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/imputation/__init__.py +83 -82
  55. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/imputation/base.py +292 -267
  56. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/imputation/clustering.py +1116 -1113
  57. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/imputation/multiple.py +642 -549
  58. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/imputation/nn.py +793 -782
  59. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/FNN.py +520 -520
  60. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/ML.py +39 -39
  61. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/RNN.py +635 -632
  62. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/__init__.py +244 -320
  63. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/base.py +142 -142
  64. insurautoml-0.2.9/InsurAutoML/model/catboost.py +120 -0
  65. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/clustering.py +69 -69
  66. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/gam.py +141 -139
  67. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/lightgbm.py +451 -451
  68. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/sklearn_classifiers.py +1355 -1356
  69. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/sklearn_regressors.py +1284 -1275
  70. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/model/xgboost.py +288 -288
  71. {InsurAutoML-0.2.7b0/InsurAutoML/utils/_c → insurautoml-0.2.9/InsurAutoML/prep}/__init__.py +46 -53
  72. insurautoml-0.2.9/InsurAutoML/prep/pipeline.py +316 -0
  73. insurautoml-0.2.9/InsurAutoML/prep/prep.py +41 -0
  74. insurautoml-0.2.9/InsurAutoML/prep/utils.py +168 -0
  75. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/scaling/__init__.py +77 -77
  76. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/scaling/base.py +37 -37
  77. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/scaling/scaling.py +866 -868
  78. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/__init__.py +82 -81
  79. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/base.py +394 -374
  80. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/data.py +899 -860
  81. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/eda.py +223 -218
  82. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/file.py +126 -118
  83. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/metadata.py +440 -433
  84. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/optimize.py +2569 -1832
  85. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/stats.py +752 -509
  86. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/utils/tensor.py +263 -263
  87. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML/version.py +52 -52
  88. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9/InsurAutoML.egg-info}/PKG-INFO +352 -250
  89. insurautoml-0.2.9/InsurAutoML.egg-info/SOURCES.txt +137 -0
  90. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/InsurAutoML.egg-info/requires.txt +14 -18
  91. insurautoml-0.2.9/InsurAutoML.egg-info/top_level.txt +5 -0
  92. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/LICENSE +21 -21
  93. InsurAutoML-0.2.7b0/README.md → insurautoml-0.2.9/PKG-INFO +352 -230
  94. InsurAutoML-0.2.7b0/InsurAutoML.egg-info/PKG-INFO → insurautoml-0.2.9/README.md +291 -250
  95. insurautoml-0.2.9/pyproject.toml +120 -0
  96. {InsurAutoML-0.2.7b0 → insurautoml-0.2.9}/setup.cfg +4 -4
  97. insurautoml-0.2.9/setup.py +379 -0
  98. insurautoml-0.2.9/tests/test_balancing/test_balancing.py +72 -0
  99. insurautoml-0.2.9/tests/test_base.py +72 -0
  100. insurautoml-0.2.9/tests/test_datasets/test_datasets_hf.py +164 -0
  101. insurautoml-0.2.9/tests/test_datasets/test_datasets_tabular.py +343 -0
  102. insurautoml-0.2.9/tests/test_encoder/test_encoder.py +95 -0
  103. insurautoml-0.2.9/tests/test_feature_selection/test_feature_selection.py +261 -0
  104. insurautoml-0.2.9/tests/test_feature_selection/test_feature_selection_more.py +736 -0
  105. insurautoml-0.2.9/tests/test_feature_selection/test_feature_selection_wrapper.py +226 -0
  106. insurautoml-0.2.9/tests/test_hpo/test_hpo.py +434 -0
  107. insurautoml-0.2.9/tests/test_hpo/test_hpo_2.py +435 -0
  108. insurautoml-0.2.9/tests/test_hpo/test_hpo_3.py +531 -0
  109. insurautoml-0.2.9/tests/test_hpo/test_hpo_ensemble.py +212 -0
  110. insurautoml-0.2.9/tests/test_hpo/test_hpo_ensemble_voting.py +237 -0
  111. insurautoml-0.2.9/tests/test_hpo/test_hpo_spaces.py +147 -0
  112. insurautoml-0.2.9/tests/test_hyperparameters/test_hyperparameters.py +109 -0
  113. insurautoml-0.2.9/tests/test_imputer/test_imputer.py +245 -0
  114. insurautoml-0.2.9/tests/test_imputer/test_imputer_clustering.py +381 -0
  115. insurautoml-0.2.9/tests/test_imputer/test_imputer_more.py +424 -0
  116. insurautoml-0.2.9/tests/test_imputer/test_imputer_nn.py +257 -0
  117. insurautoml-0.2.9/tests/test_informed/conftest.py +110 -0
  118. insurautoml-0.2.9/tests/test_informed/test_informed_automl.py +172 -0
  119. insurautoml-0.2.9/tests/test_informed/test_informed_ensemble.py +185 -0
  120. insurautoml-0.2.9/tests/test_informed/test_informed_objective.py +217 -0
  121. insurautoml-0.2.9/tests/test_informed/test_informed_pipeline.py +138 -0
  122. insurautoml-0.2.9/tests/test_informed/test_informed_prep.py +175 -0
  123. insurautoml-0.2.9/tests/test_model/test_model.py +208 -0
  124. insurautoml-0.2.9/tests/test_model/test_model_2.py +350 -0
  125. insurautoml-0.2.9/tests/test_model/test_model_nn.py +343 -0
  126. insurautoml-0.2.9/tests/test_scaling/test_scaling.py +148 -0
  127. insurautoml-0.2.9/tests/test_utils/test_metadata.py +73 -0
  128. insurautoml-0.2.9/tests/test_utils/test_optional.py +151 -0
  129. insurautoml-0.2.9/tests/test_utils/test_utils.py +126 -0
  130. insurautoml-0.2.9/tests/test_utils/test_utils_base.py +223 -0
  131. insurautoml-0.2.9/tests/test_utils/test_utils_data.py +218 -0
  132. insurautoml-0.2.9/tests/test_utils/test_utils_data_extra.py +398 -0
  133. insurautoml-0.2.9/tests/test_utils/test_utils_metadata_extra.py +290 -0
  134. insurautoml-0.2.9/tests/test_utils/test_utils_optimize.py +222 -0
  135. insurautoml-0.2.9/tests/test_utils/test_utils_optimize_more.py +272 -0
  136. insurautoml-0.2.9/tests/test_utils/test_utils_stat.py +189 -0
  137. insurautoml-0.2.9/tests/test_utils/test_utils_stats_extra.py +288 -0
  138. insurautoml-0.2.9/tests/test_utils/test_utils_tensor.py +143 -0
  139. InsurAutoML-0.2.7b0/InsurAutoML/feature_selection/autosklearn.py +0 -644
  140. InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/__init__.py +0 -47
  141. InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/_balancing_hyperparameter.py +0 -105
  142. InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/_classifier_hyperparameter.py +0 -269
  143. InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/_feature_selection_hyperparameter.py +0 -272
  144. InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/_imputer_hyperparameter.py +0 -74
  145. InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/_regressor_hyperparameter.py +0 -282
  146. InsurAutoML-0.2.7b0/InsurAutoML/hyperparameters/_hyperopt/_scaling_hyperparameter.py +0 -55
  147. InsurAutoML-0.2.7b0/InsurAutoML/model/autosklearn.py +0 -1552
  148. InsurAutoML-0.2.7b0/InsurAutoML/utils/_c/_base.pyx +0 -154
  149. InsurAutoML-0.2.7b0/InsurAutoML.egg-info/SOURCES.txt +0 -80
  150. InsurAutoML-0.2.7b0/InsurAutoML.egg-info/not-zip-safe +0 -1
  151. InsurAutoML-0.2.7b0/InsurAutoML.egg-info/top_level.txt +0 -1
  152. InsurAutoML-0.2.7b0/setup.py +0 -484
  153. {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.5
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, 25th May 2023 11:04:19 am
15
- Modified By: Panyi Dong (panyid2@illinois.edu)
16
-
17
- -----
18
- MIT License
19
-
20
- Copyright (c) 2022 - 2022, 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
-
42
- from .version import _get_version
43
- from .base import no_processing, load_data, set_seed
44
- from .hpo import (
45
- AutoTabular,
46
- AutoTabularClassifier,
47
- AutoTabularRegressor,
48
- # AutoTextClassifier,
49
- # AutoNextWordPrediction,
50
- )
51
- from .utils import (
52
- # random_guess,
53
- # random_index,
54
- # random_list,
55
- # is_date,
56
- # feature_rounding,
57
- train_test_split,
58
- # minloc,
59
- # maxloc,
60
- # True_index,
61
- # nan_cov,
62
- # class_means,
63
- # empirical_covariance,
64
- # class_cov,
65
- # Pearson_Corr,
66
- # MI,
67
- # t_score,
68
- # ANOVA,
69
- # as_dataframe,
70
- type_of_task,
71
- # formatting,
72
- # Timer,
73
- # unify_nan,
74
- # remove_index_columns,
75
- # get_missing_matrix,
76
- EDA,
77
- )
78
-
79
- __version__ = _get_version()
80
-
81
- # read version from file
82
-
83
-
84
- # from ._encoding import DataEncoding
85
-
86
- # from ._imputation import (
87
- # SimpleImputer,
88
- # DummyImputer,
89
- # JointImputer,
90
- # ExpectationMaximization,
91
- # KNNImputer,
92
- # MissForestImputer,
93
- # MICE,
94
- # GAIN,
95
- # AAI_kNN,
96
- # KMI,
97
- # CMI,
98
- # k_Prototype_NN,
99
- # )
100
-
101
- # from ._balancing import (
102
- # SimpleRandomOverSampling,
103
- # SimpleRandomUnderSampling,
104
- # TomekLink,
105
- # EditedNearestNeighbor,
106
- # CondensedNearestNeighbor,
107
- # OneSidedSelection,
108
- # CNN_TomekLink,
109
- # Smote,
110
- # Smote_TomekLink,
111
- # Smote_ENN,
112
- # )
113
-
114
- # from ._scaling import (
115
- # MinMaxScale,
116
- # Standardize,
117
- # Normalize,
118
- # RobustScale,
119
- # PowerTransformer,
120
- # QuantileTransformer,
121
- # Winsorization,
122
- # Feature_Manipulation,
123
- # Feature_Truncation,
124
- # )
125
-
126
- # from ._feature_selection import (
127
- # PCA_FeatureSelection,
128
- # LDASelection,
129
- # FeatureFilter,
130
- # RBFSampler,
131
- # ASFFS,
132
- # GeneticAlgorithm,
133
- # )
134
-
135
- # extracted from sklearn
136
- # not all used in the pipeline
137
- # from ._feature_selection import (
138
- # Densifier,
139
- # ExtraTreesPreprocessorClassification,
140
- # ExtraTreesPreprocessorRegression,
141
- # FastICA,
142
- # FeatureAgglomeration,
143
- # KernelPCA,
144
- # RandomKitchenSinks,
145
- # LibLinear_Preprocessor,
146
- # Nystroem,
147
- # PCA,
148
- # PolynomialFeatures,
149
- # RandomTreesEmbedding,
150
- # SelectPercentileClassification,
151
- # SelectPercentileRegression,
152
- # SelectClassificationRates,
153
- # SelectRegressionRates,
154
- # TruncatedSVD,
155
- # )
156
-
157
-
158
- # from ._model import classifiers, regressors
159
-
160
- # base = {"load_data": load_data}
161
-
162
- # encoders = {"DataEncoding": DataEncoding}
163
-
164
- # model_selection = {
165
- # "AutoTabular": AutoTabular,
166
- # "AutoTabularClassifier": AutoTabularClassifier,
167
- # "AutoTabularRegressor": AutoTabularRegressor,
168
- # "AutoTextClassifier": AutoTextClassifier,
169
- # "AutoNextWordPrediction": AutoNextWordPrediction,
170
- # }
171
-
172
- __all__ = [
173
- "load_data", # _base
174
- "no_processing",
175
- "random_guess", # _utils
176
- "random_index",
177
- "random_list",
178
- "is_date",
179
- "feature_rounding",
180
- "train_test_split",
181
- "minloc",
182
- "maxloc",
183
- "True_index",
184
- "nan_cov",
185
- "class_means",
186
- "empirical_covariance",
187
- "class_cov",
188
- "Pearson_Corr",
189
- "MI",
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)