openavmkit.utilities.optional
Optional dependencies: imported only where they're used, with an error that says how to install them.
OpenAVMKit's cloud storage (Azure, Hugging Face, SFTP) and its NGBoost model need packages that most uses never touch, so they are extras rather than requirements:
pip install "openavmkit[cloud]" # cloud_sync: Azure, Hugging Face, SFTP
pip install "openavmkit[ngboost]" # the "ngboost" model
pip install "openavmkit[xgboost]" # the "xgboost" model (and the xgboost/ensemble fill-in models)
pip install "openavmkit[catboost]" # the "catboost" model
catboost_module
catboost_module()
CatBoost (the "catboost" extra).
Source code in openavmkit/utilities/optional.py
46 47 48 | |
installed
installed(module)
Whether an optional package can be imported, without importing it.
Source code in openavmkit/utilities/optional.py
36 37 38 | |
ngboost_classes
ngboost_classes()
NGBoost's regressor and its Normal distribution (the "ngboost" extra).
Source code in openavmkit/utilities/optional.py
29 30 31 32 33 | |
require
require(module, extra, what)
Import module, or raise an ImportError that names the extra that installs it.
Source code in openavmkit/utilities/optional.py
17 18 19 20 21 22 23 24 25 26 | |
require_engines
require_engines(engines)
Before a run trains anything: raise one ImportError naming every optional engine these models need that isn't installed, and the one command that installs them all. Otherwise a run would train the models before it and only then stop, at the first model whose engine is missing.
Source code in openavmkit/utilities/optional.py
55 56 57 58 59 60 61 62 63 64 65 66 | |
xgboost_module
xgboost_module()
XGBoost (the "xgboost" extra).
Source code in openavmkit/utilities/optional.py
41 42 43 | |