Commit f42429f6 authored by bailuo's avatar bailuo
Browse files

readme

parents
{
"name": "Nixtla Development Environment",
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.11-bookworm",
"hostRequirements": {
"cpus": 4,
"memory": "16gb",
"storage": "32gb"
},
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.terminal.activateEnvInCurrentTerminal": true,
"python.defaultInterpreterPath": ".venv/bin/python",
"python.pythonPath": ".venv/bin/python",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
}
},
"notebook.python.defaultInterpreterPath": ".venv/bin/python",
"notebook.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"ruff.nativeServer": "on",
"python.languageServer": "Default",
"debug.internalConsoleOptions": "neverOpen",
"extensions.ignoreRecommendations": true,
"files.insertFinalNewline": true
},
"extensions": [
"ms-python.python",
"ms-python.mypy",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter@2025.2.0",
"charliermarsh.ruff@2025.22.0",
"GitHub.copilot",
"tamasfe.even-better-toml",
"anthropic.claude-code@1.0.127"
]
}
},
"forwardPorts": [
8888
],
"containerEnv": {
"UV_NO_SYNC": "1"
},
"onCreateCommand": "make devenv",
"postCreateCommand": "make init_codespace",
"waitFor": "postCreateCommand",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2.12.3": {},
"ghcr.io/va-h/devcontainers-features/uv:1.1.4": {},
"ghcr.io/devcontainers/features/node:1.6.3": {}
}
}
name: Bug report
title: "[<Library component: Model|Core|etc...>] "
description: Problems and issues with code of the library
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thank you for reporting the problem..
Please make sure what you are reporting is a bug with reproducible steps. To ask questions
or share ideas, please post on our [Slack community](https://join.slack.com/t/nixtlacommunity/shared_invite/zt-1h77esh5y-iL1m8N0F7qV1HmH~0KYeAQ) instead.
- type: textarea
attributes:
label: What happened + What you expected to happen
description: Describe 1. the bug 2. expected behavior 3. useful information (e.g., logs)
placeholder: >
Please provide the context in which the problem occurred and explain what happened. Further,
please also explain why you think the behaviour is erroneous. It is extremely helpful if you can
copy and paste the fragment of logs showing the exact error messages or wrong behaviour here.
**NOTE**: please copy and paste texts instead of taking screenshots of them for easy future search.
validations:
required: true
- type: textarea
attributes:
label: Versions / Dependencies
description: Please specify the versions of the library, Python, OS, and other libraries that are used.
value: |
<details><summary>Click to expand</summary>
Dependencies:
</details>
validations:
required: true
- type: textarea
attributes:
label: Reproducible example
description: >
Please provide a reproducible script. Providing a simple way to reproduce the issue
(minimal / no external dependencies) will help us triage and address issues in the timely manner!
value: |
```python
# paste your code here
```
validations:
required: true
- type: dropdown
attributes:
label: Issue Severity
description: |
How does this issue affect your experience as user?
multiple: false
options:
- "Low: It annoys or frustrates me."
- "Medium: It is a significant difficulty but I can work around it."
- "High: It blocks me from completing my task."
validations:
required: false
blank_issues_enabled: true
contact_links:
- name: Ask a question or get support
url: https://join.slack.com/t/nixtlacommunity/shared_invite/zt-1h77esh5y-iL1m8N0F7qV1HmH~0KYeAQ
about: Ask a question or request support for using a library of the nixtlaverse
name: Documentation
title: "[<Library component: Models|Core|etc...>] "
description: Report an issue with the library documentation
labels: [documentation]
body:
- type: markdown
attributes:
value: Thank you for helping us improve the library documentation!
- type: textarea
attributes:
label: Description
description: |
Tell us about the change you'd like to see. For example, "I'd like to
see more examples of how to use `cross_validation`."
validations:
required: true
- type: textarea
attributes:
label: Link
description: |
If the problem is related to an existing section, please add a link to
the section.
validations:
required: false
name: Library feature request
description: Suggest an idea for a project
title: "[<Library component: Models|Core|etc...>] "
labels: [enhancement, feature]
body:
- type: markdown
attributes:
value: |
Thank you for finding the time to propose a new feature!
We really appreciate the community efforts to improve the nixtlaverse.
- type: textarea
attributes:
label: Description
description: A short description of your feature
- type: textarea
attributes:
label: Use case
description: >
Describe the use case of your feature request. It will help us understand and
prioritize the feature request.
placeholder: >
Rather than telling us how you might implement this feature, try to take a
step back and describe what you are trying to achieve.
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
ci-dependencies:
patterns: ["*"]
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
categories:
- title: 'New Features'
label: 'feature'
- title: 'Breaking Change'
label: 'breaking change'
- title: 'Bug Fixes'
label: 'fix'
- title: 'Documentation'
label: 'documentation'
- title: 'Dependencies'
label: 'dependencies'
- title: 'Enhancement'
label: 'enhancement'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
template: |
$CHANGES
name: build-docs
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]
workflow_dispatch:
inputs:
environment:
description: 'The environment to deploy to'
required: true
type: choice
default: 'staging'
options:
- staging
- production
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: "true"
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.10'
- name: Install dependencies
run: pip install -e '.[dev]' lazydocs pyyaml
# setup quarto for rendering example/tutorial nbs
- uses: quarto-dev/quarto-actions/setup@v2
with:
version: 1.4.515
- name: Build Docs
run: make all_docs
- name: Deploy (Push to main or Pull Request)
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'staging')
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: docs-preview
publish_dir: docs/mintlify
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
- name: Deploy (Release)
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'production')
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: docs
publish_dir: docs/mintlify
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
- name: Trigger mintlify workflow (Push to main or Pull Request)
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'staging')
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.DOCS_WORKFLOW_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'nixtla',
repo: 'docs',
workflow_id: 'mintlify-action-preview.yml',
ref: 'main',
});
- name: Trigger mintlify workflow (Release)
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'production')
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.DOCS_WORKFLOW_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'nixtla',
repo: 'docs',
workflow_id: 'mintlify-action.yml',
ref: 'main',
});
name: CI
on:
push:
branches: [main]
paths-ignore:
- 'timegpt-docs/**'
pull_request:
branches: [main]
paths-ignore:
- 'timegpt-docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
NIXTLA_API_KEY: ${{ secrets.NIXTLA_DEV_API_KEY }}
NIXTLA_BASE_URL: ${{ secrets.NIXTLA_DEV_BASE_URL }}
NIXTLA_API_KEY_CUSTOM: ${{ secrets.NIXTLA_API_KEY_CUSTOM }}
NIXTLA_BASE_URL_CUSTOM: ${{ secrets.NIXTLA_BASE_URL_CUSTOM }}
API_KEY_FRED: ${{ secrets.API_KEY_FRED }}
jobs:
check-import:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Clone repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # 5.4.0
with:
python-version: ${{ matrix.python-version }}
- name: Install nixtla
run: pip install uv && uv pip install --system .
- name: Check import
run: python -c "from nixtla import NixtlaClient"
run-notebooks-test:
runs-on: nixtla-linux-large-public
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
steps:
- name: Clone repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # 5.4.0
with:
python-version: ${{ matrix.python-version }}
- name: Install pip requirements
run: pip install uv && uv pip install --system ".[dev,distributed]"
- name: Run nbconvert
run: |
find nbs/docs/ -name "*.ipynb" -print0 | while IFS= read -r -d '' nb; do
if [[ "$(basename "$nb")" == "19_computing_at_scale_ray_distributed.ipynb" ]]; then
echo "Skipping $nb..."
continue
fi
echo "Running $nb..."
jupyter nbconvert --to notebook --execute --inplace "$nb"
done
name: Lint
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # 5.4.0
with:
python-version: '3.10'
- name: Install dependencies
run: pip install black pre-commit
- name: Run pre-commit
run: pre-commit run --show-diff-on-failure --files nixtla/*
name: Models Performance
permissions: write-all
on:
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- 'timegpt-docs/**'
defaults:
run:
shell: bash -l {0}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run-models-performance:
runs-on: ubuntu-latest
env:
NIXTLA_API_KEY: ${{ secrets.NIXTLA_DEV_API_KEY }}
NIXTLA_BASE_URL: ${{ secrets.NIXTLA_DEV_BASE_URL }}
PLOTS_REPO_URL: https://github.com/Nixtla/nixtla/blob/docs-figs-model-performance
steps:
- name: Clone repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # 5.4.0
with:
python-version: "3.10"
- name: Install pip requirements
run: pip install uv && uv pip install --system '.[dev]'
- name: Run evaluation
run: python -m action_files.models_performance.main
- name: Upload results to the PR
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: >
python action_files/comment_file.py
--search_term "Experiment Results"
--file "action_files/models_performance/summary.md"
- name: Upload images to new branch main
run: |
git config --global user.email azul@nixtla.io
git config --global user.name AzulGarza
git push https://$GITHUB_TOKEN@github.com/nixtla/nixtla.git --delete docs-figs-model-performance || true
git checkout -b docs-figs-model-performance
git add -f "*.png"
git commit -m "[cd] update png images" || echo "No changes to commit"
git push https://$GITHUB_TOKEN@github.com/nixtla/nixtla.git HEAD:docs-figs-model-performance
name: No Response Bot
on:
issue_comment:
types: [created]
schedule:
- cron: '0 4 * * *'
jobs:
noResponse:
runs-on: ubuntu-latest
steps:
- uses: lee-dohm/no-response@9bb0a4b5e6a45046f00353d5de7d90fb8bd773bb # v0.5.0
with:
closeComment: >
This issue has been automatically closed because it has been awaiting a response for too long.
When you have time to to work with the maintainers to resolve this issue, please post a new comment and it will be re-opened.
If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one.
daysUntilClose: 30
responseRequiredLabel: awaiting response
token: ${{ github.token }}
name: pytest
on:
push:
branches: [main]
paths-ignore:
- 'timegpt-docs/**'
pull_request:
branches: [main]
paths-ignore:
- 'timegpt-docs/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
NIXTLA_API_KEY: ${{ secrets.NIXTLA_DEV_API_KEY }}
NIXTLA_BASE_URL: ${{ secrets.NIXTLA_DEV_BASE_URL }}
NIXTLA_API_KEY_CUSTOM: ${{ secrets.NIXTLA_API_KEY_CUSTOM }}
NIXTLA_BASE_URL_CUSTOM: ${{ secrets.NIXTLA_BASE_URL_CUSTOM }}
API_KEY_FRED: ${{ secrets.API_KEY_FRED }}
jobs:
run-tests:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: [macos-14, nixtla-linux-large-public, windows-latest]
python-version: ["3.9", "3.10", "3.11"]
# windows python 3.13 can't install pyreadr
# TODO: in 3.12, it doesn't support ray<=2.20
steps:
- name: Clone repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
python-version: ${{ matrix.python-version }}
- name: Setup devenv
run: >
make devenv
- name: Run tests (Linux Python 3.11)
if: runner.os == 'Linux' && matrix.python-version == '3.11'
run: uv run pytest --cov=nixtla --reruns 3 --reruns-delay 10 --only-rerun ConnectError --only-rerun "Too Many Requests" nixtla_tests
- name: Run tests (not Linux Python 3.11)
if: runner.os != 'Linux' || matrix.python-version != '3.11'
run: uv run pytest --cov=nixtla -m "not distributed_run" --reruns 3 --reruns-delay 10 --only-rerun ConnectError --only-rerun "Too Many Requests" nixtla_tests
name: Upload Python Packages
on:
push:
tags: ['v*']
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # 5.4.0
with:
python-version: '3.10'
- name: Install dependencies
run: python -m pip install --upgrade pip && pip install build
- name: Build nixtla package
run: python -m build
- name: Publish nixtla package
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
name: Release Drafter
on:
push:
branches:
- main
permissions:
contents: read
jobs:
update_release_draft:
permissions:
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Upload Python Packages to TestPyPI
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # 5.4.0
with:
python-version: '3.10'
- name: Install dependencies
run: python -m pip install --upgrade pip && pip install build
- name: Build nixtla package
run: python -m build
- name: Publish nixtla package
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
with:
repository-url: https://test.pypi.org/legacy/
.ipynb_checkpoints
__pycache__
*.egg-info
Gemfile*
Gemfile.lock
docs/_site
build
dist
.vscode
.idea
*.gif
*.csv
*/data/*
*.parquet
*.tar.gz
tmp
_docs/
_proc/
.DS_Store
.gitattributes
.gitconfig
nbs/.last_checked
.venv
.idea
.env
*/summary.md
*/*.png
longhorizon
data
*.rda
nbs/_extensions
!nbs/assets/*
# VSCode
*.code-workspace
# ignore files created in the docs folder
docs/*.md
docs/**/*.mdx
docs-scripts
docs/mintlify/examples
docs/mintlify/assets
nbs/_extensions
.quarto
*.png
.coverage*
\ No newline at end of file
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
hooks:
- id: ruff
files: 'nixtla'
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
hooks:
- id: mypy
args: [--ignore-missing-imports]
files: 'nixtla'
# Changelog
## 0.6.6
### 🚀 Feature Enhancements
#### Online anomaly detection
We introduce the `online_anomaly_detection` method, which allows you to define a `detection_size` on which to look for anomalies.
*See full changelog [here](https://github.com/Nixtla/nixtla/releases/v0.6.6).*
## 0.6.5
### 🚀 Feature Enhancements
#### Persisting fine-tuned models
You can now run an isolated fine-tuning process, save the model and use it afterwards in all of our methods, i.e. `forecast`, `cross_validation` and `detect_anomalies`.
#### zstd compression
All requests above 1MB are now automatically compressed using [zstd](https://github.com/facebook/zstd), which will help when sending large amounts of data, as well as users with slow connections.
#### refit argument in cross_validation
It's now possible to fine-tune the model only on the first window when performing `cross_validation` by setting `refit=False`. This will dramatically decrease the time it takes to run cross validation with fine-tuning.
*See full changelog [here](https://github.com/Nixtla/nixtla/releases/v0.6.5).*
## 0.6.4
### 🚀 Feature Enhancements
#### Integer and custom pandas frequencies
It's now possible to provide integer timestamps and an integer frequency as well as non-standard timestamps and custom pandas frequencies like [CustomBusinessHour](https://pandas.pydata.org/docs/reference/api/pandas.tseries.offsets.CustomBusinessHour.html)
#### Usage method
You can now programatically get the number of calls you've made to our API as well as your limits by calling the `usage` method.
#### Historic exogenous in cross validation
The `cross_validation` method now supports the `hist_exog_list` parameter, which allows you to define historical exogenous features.
*See full changelog [here](https://github.com/Nixtla/nixtla/releases/v0.6.4).*
## 0.6.2
### 🚀 Feature Enhancements
#### Finetune depth
You can now specify the depth of the fine-tuning process by setting `finetune_depth` in the `forecast` and `cross_validation` methods.
*See full changelog [here](https://github.com/Nixtla/nixtla/releases/v0.6.2).*
## 0.6.0
### 🚀 Feature Enhancements
#### V2 API endpoints
The client now makes requests to the the V2 API endpoints, which have a lower latency.
#### orjson serialization
We now use [orjson](https://github.com/ijl/orjson) to serialize the payloads, which provides a performance improvement, especially when using exogenous features.
#### Historical exogenous features
It's now possible to define historical exogenous features in the `forecast` method by providing the feature names through `hist_exog_list`.
#### Feature contributions
You can now get the contributions of your exogenous features to the forecast by setting `feature_contributions=True` in the `forecast` method.
*See full changelog [here](https://github.com/Nixtla/nixtla/releases/v0.6.0).*
## 0.5.0
### 🚀 Feature Enhancements
#### Cross Validation endpoint
The `cross_validation` method used to make one API call per window, now the method makes a single API call.
*See full changelog [here](https://github.com/Nixtla/nixtla/releases/v0.5.0).*
## 0.4.0
### 🔄 Changes & Deprecations
- **Deprecation of `nixtlats`package:**
The `nixtlats` package has been deprecated in favor of the new `nixtla` package. Please make sure to install the `nixtla` package and update your imports like the following:
**Before:**
```python
from nixtlats import NixtlaClient
```
**After:**
```python
from nixtla import NixtlaClient
```
*See full changelog [here](https://github.com/Nixtla/nixtla/releases/v0.4.0).*
## 0.3.0
### 🔄 Changes & Deprecations
- **Deprecation of `TimeGPT` Class:**
In an effort to streamline our API and align with industry best practices, we're deprecating the `TimeGPT` class in favor of the new `NixtlaClient` class. This change is designed to provide a more intuitive and powerful interface for interacting with our services.
**Before:**
```python
from nixtlats import TimeGPT
# Initialize the TimeGPT model
timegpt = TimeGPT()
```
**After:**
```python
from nixtlats import NixtlaClient
# Initialize the NixtlaClient
nixtla = NixtlaClient()
```
- **Renaming of Configuration Parameters:**
To enhance clarity and consistency with other SDKs, we've renamed the `token` parameter to `api_key` and `environment` to `base_url`.
**Before:**
```python
timegpt = TimeGPT(token='YOUR_TOKEN', environment='YOUR_ENVIRONMENT_URL')
```
**After:**
```python
nixtla = NixtlaClient(api_key='YOUR_API_KEY', base_url='YOUR_BASE_URL')
```
- **Introduction of `NixtlaClient.validate_api_key`:**
Replacing the previous `NixtlaClient.validate_token` method, this update aligns with the new authentication parameter naming and offers a straightforward way to validate API keys.
**Before:**
```python
timegpt.validate_token()
```
**After:**
```python
nixtla.validate_api_key()
```
- **Environment Variable Changes:**
In line with the renaming of parameters, we've updated the environment variables to set up the API key and base URL. The `TIMEGPT_TOKEN` is now replaced with `NIXTLA_API_KEY`, and we've introduced `NIXTLA_BASE_URL` for custom API URLs.
#### **Backward Compatibility & Future Warnings:**
These changes are designed to be backward compatible. However, users can expect to see future warnings when utilizing deprecated features, such as the `TimeGPT` class.
*See full changelog [here](https://github.com/Nixtla/nixtla/releases/v0.3.0).*
## 0.2.0 (Previously Released)
### 🔄 Changes & Deprecations
- **Renaming of Fine-Tuning Parameters:**
The `finetune_steps` and `finetune_loss` parameters were renamed to `fewshot_steps` and `fewshot_loss`. Additionally, the model parameter values changed from `short-horizon` and `long-horizon` to `timegpt-1` and `timegpt-1-long-horizon`, with an emphasis on preserving backward compatibility. In version 0.3.0, these changes are deprecated in favor of reverting to the original parameter names and values, ensuring a seamless transition for existing users.
*See full changelog [here](https://github.com/Nixtla/nixtla/releases/v0.2.0).*
## 0.1.21
### 🚀 Feature Enhancements
#### Introduction of Quantile Forecasts in `forecast` and `cross_validation` Methods 📈
We're thrilled to announce the integration of the `quantiles` argument into TimeGP's `forecast` and `cross_validation` methods. This feature allows users to specify a list of quantiles, offering a comprehensive view of potential future values under uncertainty.
- **Quantile Forecasting Capability:**
By providing a list of quantiles, users can now obtain forecasts at various percentiles of the forecast distribution. This is crucial for understanding the range of possible outcomes and assessing risks more effectively.
``` python
# Generate quantile forecasts
quantiles = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
timegpt_quantile_fcst_df = timegpt.forecast(df=df, h=12, quantiles=quantiles, ...)
```
- **Enhanced Cross-Validation with Quantiles:**
The `cross_validation` method has been updated to support quantile forecasting, enabling a more nuanced validation of model performance across different percentiles.
``` python
# Apply quantile forecasting in cross-validation
timegpt_cv_quantile_fcst_df = timegpt.cross_validation(df=df, h=12, n_windows=5, quantiles=quantiles, ...)
```
*See full changelog [here](https://github.com/Nixtla/nixtla/releases/v0.1.21).*
## 0.1.20
### 🚀 Feature Enhancements
#### Enhanced Model Fine-tuning with `finetune_loss` and `finetune_steps` 🛠️
The latest update brings a significant enhancement to the fine-tuning capabilities of our forecasting models. With the introduction of the `finetune_loss`, users now have the ability to not only specify the number of steps for fine-tunning (with `finetune_steps`) but also to define the target loss for fine-tunning, offering more granular control over model optimization.
- **`finetune_loss` Options:**
- `default`: Adopts the model's preset loss function, optimized during initial training.
- `mae` (Mean Absolute Error): Focuses on the mean of the absolute differences between predicted and actual values.
- `mse` (Mean Squared Error): Emphasizes the mean of the squares of the differences between predicted and actual values.
- `rmse` (Root Mean Squared Error): Provides the square root of MSE, offering error terms in the same units as the predictions.
- `mape` (Mean Absolute Percentage Error): Measures the mean absolute percent difference between predicted and actual values.
- `smape` (Symmetric Mean Absolute Percentage Error): Offers a symmetric version of MAPE, ensuring equal treatment of over and underestimations.
- **`finetune_steps`:** Determines the number of steps to execute during the fine-tuning process. It is crucial to set `finetune_steps` to a value greater than 0 to activate the fine-tuning mechanism with the chosen `finetune_loss` function. This allows for a more tailored optimization, aligning the model closely with specific forecasting requirements and improving its predictive performance.
``` python
# Configure model fine-tuning with custom loss function and steps
fcst_df = timegpt.forecast(df, model='timegpt-1-long-horizon', finetune_loss='mape', finetune_steps=50)
# Apply fine-tuning to cross-validation for enhanced model validation
cv_df = timegpt.cross_validation(df, model='timegpt-1', finetune_loss='smape', finetune_steps=50)
```
This update opens up new possibilities for refining forecasting models, ensuring they are finely tuned to the specific characteristics and challenges of the forecasting task at hand.
*See full changelog [here](https://github.com/Nixtla/nixtla/releases/v0.1.20).*
## 0.1.19
### 🚀 Feature Enhancements
#### Advanced Data Partitioning with `num_partitions` 🔄
We're excited to introduce the `num_partitions` argument for our `forecast`, `cross_validation`, and `detect_anomalies` methods, offering more control over data processing and parallelization:
- **Optimized Resource Utilization in Distributed Environments:** For Spark, Ray, or Dask dataframes, `num_partitions` enables the system to either leverage all available parallel resources or to specify the number of parallel processes. This ensures efficient resource allocation and utilization across distributed computing environments.
``` python
# Utilize num_partitions in distributed environments
fcst_df = timegpt.forecast(df, model='timegpt-1-long-horizon', num_partitions=10)
```
- **Efficient Handling of Large Pandas Dataframes:** When working with Pandas dataframes, `num_partitions` groups series into specified partitions, allowing for sequential API calls. This is particularly useful for large dataframes that are impractical to send over the internet in one go, enhancing performance and efficiency.
``` python
# Efficiently process large Pandas dataframes
cv_df = timegpt.cross_validation(df, model='timegpt-1', num_partitions=5)
```
This new feature provides a flexible approach to handling data across different environments, ensuring optimal performance and resource management.
*See full changelog [here](https://github.com/Nixtla/nixtla/releases/v0.1.19).*
## 0.1.18
### 🚀 Feature Enhancements
#### Forecast Using Diverse Models 🌐
Release of new forecasting methods. Among the updates, we've unveiled the **`timegpt-1-long-horizon`** model, crafted specifically for long-term forecasts that span multiple seasonalities. To use it, simply specify the model in your methods like so:
``` python
from nixtlats import TimeGPT
# Initialize the TimeGPT model
timegpt = TimeGPT()
# Generate forecasts using the long-horizon model
fcst_df = timegpt.forecast(..., model='timegpt-1-long-horizon')
# Perform cross-validation with the long-horizon model
cv_df = timegpt.cross_validation(..., model='timegpt-1-long-horizon')
# Detect anomalies with the long-horizon model
anomalies_df = timegpt.detect_anomalies(..., model='timegpt-1-long-horizon')
```
Choose between `timegpt-1` for the first version of `TimeGPT` or `timegpt-1-long-horizon` for long horizon tasks..
#### Cross-Validation Methodology 📊
You can dive deeper into your forecasting pipelines with the new `cross_validation` feature. This method enables you to validate forecasts across different windows efficiently:
``` python
# Set up cross-validation with a custom horizon, number of windows, and step size
cv_df = timegpt.cross_validation(df, h=35, n_windows=5, step_size=5)
```
This will generate 5 distinct forecast sets, each with a horizon of 35, stepping through your data every 5 timestamps.
### 🔁 Retry Behavior for Robust API Calls
The new retry mechanism allows the making of more robust API calls (preventing them from crashing with large-scale tasks).
- **`max_retries`**: Number of max retries for an API call.
- **`retry_interval`**: Pause between retries.
- **`max_wait_time`**: Total duration of retries.
``` python
timegpt = TimeGPT(max_retries=10, retry_interval=5, max_wait_time=360)
```
### 🔑 Token Inference Made Simple
The `TimeGPT` class now automatically infers your `TIMEGPT_TOKEN` using `os.environ.get('TIMEGPT_TOKEN')`, streamlining your setup:
``` python
# No more manual token handling - TimeGPT has got you covered
timegpt = TimeGPT()
```
For more information visit our [FAQS](https://docs.nixtla.io/docs/faqs#setting-up-your-authentication-token-for-nixtla-sdk) section.
### 📘 Introducing the FAQ Section
Questions? We've got answers! Our new [FAQ section](https://docs.nixtla.io/docs/faqs) tackles the most common inquiries, from integrating exogenous variables to configuring authorization tokens and understanding long-horizon forecasts.
*See full changelog [here](https://github.com/Nixtla/nixtla/releases/v0.1.18).*
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
support@nixtla.io.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment