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.

SvrHyperparams

svr_model.SvrHyperparams · inherits PydanticBaseModel

Defines the hyperparameters for the SvrModel.

Attributes

Attribute Type Default Description
kernel Literal["linear", "poly", "rbf", "sigmoid"] - SVR kernel type
C float - Regularization parameter
epsilon float 0.1 Epsilon parameter for epsilon-SVR
gamma Literal["scale", "auto"] "scale" Kernel coefficient for 'rbf', 'poly' and 'sigmoid'

SvrModel

svr_model.SvrModel · inherits BaseModel

Initialize Support Vector Regression (SVR) model with model-specific parameters. Uses direct multi-output strategy via sklearn's MultiOutputRegressor.

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

Initialize Support Vector Regression (SVR) model with model-specific parameters. Uses direct multi-output strategy via sklearn's MultiOutputRegressor.

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: dict) -> SvrModel

Train the SVR model for direct multi-output forecasting using MultiOutputRegressor.

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

Returns: SvrModel (The trained model instance.)

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: dict)

Autoregressive rolling prediction for MultiOutputRegressor SVR. Predicts the entire length of y_target by repeatedly using its own predictions as context.

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

Returns: np.ndarray (The predictions, shape (total_steps, num_targets).)

Raises: ValueError: If the model is not trained yet. ValueError: If y_context is shorter than the effective lookback window.