Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌿 Fern Regeneration -- January 5, 2024 #205

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 47 additions & 20 deletions nixtlats/client.py

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions nixtlats/types/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
# This file was auto-generated by Fern from our API Definition.

from .http_validation_error import HttpValidationError
from .multi_series_anomaly_model import MultiSeriesAnomalyModel
from .multi_series_cross_validation_finetune_loss import MultiSeriesCrossValidationFinetuneLoss
from .multi_series_cross_validation_model import MultiSeriesCrossValidationModel
from .multi_series_forecast_finetune_loss import MultiSeriesForecastFinetuneLoss
from .multi_series_forecast_model import MultiSeriesForecastModel
from .multi_series_input import MultiSeriesInput
from .multi_series_insample_forecast_model import MultiSeriesInsampleForecastModel
from .single_series_forecast import SingleSeriesForecast
from .single_series_forecast_finetune_loss import SingleSeriesForecastFinetuneLoss
from .single_series_forecast_model import SingleSeriesForecastModel
from .single_series_insample_forecast_model import SingleSeriesInsampleForecastModel
from .validation_error import ValidationError
from .validation_error_loc_item import ValidationErrorLocItem

__all__ = [
"HttpValidationError",
"MultiSeriesAnomalyModel",
"MultiSeriesCrossValidationFinetuneLoss",
"MultiSeriesCrossValidationModel",
"MultiSeriesForecastFinetuneLoss",
"MultiSeriesForecastModel",
"MultiSeriesInput",
"MultiSeriesInsampleForecastModel",
"SingleSeriesForecast",
"SingleSeriesForecastFinetuneLoss",
"SingleSeriesForecastModel",
"SingleSeriesInsampleForecastModel",
"ValidationError",
"ValidationErrorLocItem",
]
23 changes: 23 additions & 0 deletions nixtlats/types/multi_series_anomaly_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class MultiSeriesAnomalyModel(str, enum.Enum):
"""
Model to use as a string. Options are: `timegpt-1`, and `timegpt-1-long-horizon.` We recommend using `timegpt-1-long-horizon` for forecasting if you want to predict more than one seasonal period given the frequency of your data.
"""

TIMEGPT_1 = "timegpt-1"
TIMEGPT_1_LONG_HORIZON = "timegpt-1-long-horizon"

def visit(
self, timegpt_1: typing.Callable[[], T_Result], timegpt_1_long_horizon: typing.Callable[[], T_Result]
) -> T_Result:
if self is MultiSeriesAnomalyModel.TIMEGPT_1:
return timegpt_1()
if self is MultiSeriesAnomalyModel.TIMEGPT_1_LONG_HORIZON:
return timegpt_1_long_horizon()
41 changes: 41 additions & 0 deletions nixtlats/types/multi_series_cross_validation_finetune_loss.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class MultiSeriesCrossValidationFinetuneLoss(str, enum.Enum):
"""
The loss used to train the large time model on the data. Select from ['default', 'mae', 'mse', 'rmse', 'mape', 'smape']. It will only be used if finetune_steps larger than 0. Default is a robust loss function that is less sensitive to outliers.
"""

DEFAULT = "default"
MAE = "mae"
MSE = "mse"
RMSE = "rmse"
MAPE = "mape"
SMAPE = "smape"

def visit(
self,
default: typing.Callable[[], T_Result],
mae: typing.Callable[[], T_Result],
mse: typing.Callable[[], T_Result],
rmse: typing.Callable[[], T_Result],
mape: typing.Callable[[], T_Result],
smape: typing.Callable[[], T_Result],
) -> T_Result:
if self is MultiSeriesCrossValidationFinetuneLoss.DEFAULT:
return default()
if self is MultiSeriesCrossValidationFinetuneLoss.MAE:
return mae()
if self is MultiSeriesCrossValidationFinetuneLoss.MSE:
return mse()
if self is MultiSeriesCrossValidationFinetuneLoss.RMSE:
return rmse()
if self is MultiSeriesCrossValidationFinetuneLoss.MAPE:
return mape()
if self is MultiSeriesCrossValidationFinetuneLoss.SMAPE:
return smape()
23 changes: 23 additions & 0 deletions nixtlats/types/multi_series_cross_validation_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class MultiSeriesCrossValidationModel(str, enum.Enum):
"""
Model to use as a string. Options are: `timegpt-1`, and `timegpt-1-long-horizon.` We recommend using `timegpt-1-long-horizon` for forecasting if you want to predict more than one seasonal period given the frequency of your data.
"""

