Previous topic

fynance.neural_networks.RollAggrMultiNeuralNet

fynance.neural_networks.RollMultiRollNeuralNet

class fynance.neural_networks.RollMultiRollNeuralNet(train_period=252, estim_period=63, value_init=100, target_filter='sign', params=None)

Rolling Multi Rolling Neural Networks object allow you to train several rolling neural networks along training periods (from t - n to t) and predict along testing periods (from t to t + s) and roll along this time axis. And “sometime” it reseting parameters of one rolling neural network.

Attributes:
y : np.ndarray[np.float32, ndim=2] with shape=(T, 1)

Target to estimate or predict.

X : np.ndarray[np.float32, ndim=2] with shape=(T, N)

Features (inputs).

NN : list of keras.Model

Neural network models to train and predict.

y_train : np.ndarray[np.float64, ndim=1]

Prediction on training set.

y_estim : np.ndarray[np.float64, ndim=1]

Prediction on estimating set.

Methods

run(y, X, NN, plot_loss=True, plot_perf=True, x_axis=None) Train several rolling neural networks along pre-specified training period and predict along test period. Display loss and performance if specified.
__call__(y, X, NN, start=0, end=1e8, x_axis=None) Callable method to set target and features data, neural network object (Keras object is prefered).
__iter__() Train and predict along time axis from day number n to last day number T and by step of size s period.
plot_loss(self, f, ax) Plot loss function
plot_perf(self, f, ax) Plot perfomances.