Esc
Ask AIAnswers may be inaccurate; check the linked pages.Esc
Ask anything about these docs, like how to get started or what a function does.

TimesNetHyperparams

timesnet_model.TimesNetHyperparams · inherits PydanticBaseModel

Tunable training knobs; aligned with TFT / shorter GPU Batch runs.

Attribute Type Default Description
input_size int 128 NeuralForecast input_size (lookback).
max_steps int 25 Lightning optimization steps per fit (not forecast horizon; tasks cap h at 128).
batch_size int 64 Minibatch size (series per step); larger improves GPU throughput until memory-bound.

TimesNetModel

timesnet_model.TimesNetModel · inherits BaseModel

__init__(self, params: Dict[str, Any], settings: Dict[str, Any])

Initializes the TimesNet model, validating hyperparameters and checking for neuralforecast installation.

Parameter Type Default Description
params Dict[str, Any] - (undocumented)
settings Dict[str, Any] - (undocumented)

train(self, y_context: np.ndarray, y_target: np.ndarray, timestamps_context: np.ndarray, timestamps_target: np.ndarray, x_context: Optional[np.ndarray] = None, x_target: Optional[np.ndarray] = None, **kwargs) -> TimesNetModel

Parameter Type Default Description
y_context np.ndarray - (undocumented)
y_target np.ndarray - (undocumented)
timestamps_context np.ndarray - (undocumented)
timestamps_target np.ndarray - (undocumented)
x_context Optional[np.ndarray] None (undocumented)
x_target Optional[np.ndarray] None (undocumented)
**kwargs - - (undocumented)

Returns: TimesNetModel (the fitted model).

predict(self, y_context: np.ndarray, timestamps_context: np.ndarray, timestamps_target: np.ndarray, x_context: Optional[np.ndarray] = None, x_target: Optional[np.ndarray] = None, **kwargs) -> np.ndarray

Parameter Type Default Description
y_context np.ndarray - (undocumented)
timestamps_context np.ndarray - (undocumented)
timestamps_target np.ndarray - (undocumented)
x_context Optional[np.ndarray] None (undocumented)
x_target Optional[np.ndarray] None (undocumented)
**kwargs - - (undocumented)

Returns: np.ndarray (Forecast predictions). Raises: ValueError (if TimesNetModel is not fitted).