protocol

forecaster_protocol

Protocol for time series forecasting models.

Availability:
logtalk_load(time_series_protocols(loader))
Author: Paulo Moura
Version: 1:0:0
Date: 2026-10-14
Compilation flags:
static
Dependencies:
(none)
Remarks:
(none)
Inherited public predicates:
(none)

Public predicates

learn/3

Learns a forecasting model from the given time series dataset object using the specified options.

Compilation flags:
static
Template:
learn(Dataset,Forecaster,Options)
Mode and number of proofs:
learn(+object_identifier,-compound,+list(compound)) - one_or_error
Exceptions:
Dataset is a variable:
instantiation_error
Dataset is neither a variable nor a valid object identifier:
type_error(object_identifier,Dataset)
Dataset is a valid object identifier but not an existing object:
existence_error(object,Dataset)
Options is a variable:
instantiation_error
Options is neither a variable nor a list:
type_error(list,Options)
An element Option of the list Options is a variable:
instantiation_error
An element Option of the list Options is neither a variable nor a compound term:
type_error(compound,Option)
An element Option of the list Options is a compound term but not a valid option:
domain_error(option,Option)

learn/2

Learns a forecasting model from the given time series dataset object using default options.

Compilation flags:
static
Template:
learn(Dataset,Forecaster)
Mode and number of proofs:
learn(+object_identifier,-compound) - one_or_error
Exceptions:
Dataset is a variable:
instantiation_error
Dataset is neither a variable nor a valid object identifier:
type_error(object_identifier,Dataset)
Dataset is a valid object identifier but not an existing object:
existence_error(object,Dataset)

forecast/3

Forecasts the next Horizon values beyond the training series using the learned forecasting model. A zero horizon returns an empty list.

Compilation flags:
static
Template:
forecast(Forecaster,Horizon,Forecasts)
Mode and number of proofs:
forecast(+compound,+non_negative_integer,-list(number)) - one_or_error
Exceptions:
Forecaster is a variable:
instantiation_error
Forecaster is not a valid forecaster:
domain_error(forecaster,Forecaster)
Horizon is a variable:
instantiation_error
Horizon is neither a variable nor an integer:
type_error(integer,Horizon)
Horizon is an integer but is negative:
domain_error(non_negative_integer,Horizon)

check_forecaster/1

Checks that a learned forecaster term is structurally valid for the receiving implementation. Throws an exception when the term is not a valid forecaster representation.

Compilation flags:
static
Template:
check_forecaster(Forecaster)
Mode and number of proofs:
check_forecaster(@compound) - one_or_error
Exceptions:
Forecaster is a variable:
instantiation_error
Forecaster is neither a variable nor a valid forecaster:
domain_error(forecaster,Forecaster)

valid_forecaster/1

True when a learned forecaster term is structurally valid for the receiving implementation. Succeeds iff check_forecaster/1 succeeds without throwing an exception.

Compilation flags:
static
Template:
valid_forecaster(Forecaster)
Mode and number of proofs:
valid_forecaster(@compound) - zero_or_one

diagnostics/2

Returns diagnostics metadata for a learned forecaster.

Compilation flags:
static
Template:
diagnostics(Forecaster,Diagnostics)
Mode and number of proofs:
diagnostics(+compound,-list(compound)) - one

diagnostic/2

Enumerates individual diagnostics metadata terms for a learned forecaster.

Compilation flags:
static
Template:
diagnostic(Forecaster,Diagnostic)
Mode and number of proofs:
diagnostic(+compound,?compound) - zero_or_more

forecaster_options/2

Returns the effective training options recorded in a learned forecaster diagnostics metadata.

Compilation flags:
static
Template:
forecaster_options(Forecaster,Options)
Mode and number of proofs:
forecaster_options(+compound,-list(compound)) - one

export_to_clauses/4

Converts a forecaster into a list of predicate clauses. Functor is the functor for the generated predicate clauses. When exporting a serialized forecaster term, a noun such as forecaster or model is usually clearer than a verb such as forecast.

Compilation flags:
static
Template:
export_to_clauses(Dataset,Forecaster,Functor,Clauses)
Mode and number of proofs:
export_to_clauses(+object_identifier,+compound,+atom,-list(clause)) - one_or_error
Exceptions:
Forecaster or Functor is a variable:
instantiation_error
Forecaster is not a valid baseline forecaster:
domain_error(forecaster,Forecaster)
Functor is neither a variable nor an atom:
type_error(atom,Functor)

export_to_file/4

Exports a forecaster to a file. Functor is the functor for the generated predicate clauses. When exporting a serialized forecaster term, a noun such as forecaster or model is usually clearer than a verb such as forecast.

Compilation flags:
static
Template:
export_to_file(Dataset,Forecaster,Functor,File)
Mode and number of proofs:
export_to_file(+object_identifier,+compound,+atom,+atom) - one_or_error
Exceptions:
Forecaster, Functor, or File:
instantiation_error
Forecaster is not a valid forecaster:
domain_error(forecaster,Forecaster)
Functor is neither a variable nor an atom:
type_error(atom,Functor)
File is not a valid file specification:
type_error(source_sink,File)
The output location does not exist:
existence_error(source_sink,File)
The output file cannot be opened:
permission_error(open,source_sink,File)
The output stream cannot be written to:
permission_error(output,stream,Stream)


Protected predicates

(none)

Private predicates

(none)

Operators

(none)