TIMEGPT_1 = "timegpt-1"
TIMEGPT_1_LONG_HORIZON = "timegpt-1-long-horizon"

def visit(
self, timegpt_1: typing.Callable[[], T_Result], timegpt_1_long_horizon: typing.Callable[[], T_Result]
) -> T_Result:
if self is MultiSeriesCrossValidationModel.TIMEGPT_1:
return timegpt_1()
if self is MultiSeriesCrossValidationModel.TIMEGPT_1_LONG_HORIZON:
return timegpt_1_long_horizon()
41 changes: 41 additions & 0 deletions nixtlats/types/multi_series_forecast_finetune_loss.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class MultiSeriesForecastFinetuneLoss(str, enum.Enum):
"""
The loss used to train the large time model on the data. Select from ['default', 'mae', 'mse', 'rmse', 'mape', 'smape']. It will only be used if finetune_steps larger than 0. Default is a robust loss function that is less sensitive to outliers.
"""

DEFAULT = "default"
MAE = "mae"
MSE = "mse"
RMSE = "rmse"
MAPE = "mape"
SMAPE = "smape"

def visit(
self,
default: typing.Callable[[], T_Result],
mae: typing.Callable[[], T_Result],
mse: typing.Callable[[], T_Result],
rmse: typing.Callable[[], T_Result],
mape: typing.Callable[[], T_Result],
smape: typing.Callable[[], T_Result],
) -> T_Result:
if self is MultiSeriesForecastFinetuneLoss.DEFAULT:
return default()
if self is MultiSeriesForecastFinetuneLoss.MAE:
return mae()
if self is MultiSeriesForecastFinetuneLoss.MSE:
return mse()
if self is MultiSeriesForecastFinetuneLoss.RMSE:
return rmse()
if self is MultiSeriesForecastFinetuneLoss.MAPE:
return mape()
if self is MultiSeriesForecastFinetuneLoss.SMAPE:
return smape()
23 changes: 23 additions & 0 deletions nixtlats/types/multi_series_forecast_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class MultiSeriesForecastModel(str, enum.Enum):
"""
Model to use as a string. Options are: `timegpt-1`, and `timegpt-1-long-horizon.` We recommend using `timegpt-1-long-horizon` for forecasting if you want to predict more than one seasonal period given the frequency of your data.
"""

TIMEGPT_1 = "timegpt-1"
TIMEGPT_1_LONG_HORIZON = "timegpt-1-long-horizon"

def visit(
self, timegpt_1: typing.Callable[[], T_Result], timegpt_1_long_horizon: typing.Callable[[], T_Result]
) -> T_Result:
if self is MultiSeriesForecastModel.TIMEGPT_1:
return timegpt_1()
if self is MultiSeriesForecastModel.TIMEGPT_1_LONG_HORIZON:
return timegpt_1_long_horizon()
23 changes: 23 additions & 0 deletions nixtlats/types/multi_series_insample_forecast_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class MultiSeriesInsampleForecastModel(str, enum.Enum):
"""
Model to use as a string. Options are: `timegpt-1`, and `timegpt-1-long-horizon.` We recommend using `timegpt-1-long-horizon` for forecasting if you want to predict more than one seasonal period given the frequency of your data.
"""

TIMEGPT_1 = "timegpt-1"
TIMEGPT_1_LONG_HORIZON = "timegpt-1-long-horizon"

def visit(
self, timegpt_1: typing.Callable[[], T_Result], timegpt_1_long_horizon: typing.Callable[[], T_Result]
) -> T_Result:
if self is MultiSeriesInsampleForecastModel.TIMEGPT_1:
return timegpt_1()
if self is MultiSeriesInsampleForecastModel.TIMEGPT_1_LONG_HORIZON:
return timegpt_1_long_horizon()
7 changes: 6 additions & 1 deletion nixtlats/types/single_series_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
import pydantic

from ..core.datetime_utils import serialize_datetime
from .single_series_forecast_finetune_loss import SingleSeriesForecastFinetuneLoss
from .single_series_forecast_model import SingleSeriesForecastModel


