fynance.neural_networks.RollAggrMultiNeuralNet¶
-
class
fynance.neural_networks.
RollAggrMultiNeuralNet
(*args, agg_fun='mean', **kwargs)¶ Rolling Aggregated Multi Neural Networks object allow you to train several neural networks along training periods (from t - n to t), predict along testing periods (from t to t + s) and aggregate prediction following a specified rule and roll along this time axis.
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 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. aggregate(mat_pred, y, t=0, t_s=-1) Method to aggregate predictions from several neural networks. set_aggregate(*args) Set your own aggregation method. plot_loss(self, f, ax) Plot loss function plot_perf(self, f, ax) Plot perfomances.