ashlar-tabular 0.0.1__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.
- ashlar/__init__.py +100 -0
- ashlar/_compat.py +17 -0
- ashlar/_version.py +1 -0
- ashlar/additive.py +1185 -0
- ashlar/core.py +110 -0
- ashlar/demos/__init__.py +1 -0
- ashlar/demos/linked.py +61 -0
- ashlar/distributional.py +533 -0
- ashlar/errors.py +13 -0
- ashlar/estimator.py +1889 -0
- ashlar/forecast.py +1314 -0
- ashlar/heads.py +244 -0
- ashlar/io.py +64 -0
- ashlar/layers.py +785 -0
- ashlar/node.py +422 -0
- ashlar/objectives.py +288 -0
- ashlar/predict.py +154 -0
- ashlar/preprocess.py +582 -0
- ashlar/priors.py +1208 -0
- ashlar/recipes.py +247 -0
- ashlar/rounds.py +797 -0
- ashlar/search.py +77 -0
- ashlar/train.py +558 -0
- ashlar/tree.py +288 -0
- ashlar/weights.py +97 -0
- ashlar_tabular-0.0.1.dist-info/METADATA +243 -0
- ashlar_tabular-0.0.1.dist-info/RECORD +30 -0
- ashlar_tabular-0.0.1.dist-info/WHEEL +5 -0
- ashlar_tabular-0.0.1.dist-info/licenses/LICENSE +202 -0
- ashlar_tabular-0.0.1.dist-info/top_level.txt +1 -0
ashlar/__init__.py
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"""Composable tabular models on JAX, Equinox, and Optax.
|
|
2
|
+
|
|
3
|
+
The import name is ``ashlar``. The distribution name is ``ashlar-tabular``.
|
|
4
|
+
|
|
5
|
+
The names in ``__all__`` are the public surface. Helpers stay on their modules.
|
|
6
|
+
Every model is ``ASR`` plus what it does, after LightGBM's ``LGBMRegressor``
|
|
7
|
+
and ``LGBMClassifier``: ``ASRRegressor``, ``ASRClassifier``,
|
|
8
|
+
``ASROrdinalClassifier``, ``ASROutcomeTree``, ``ASRForecaster``, and
|
|
9
|
+
``ASRHistoryForecaster``, all on the generic ``ASRModel``. The old names
|
|
10
|
+
still import, with a ``DeprecationWarning``.
|
|
11
|
+
Forecast heads are the ``head`` argument of the two forecasters: ``mse``
|
|
12
|
+
(default), ``quantile``, ``gaussian``, ``mixture``, ``flow``, and ``histogram``.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from ashlar._compat import renamed
|
|
16
|
+
from ashlar._version import __version__
|
|
17
|
+
from ashlar.additive import ASRAdditive, ASRDiagonalNeighborhood, ASRGatedAdditive
|
|
18
|
+
from ashlar.errors import AshlarError, ShapeError, WeightError
|
|
19
|
+
from ashlar.estimator import ASRClassifier, ASRModel, ASROrdinalClassifier, ASROutcomeTree, ASRRegressor
|
|
20
|
+
from ashlar.forecast import ASRForecaster, ASRHistoryForecaster
|
|
21
|
+
from ashlar.node import ASRObliviousEnsemble
|
|
22
|
+
from ashlar.predict import MeanParameterNormal, NormalMixture
|
|
23
|
+
from ashlar.priors import ASRBartPriorEnsemble, ASRGradientSparseNet, ASRVariationalPairwise
|
|
24
|
+
from ashlar.recipes import (
|
|
25
|
+
CLASSIFIER_RECIPE,
|
|
26
|
+
DEFAULT_RECIPE,
|
|
27
|
+
ORDINAL_RECIPE,
|
|
28
|
+
TABM_PAPER,
|
|
29
|
+
TABM_PIECEWISE,
|
|
30
|
+
TREE_RECIPE,
|
|
31
|
+
classifier,
|
|
32
|
+
ordinal,
|
|
33
|
+
outcome_tree,
|
|
34
|
+
residual_mlp,
|
|
35
|
+
tabular,
|
|
36
|
+
tabm,
|
|
37
|
+
tabm_piecewise,
|
|
38
|
+
)
|
|
39
|
+
from ashlar.rounds import ASRHistogramBooster, ASRLearnedNeighborhood, ASRLinearLeafBooster
|
|
40
|
+
from ashlar.search import DEFAULT_SEARCH
|
|
41
|
+
from ashlar.tree import OutcomeTree
|
|
42
|
+
|
|
43
|
+
__all__ = [
|
|
44
|
+
"ASRAdditive",
|
|
45
|
+
"ASRBartPriorEnsemble",
|
|
46
|
+
"ASRClassifier",
|
|
47
|
+
"ASRDiagonalNeighborhood",
|
|
48
|
+
"ASRForecaster",
|
|
49
|
+
"ASRGatedAdditive",
|
|
50
|
+
"ASRGradientSparseNet",
|
|
51
|
+
"ASRHistogramBooster",
|
|
52
|
+
"ASRHistoryForecaster",
|
|
53
|
+
"ASRLearnedNeighborhood",
|
|
54
|
+
"ASRLinearLeafBooster",
|
|
55
|
+
"ASRModel",
|
|
56
|
+
"ASRObliviousEnsemble",
|
|
57
|
+
"ASROrdinalClassifier",
|
|
58
|
+
"ASROutcomeTree",
|
|
59
|
+
"ASRRegressor",
|
|
60
|
+
"ASRVariationalPairwise",
|
|
61
|
+
"AshlarError",
|
|
62
|
+
"CLASSIFIER_RECIPE",
|
|
63
|
+
"DEFAULT_RECIPE",
|
|
64
|
+
"DEFAULT_SEARCH",
|
|
65
|
+
"MeanParameterNormal",
|
|
66
|
+
"NormalMixture",
|
|
67
|
+
"ORDINAL_RECIPE",
|
|
68
|
+
"OutcomeTree",
|
|
69
|
+
"ShapeError",
|
|
70
|
+
"TABM_PAPER",
|
|
71
|
+
"TABM_PIECEWISE",
|
|
72
|
+
"TREE_RECIPE",
|
|
73
|
+
"WeightError",
|
|
74
|
+
"__version__",
|
|
75
|
+
"residual_mlp",
|
|
76
|
+
"tabm",
|
|
77
|
+
"tabm_piecewise",
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
# ``tabular``, ``classifier``, ``ordinal``, and ``outcome_tree`` still import
|
|
81
|
+
# from here and warn when called.
|
|
82
|
+
__getattr__ = renamed(
|
|
83
|
+
__name__,
|
|
84
|
+
globals(),
|
|
85
|
+
{
|
|
86
|
+
"TabularEstimator": "ASRModel",
|
|
87
|
+
"TimeSeriesForecaster": "ASRForecaster",
|
|
88
|
+
"FullHistoryForecaster": "ASRHistoryForecaster",
|
|
89
|
+
"AdditiveModel": "ASRAdditive",
|
|
90
|
+
"GatedAdditive": "ASRGatedAdditive",
|
|
91
|
+
"DiagonalNeighborhood": "ASRDiagonalNeighborhood",
|
|
92
|
+
"ObliviousEnsemble": "ASRObliviousEnsemble",
|
|
93
|
+
"HistogramBooster": "ASRHistogramBooster",
|
|
94
|
+
"LinearLeafBooster": "ASRLinearLeafBooster",
|
|
95
|
+
"LearnedNeighborhood": "ASRLearnedNeighborhood",
|
|
96
|
+
"BartPriorEnsemble": "ASRBartPriorEnsemble",
|
|
97
|
+
"VariationalPairwise": "ASRVariationalPairwise",
|
|
98
|
+
"GradientSparseNet": "ASRGradientSparseNet",
|
|
99
|
+
},
|
|
100
|
+
)
|
ashlar/_compat.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Old public names, kept importable with a ``DeprecationWarning``."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import warnings
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def renamed(module: str, namespace: dict, names: dict[str, str]):
|
|
9
|
+
"""Module ``__getattr__`` that maps each old name in ``names`` to its new one."""
|
|
10
|
+
|
|
11
|
+
def __getattr__(name):
|
|
12
|
+
if name in names:
|
|
13
|
+
warnings.warn(f"{name} is now {names[name]}.", DeprecationWarning, stacklevel=2)
|
|
14
|
+
return namespace[names[name]]
|
|
15
|
+
raise AttributeError(f"module {module!r} has no attribute {name!r}")
|
|
16
|
+
|
|
17
|
+
return __getattr__
|
ashlar/_version.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.1"
|