diff --git a/README.md b/README.md index cbc5d2f57..ce61b927b 100644 --- a/README.md +++ b/README.md @@ -139,9 +139,11 @@ pip install etna The default version doesn't contain all the dependencies, because some of them are needed only for specific models, e.g. Prophet, PyTorch. Available user extensions are the following: -* `prophet` -* `torch` -* `wandb` +* `prophet`: adds prophet model`, +* `torch`: adds models based on neural nets, +* `wandb`: adds wandb logger, +* `auto`: adds AutoML functionality, +* `classiciation`: adds time series classification functionality. Install extension: ```bash diff --git a/etna/models/linear.py b/etna/models/linear.py index bf29d7029..e16fdfae9 100644 --- a/etna/models/linear.py +++ b/etna/models/linear.py @@ -16,13 +16,19 @@ from optuna.distributions import CategoricalDistribution from optuna.distributions import LogUniformDistribution from optuna.distributions import UniformDistribution +else: + from unittest.mock import Mock + CategoricalDistribution = Mock # type: ignore + UniformDistribution = Mock # type: ignore + LogUniformDistribution = Mock # type: ignore -LINEAR_GRID: Dict[str, "BaseDistribution"] = { + +_LINEAR_GRID: Dict[str, "BaseDistribution"] = { "fit_intercept": CategoricalDistribution([False, True]), } -ELASTIC_GRID: Dict[str, "BaseDistribution"] = { +_ELASTIC_GRID: Dict[str, "BaseDistribution"] = { "fit_intercept": CategoricalDistribution([False, True]), "l1_ratio": UniformDistribution(0, 1), "alpha": LogUniformDistribution(low=1e-5, high=1e3), @@ -92,7 +98,7 @@ def params_to_tune(self) -> Dict[str, "BaseDistribution"]: : Grid to tune. """ - return LINEAR_GRID + return _LINEAR_GRID class ElasticPerSegmentModel( @@ -155,7 +161,7 @@ def params_to_tune(self) -> Dict[str, "BaseDistribution"]: : Grid to tune. """ - return ELASTIC_GRID + return _ELASTIC_GRID class LinearMultiSegmentModel( @@ -195,7 +201,7 @@ def params_to_tune(self) -> Dict[str, "BaseDistribution"]: : Grid to tune. """ - return LINEAR_GRID + return _LINEAR_GRID class ElasticMultiSegmentModel( @@ -258,4 +264,4 @@ def params_to_tune(self) -> Dict[str, "BaseDistribution"]: : Grid to tune. """ - return ELASTIC_GRID + return _ELASTIC_GRID diff --git a/examples/automl.ipynb b/examples/automl.ipynb index e01db8f5f..c1713521d 100644 --- a/examples/automl.ipynb +++ b/examples/automl.ipynb @@ -50,6 +50,17 @@ "HORIZON = 14" ] }, + { + "cell_type": "markdown", + "id": "e5c2c568", + "metadata": {}, + "source": [ + "Many features from this notebook require `auto` extension. You can install it by the command:\n", + "```bash\n", + "pip install etna[auto]\n", + "```" + ] + }, { "cell_type": "markdown", "id": "33ad7417",