pybiglasso 0.1.0__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.
pybiglasso/__init__.py ADDED
@@ -0,0 +1,24 @@
1
+ from importlib.metadata import PackageNotFoundError, version
2
+
3
+ from . import common # noqa: F401
4
+ from .binomial import biglasso # noqa: F401
5
+ from .path import BiglassoPath # noqa: F401
6
+ from .viz import plot_coefficients, plot_deviance # noqa: F401
7
+
8
+ try:
9
+ __version__ = version(__name__)
10
+ except PackageNotFoundError: # pragma: no cover
11
+ __version__ = None
12
+
13
+
14
+ def __getattr__(name):
15
+ # the scikit-learn estimators need scikit-learn; import them on first use
16
+ if name in ("BiglassoClassifier", "BiglassoClassifierCV"):
17
+ try:
18
+ from . import sklearn as _sklearn
19
+ except ImportError as e:
20
+ raise ImportError(
21
+ f"{name} needs scikit-learn: pip install 'pybiglasso[sklearn]'"
22
+ ) from e
23
+ return getattr(_sklearn, name)
24
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")