From 064f20a8350d49090aed7c0d3e0ea35c892acf60 Mon Sep 17 00:00:00 2001 From: Nikhil Gupta Date: Thu, 12 Dec 2024 14:12:59 -0600 Subject: [PATCH 1/5] docs: updated to add use of latest SDK for API validation issues --- nbs/docs/getting-started/5_faq.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nbs/docs/getting-started/5_faq.ipynb b/nbs/docs/getting-started/5_faq.ipynb index 775d77f8..b50b592d 100644 --- a/nbs/docs/getting-started/5_faq.ipynb +++ b/nbs/docs/getting-started/5_faq.ipynb @@ -168,10 +168,11 @@ "
\n", " What if my API key isn't validating?\n", "\n", - "If when you validate your API key, it returns `False`\n", + "When you validate your API key and it returns `False`:\n", "\n", "* If you are targeting an Azure endpoint, getting `False` from the `NixtlaClient.validate_api_key` method is expected. You can skip this step when taregting an Azure endpoint and proceed diretly to forecasting instead.\n", "* If you are not taregting an Azure endpoint, then you should check the following:\n", + " * Make sure you are using the latest version of the SDK (Python or R).\n", " * Check that your API key is active in your dashboard by visiting https://dashboard.nixtla.io/\n", " * Consider any firewalls your organization might have. There may be restricted access. If so, you can whitelist our endpoint https://api.nixtla.io/\n", "\n", From 443597173bfe8a7c05e3afdaa5392babe56bfd99 Mon Sep 17 00:00:00 2001 From: Nikhil Gupta Date: Thu, 12 Dec 2024 15:51:52 -0600 Subject: [PATCH 2/5] docs: updated usage section --- nbs/docs/getting-started/5_faq.ipynb | 33 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/nbs/docs/getting-started/5_faq.ipynb b/nbs/docs/getting-started/5_faq.ipynb index b50b592d..4cb2f02a 100644 --- a/nbs/docs/getting-started/5_faq.ipynb +++ b/nbs/docs/getting-started/5_faq.ipynb @@ -475,26 +475,27 @@ "
\n", " What counts as an API call? \n", "\n", - "An API call is a request made to TimeGPT to perform an action like forecasting or detecting anomalies, or to fetch the model's metadata.\n", + "An API call is a request made to TimeGPT to perform an action like forecasting or detecting anomalies. API Usage is as follows:\n", "\n", - "For example, if we forecast monthly data using the `timegpt-1` model, then the first time doing this results in 2 API calls: we \n", - "- API call #1: fetch the model's metadata\n", - "- API call #2: perform the forecast action. \n", - "Calling the forecast method again, with the same frequency and model counts only as 1 API call.\n", + "### Forecasting:\n", + "1. When not requesting historical forecasts (`add_history=False`)\n", + " - If you do not set `num_partitions`, all calls to perform [forecasting](https://docs.nixtla.io/docs/getting-started-timegpt_quickstart), [finetuning](https://docs.nixtla.io/docs/tutorials-fine_tuning), or [cross-validation](https://docs.nixtla.io/docs/tutorials-cross_validation) increase the usage by 1. Note that addition of [exogenous variables](https://docs.nixtla.io/docs/tutorials-exogenous_variables), requesting [uncertainity quantification](https://docs.nixtla.io/docs/tutorials-uncertainty_quantification) or forecasting [multiple series](https://docs.nixtla.io/docs/tutorials-multiple_series_forecasting) does not increase the usage further.\n", + " - If the API call requires to send more than 200MB of data, the API will return an error and will require you to use the `num_partitions` parameter in order to partition your request. Every partition will count as an API call, hence the usage will increase by the value you set for `num_partitions` (e.g. for num_partitions=2, the usage will increase by 2).\n", + " If you set `num_partitions`, all calls to perform forecasting, finetuning, or cross-validation increase the usage by num_paritions.\n", + "2. When requesting [in-sample predictions](https://docs.nixtla.io/docs/tutorials-historical_forecast) (`add_history=True`), the usage from #1 above is multipled by 2.\n", "\n", - "However, if we forecast on another frequency, or using the `timegpt-1-long-horizon` model, then 2 API calls are made, because new metadata must be fetched on top of running the forecast. \n", - "\n", - "We can also get historical forecasts using the `add_history=True` parameter in the `forecast` method. This leads to 2 API calls.\n", - "\n", - "Then, if the API call requires to send more than 200MB of data, the API will return an error and will require you to use the `num_partitions` parameter in order to partition your request. Every partition will count as an API call, thus for 2 partitions there will be 2 API calls.\n", + "**Examples**\n", + "1. A user uses TimeGPT to forecast daily data, using the `timegpt-1` model. How many API calls are made? (*Ans*: 1)\n", + "2. A user calls the `cross_validation` method on a dataset. How many API calls are made (*Ans*: 1)\n", + "3. A user decides to forecast on a longer horizon, so they use the `timegpt-1-long-horizon` model. How many API calls are made (*Ans*: 1)\n", + "4. A user needs to get the in-sample predicitons when forecasting using `add_history=True`. How many API calls are made (*Ans*: 2)\n", + "5. A user has a very large dataset, with a daily frequency, and they must set `num_partitions=4` when forecasting. How many API calls are made (*Ans*: 4)\n", + "6. A user has to set `num_paritions=4` and is also interesed in getting the in-sample predicitons (`add_history=True`) when forecasting. How many API calls are made (*Ans*: 8)\n", "\n", - "If we perform [cross-validation](https://docs.nixtla.io/docs/tutorials-cross_validation), no matter the number of windows, it always counts as 1 API call.\n", "\n", - "**Examples**\n", - "1. A user, for the first time, uses TimeGPT to forecast daily data, using the `timegpt-1` model. How many API calls are made? (*Ans*: 2)\n", - "2. The same user as above calls the `cross_validation` method on the same dataset, using the same model. How many API calls are made (*Ans*: 1)\n", - "3. That user now decides to forecast on a longer horizon, so they use the `timegpt-1-long-horizon` model. How many API calls are made (*Ans*: 2)\n", - "4. The user now gets a very large dataset, with a daily frequency, and they must set `num_partitions=4` when forecasting. How many API calls are made (*Ans*: 4)\n", + "### Anomaly Detection:\n", + "1. If you do not set `num_partitions`, all calls to perform [anomaly detection](https://docs.nixtla.io/docs/capabilities-anomaly-detection-quickstart) increase the usage by 1. Note that addition of [exogenous variables](https://docs.nixtla.io/docs/capabilities-anomaly-detection-add_exogenous_variables) does not increase the usage further.\n", + "2. If the API call requires to send more than 200MB of data, the API will return an error and will require you to use the `num_partitions` parameter in order to partition your request. Every partition will count as an API call, hence the usage will increase by the value you set for `num_partitions` (e.g. for num_partitions=2, the usage will increase by 2).\n", "\n", "
" ] From 28c0284dfb626efd671ffcdbdd2bfdbd0e1b61b6 Mon Sep 17 00:00:00 2001 From: Nikhil Gupta Date: Thu, 12 Dec 2024 16:15:44 -0600 Subject: [PATCH 3/5] docs: closes #552 --- nbs/docs/getting-started/5_faq.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nbs/docs/getting-started/5_faq.ipynb b/nbs/docs/getting-started/5_faq.ipynb index 4cb2f02a..fb517305 100644 --- a/nbs/docs/getting-started/5_faq.ipynb +++ b/nbs/docs/getting-started/5_faq.ipynb @@ -174,7 +174,9 @@ "* If you are not taregting an Azure endpoint, then you should check the following:\n", " * Make sure you are using the latest version of the SDK (Python or R).\n", " * Check that your API key is active in your dashboard by visiting https://dashboard.nixtla.io/\n", - " * Consider any firewalls your organization might have. There may be restricted access. If so, you can whitelist our endpoint https://api.nixtla.io/\n", + " * Consider any firewalls your organization might have. There may be restricted access. If so, you can whitelist our endpoint https://api.nixtla.io/. \n", + " - To use Nixtla's API, you need to let your system know that our endpointis ok, so it will let you access it. Whitelisting the endpoint isn't something that Nixtla can do on our side. It's something that needs to be done on the user's system. This is a bit of an [overview on whitelisting](https://www.csoonline.com/article/569493/whitelisting-explained-how-it-works-and-where-it-fits-in-a-security-program.html).\n", + " - If you work in an organization, please work with an IT team. They're likely the ones setting the security and you can talk with them to get it addressed. If you run your own systems, then it's something you should be able to update, depending on the system you're using.\n", "\n", "
" ] From 3b89bf4c734dd8ec1d369d65ddfb19583bd44611 Mon Sep 17 00:00:00 2001 From: Nikhil Gupta Date: Thu, 12 Dec 2024 16:17:34 -0600 Subject: [PATCH 4/5] docs: closes #552 --- nbs/docs/getting-started/5_faq.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbs/docs/getting-started/5_faq.ipynb b/nbs/docs/getting-started/5_faq.ipynb index fb517305..5d113a2f 100644 --- a/nbs/docs/getting-started/5_faq.ipynb +++ b/nbs/docs/getting-started/5_faq.ipynb @@ -175,7 +175,7 @@ " * Make sure you are using the latest version of the SDK (Python or R).\n", " * Check that your API key is active in your dashboard by visiting https://dashboard.nixtla.io/\n", " * Consider any firewalls your organization might have. There may be restricted access. If so, you can whitelist our endpoint https://api.nixtla.io/. \n", - " - To use Nixtla's API, you need to let your system know that our endpointis ok, so it will let you access it. Whitelisting the endpoint isn't something that Nixtla can do on our side. It's something that needs to be done on the user's system. This is a bit of an [overview on whitelisting](https://www.csoonline.com/article/569493/whitelisting-explained-how-it-works-and-where-it-fits-in-a-security-program.html).\n", + " - To use Nixtla's API, you need to let your system know that our endpoint is ok, so it will let you access it. Whitelisting the endpoint isn't something that Nixtla can do on our side. It's something that needs to be done on the user's system. This is a bit of an [overview on whitelisting](https://www.csoonline.com/article/569493/whitelisting-explained-how-it-works-and-where-it-fits-in-a-security-program.html).\n", " - If you work in an organization, please work with an IT team. They're likely the ones setting the security and you can talk with them to get it addressed. If you run your own systems, then it's something you should be able to update, depending on the system you're using.\n", "\n", "" From 5da62e4d5cb874d57b42bc5b8df3ce8be9e5561d Mon Sep 17 00:00:00 2001 From: Nikhil Gupta Date: Thu, 12 Dec 2024 16:28:52 -0600 Subject: [PATCH 5/5] docs: fix typo --- nbs/docs/getting-started/5_faq.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nbs/docs/getting-started/5_faq.ipynb b/nbs/docs/getting-started/5_faq.ipynb index 5d113a2f..17b48a52 100644 --- a/nbs/docs/getting-started/5_faq.ipynb +++ b/nbs/docs/getting-started/5_faq.ipynb @@ -483,7 +483,7 @@ "1. When not requesting historical forecasts (`add_history=False`)\n", " - If you do not set `num_partitions`, all calls to perform [forecasting](https://docs.nixtla.io/docs/getting-started-timegpt_quickstart), [finetuning](https://docs.nixtla.io/docs/tutorials-fine_tuning), or [cross-validation](https://docs.nixtla.io/docs/tutorials-cross_validation) increase the usage by 1. Note that addition of [exogenous variables](https://docs.nixtla.io/docs/tutorials-exogenous_variables), requesting [uncertainity quantification](https://docs.nixtla.io/docs/tutorials-uncertainty_quantification) or forecasting [multiple series](https://docs.nixtla.io/docs/tutorials-multiple_series_forecasting) does not increase the usage further.\n", " - If the API call requires to send more than 200MB of data, the API will return an error and will require you to use the `num_partitions` parameter in order to partition your request. Every partition will count as an API call, hence the usage will increase by the value you set for `num_partitions` (e.g. for num_partitions=2, the usage will increase by 2).\n", - " If you set `num_partitions`, all calls to perform forecasting, finetuning, or cross-validation increase the usage by num_paritions.\n", + " If you set `num_partitions`, all calls to perform forecasting, finetuning, or cross-validation increase the usage by num_partitions.\n", "2. When requesting [in-sample predictions](https://docs.nixtla.io/docs/tutorials-historical_forecast) (`add_history=True`), the usage from #1 above is multipled by 2.\n", "\n", "**Examples**\n", @@ -492,7 +492,7 @@ "3. A user decides to forecast on a longer horizon, so they use the `timegpt-1-long-horizon` model. How many API calls are made (*Ans*: 1)\n", "4. A user needs to get the in-sample predicitons when forecasting using `add_history=True`. How many API calls are made (*Ans*: 2)\n", "5. A user has a very large dataset, with a daily frequency, and they must set `num_partitions=4` when forecasting. How many API calls are made (*Ans*: 4)\n", - "6. A user has to set `num_paritions=4` and is also interesed in getting the in-sample predicitons (`add_history=True`) when forecasting. How many API calls are made (*Ans*: 8)\n", + "6. A user has to set `num_partitions=4` and is also interesed in getting the in-sample predicitons (`add_history=True`) when forecasting. How many API calls are made (*Ans*: 8)\n", "\n", "\n", "### Anomaly Detection:\n",