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 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"