RegressionTreeGB4TS2

scalation.modeling.forecasting_old.RegressionTreeGB4TS2

The RegressionTreeGB4TS2 object supports Gradient Boosting for Time Series data. Multi-horizon forecasting supported via the Recursive method. Given a response vector y, a predictor matrix x is built that consists of lagged y vectors. Additional future response vectors are built for training.

y_t = f(x)

where x = [y_{t-1}, y_{t-2}, ... y_{t-lags}].

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def align(tr_size: Int, y: VectorD, yp: VectorD, h_: Int): (VectorD, VectorD, VectorD)

Align (for the testing set) the actual response vector for comparison with the predicted/forecasted response vector, returning a time vector and sliced response vectors.

Align (for the testing set) the actual response vector for comparison with the predicted/forecasted response vector, returning a time vector and sliced response vectors.

Value parameters

h_

the current forecasting horizon - 1

tr_size

the size of the intial training set

y

the actual response for the full dataset (to be sliced)

yp

the predicted response for the full dataset (to be sliced)

Attributes

def apply(y: VectorD, lags: Int, h: Int, intercept: Boolean, hparam: HyperParameter): RegressionTreeGB

Create a RegressionTreeGB object from a response vector. The input/data matrix x is formed from the lagged y vectors as columns in matrix x.

Create a RegressionTreeGB object from a response vector. The input/data matrix x is formed from the lagged y vectors as columns in matrix x.

Value parameters

h

the forecasting horizon (1, 2, ... h)

hparam

the hyper-parameters (use RegressionTree.hp for default)

intercept

whether to add a column of all ones to the matrix (intercept)

lags

the maximum lag included (inclusive)

y

the original un-expanded output/response vector

Attributes

def exo(y: VectorD, lags: Int, ex: MatrixD, h: Int, intercept: Boolean, hparam: HyperParameter)(elag1: Int, elag2: Int): RegressionTreeGB

Create a RegressionTreeGB object from a response vector. The input/data matrix x is formed from the lagged y vectors as columns in matrix x. In addition, lagged exogenous variables are added.

Create a RegressionTreeGB object from a response vector. The input/data matrix x is formed from the lagged y vectors as columns in matrix x. In addition, lagged exogenous variables are added.

Value parameters

elag1

the minimum exo lag included (inclusive)

elag2

the maximum exo lag included (inclusive)

h

the forecasting horizon (1, 2, ... h)

hparam

the hyper-parameters (use RegressionTree.hp for default)

intercept

whether to add a column of all ones to the matrix (intercept)

lags

the maximum lag included (inclusive)

y

the original un-expanded output/response vector

Attributes

def rescale(y: VectorD, lags: Int, h: Int, intercept: Boolean, hparam: HyperParameter): RegressionTreeGB

Create a RegressionTreeGB object from a response matrix. The input/data matrix x is formed from the lagged y vectors as columns in matrix x. This method provides data rescaling.

Create a RegressionTreeGB object from a response matrix. The input/data matrix x is formed from the lagged y vectors as columns in matrix x. This method provides data rescaling.

Value parameters

h

the forecasting horizon (1, 2, ... h)

hparam

the hyper-parameters (use RegressionTree.hp for default)

intercept

whether to add a column of all ones to the matrix (intercept)

lags

the maximum lag included (inclusive)

y

the original un-expanded output/response vector

Attributes

def rollValidate(mod: Predictor & Fit, rc: Int, te_size_: Int): VectorD

Use rolling-validation to compute test Quality of Fit (QoF) measures by dividing the dataset into a TRAINING SET (tr) and a TESTING SET (te) as follows: [ <-- tr_size --> | <-- te_size --> ] This version calls predict (DIRECT) for h-steps ahead out-of-sample forecasts.

Use rolling-validation to compute test Quality of Fit (QoF) measures by dividing the dataset into a TRAINING SET (tr) and a TESTING SET (te) as follows: [ <-- tr_size --> | <-- te_size --> ] This version calls predict (DIRECT) for h-steps ahead out-of-sample forecasts.

Value parameters

mod

the forecasting model being used (e.g., RegressionTreeGB4TS2)

rc

the retraining cycle (number of forecasts until retraining occurs)

te_size

the size of the testing set

Attributes

See also

RollingValidation

def split_TnT(x: MatrixD, y: VectorD, ratio: Double): (MatrixD, VectorD, MatrixD, VectorD)

Split the x matrix and y matrix into training and testing sets.

Split the x matrix and y matrix into training and testing sets.

Value parameters

ratio

the ratio of the TESTING set to the full dataset (most common 70-30, 80-20)

x

the x data/input matrix

y

the y response/output matrix

Attributes