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.

NHITSHyperparams

nhits_model.NHITSHyperparams · inherits PydanticBaseModel

Tunable training knobs; aligned with TFT / shorter training.

Attributes

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/CPU throughput until memory-bound.

NHITSModel

nhits_model.NHITSModel · inherits BaseModel

__init__(self, params, settings)

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

train(self, y_context, y_target, timestamps_context, timestamps_target, x_context=None, x_target=None, **kwargs) -> NHITSModel

Parameters:

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 Any - (undocumented)

Returns: NHITSModel (the fitted model; sets self.is_fitted = True).

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

Parameters:

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 Any - (undocumented)

Returns: np.ndarray (The predicted forecast values).

Raises:

Exception Description
ValueError If train() has not been called prior to prediction.