{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ffcafcca-d896-4122-8de4-d8c410f723d7",
   "metadata": {},
   "source": [
    "# Forecaster Object Globals\n",
    "\n",
    "- In scalecast, when reading documentation, it is helpful to know the following terms: `_estimators_`, `_can_be_tuned_`, `_cannot_be_tuned_`, `_sklearn_estimators_`, `_metrics_`, `_determine_best_by_`, `_normalizer_`. "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "79489a25-ef5f-4b6e-ae56-01550550b547",
   "metadata": {},
   "source": [
    "## `_estimators_`\n",
    "- these are the the models that forecast and can be set by using `f.set_estimator(...)`\n",
    "- they come from popular machine learning libraries like scikit-learn, keras, statsmodels, and others\n",
    "- here is a list of all:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "f174071b-08b6-463b-8d6f-73562c75490e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "arima\n",
      "combo\n",
      "elasticnet\n",
      "gbt\n",
      "hwes\n",
      "knn\n",
      "lightgbm\n",
      "lstm\n",
      "mlp\n",
      "mlr\n",
      "prophet\n",
      "rf\n",
      "rnn\n",
      "silverkite\n",
      "svr\n",
      "xgboost\n"
     ]
    }
   ],
   "source": [
    "from scalecast.Forecaster import _estimators_\n",
    "print(*_estimators_,sep='\\n')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "74643955-d8d9-4875-9ec3-f865c349c577",
   "metadata": {},
   "source": [
    "### `_can_be_tuned_`\n",
    "- the following estimators can be tuned:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "188e4c7d-5db5-4fdc-a487-2b5a3f6068d9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "arima\n",
      "elasticnet\n",
      "gbt\n",
      "hwes\n",
      "knn\n",
      "lightgbm\n",
      "mlp\n",
      "mlr\n",
      "prophet\n",
      "rf\n",
      "silverkite\n",
      "svr\n",
      "xgboost\n"
     ]
    }
   ],
   "source": [
    "from scalecast.Forecaster import _can_be_tuned_\n",
    "print(*_can_be_tuned_,sep='\\n')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "65308432-b018-4e87-8564-e6b23d8af636",
   "metadata": {},
   "source": [
    "### `_cannot_be_tuned_`\n",
    "- the following cannot be tuned:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "b7979606-b682-4ed8-8a26-8269f5080b82",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "combo\n",
      "lstm\n",
      "rnn\n"
     ]
    }
   ],
   "source": [
    "from scalecast.Forecaster import _cannot_be_tuned_\n",
    "print(*_cannot_be_tuned_,sep='\\n')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3be1ad09-63b2-4102-b642-4e85ea0a3bf3",
   "metadata": {},
   "source": [
    "### `_sklearn_estimators_`\n",
    "- these all come from scikit-learn or use a scikit-learn API and behave similarly (including being easy-to-tune, accepting a `normalizer` argument, and accpeting an `Xvars` argument):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "fddceb66-107d-4357-a998-bd962f4905ac",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "elasticnet\n",
      "gbt\n",
      "knn\n",
      "lightgbm\n",
      "mlp\n",
      "mlr\n",
      "rf\n",
      "svr\n",
      "xgboost\n"
     ]
    }
   ],
   "source": [
    "from scalecast.Forecaster import _sklearn_estimators_\n",
    "print(*_sklearn_estimators_,sep='\\n')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9c9c4392-71b8-4629-a60a-56d90e4c3688",
   "metadata": {},
   "source": [
    "## `_metrics_`\n",
    "- these are all the metrics available to use for model validation `f.set_validation_metric(...)`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "eb2276f4-9899-45fd-aed6-500973d4567b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "r2\n",
      "rmse\n",
      "mape\n",
      "mae\n"
     ]
    }
   ],
   "source": [
    "from scalecast.Forecaster import _metrics_\n",
    "print(*_metrics_,sep='\\n')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "33b4e1b2-0cff-49f8-966f-e65a43068ca9",
   "metadata": {},
   "source": [
    "## `_determine_best_by_`\n",
    "- these are all the metrics available to use for model comparison and sorting models best-to-worst `f.export(determine_best_by=...)`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "7a5773c5-8ad9-4cd7-9eb8-8c79fd6488f9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "TestSetRMSE\n",
      "TestSetMAPE\n",
      "TestSetMAE\n",
      "TestSetR2\n",
      "InSampleRMSE\n",
      "InSampleMAPE\n",
      "InSampleMAE\n",
      "InSampleR2\n",
      "ValidationMetricValue\n",
      "LevelTestSetRMSE\n",
      "LevelTestSetMAPE\n",
      "LevelTestSetMAE\n",
      "LevelTestSetR2\n"
     ]
    }
   ],
   "source": [
    "from scalecast.Forecaster import _determine_best_by_\n",
    "print(*_determine_best_by_,sep='\\n')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "da9dc276-da9f-493b-a4eb-8755c440f93a",
   "metadata": {},
   "source": [
    "## `_normalizer_`\n",
    "- these are all the options to scale your data when using an sklearn estimator `f.manual_forecast(normalizer=...)`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "218209fd-a318-4e84-8dbf-1e4d350649ee",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "minmax\n",
      "normalize\n",
      "scale\n",
      "pt\n",
      "None\n"
     ]
    }
   ],
   "source": [
    "from scalecast.Forecaster import _normalizer_\n",
    "print(*_normalizer_,sep='\\n')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bda547be-85d6-4275-b671-6681833535fd",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {},
    "version_major": 2,
    "version_minor": 0
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