class SingleSeriesForecast(pydantic.BaseModel):
model: typing.Optional[str] = pydantic.Field(
model: typing.Optional[SingleSeriesForecastModel] = pydantic.Field(
description="Model to use as a string. Options are: `timegpt-1`, and `timegpt-1-long-horizon.` We recommend using `timegpt-1-long-horizon` for forecasting if you want to predict more than one seasonal period given the frequency of your data."
)
freq: typing.Optional[str] = pydantic.Field(
Expand All @@ -31,6 +33,9 @@ class SingleSeriesForecast(pydantic.BaseModel):
finetune_steps: typing.Optional[int] = pydantic.Field(
description="The number of tuning steps used to train the large time model on the data. Set this value to 0 for zero-shot inference, i.e., to make predictions without any further model tuning."
)
finetune_loss: typing.Optional[SingleSeriesForecastFinetuneLoss] = pydantic.Field(
description="The loss used to train the large time model on the data. Select from ['default', 'mae', 'mse', 'rmse', 'mape', 'smape']. It will only be used if finetune_steps larger than 0. Default is a robust loss function that is less sensitive to outliers."
)

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
Expand Down
41 changes: 41 additions & 0 deletions nixtlats/types/single_series_forecast_finetune_loss.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class SingleSeriesForecastFinetuneLoss(str, enum.Enum):
"""
The loss used to train the large time model on the data. Select from ['default', 'mae', 'mse', 'rmse', 'mape', 'smape']. It will only be used if finetune_steps larger than 0. Default is a robust loss function that is less sensitive to outliers.
"""

DEFAULT = "default"
MAE = "mae"
MSE = "mse"
RMSE = "rmse"
MAPE = "mape"
SMAPE = "smape"

def visit(
self,
default: typing.Callable[[], T_Result],
mae: typing.Callable[[], T_Result],
mse: typing.Callable[[], T_Result],
rmse: typing.Callable[[], T_Result],
mape: typing.Callable[[], T_Result],
smape: typing.Callable[[], T_Result],
) -> T_Result:
if self is SingleSeriesForecastFinetuneLoss.DEFAULT:
return default()
if self is SingleSeriesForecastFinetuneLoss.MAE:
return mae()
if self is SingleSeriesForecastFinetuneLoss.MSE:
return mse()
if self is SingleSeriesForecastFinetuneLoss.RMSE:
return rmse()
if self is SingleSeriesForecastFinetuneLoss.MAPE:
return mape()
if self is SingleSeriesForecastFinetuneLoss.SMAPE:
return smape()
23 changes: 23 additions & 0 deletions nixtlats/types/single_series_forecast_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class SingleSeriesForecastModel(str, enum.Enum):
"""
Model to use as a string. Options are: `timegpt-1`, and `timegpt-1-long-horizon.` We recommend using `timegpt-1-long-horizon` for forecasting if you want to predict more than one seasonal period given the frequency of your data.
"""

TIMEGPT_1 = "timegpt-1"
TIMEGPT_1_LONG_HORIZON = "timegpt-1-long-horizon"

def visit(
self, timegpt_1: typing.Callable[[], T_Result], timegpt_1_long_horizon: typing.Callable[[], T_Result]
) -> T_Result:
if self is SingleSeriesForecastModel.TIMEGPT_1:
return timegpt_1()
if self is SingleSeriesForecastModel.TIMEGPT_1_LONG_HORIZON:
return timegpt_1_long_horizon()
23 changes: 23 additions & 0 deletions nixtlats/types/single_series_insample_forecast_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class SingleSeriesInsampleForecastModel(str, enum.Enum):
"""
Model to use as a string. Options are: `timegpt-1`, and `timegpt-1-long-horizon.` We recommend using `timegpt-1-long-horizon` for forecasting if you want to predict more than one seasonal period given the frequency of your data.
"""

TIMEGPT_1 = "timegpt-1"
TIMEGPT_1_LONG_HORIZON = "timegpt-1-long-horizon"

def visit(
self, timegpt_1: typing.Callable[[], T_Result], timegpt_1_long_horizon: typing.Callable[[], T_Result]
) -> T_Result:
if self is SingleSeriesInsampleForecastModel.TIMEGPT_1:
return timegpt_1()
if self is SingleSeriesInsampleForecastModel.TIMEGPT_1_LONG_HORIZON:
return timegpt_1_long_horizon()
Loading