dense_neural_network#

Provides a model, which predictits next steps with a dense architecture.

class DenseNeuralNetwork(time_series_params: TimeSeriesConfig, model_params: KerasModelConfig)#

Bases: KerasModel

Defines a dense neural network to predict the next timestamps.

Parameters:

history – History documenting the training process of the model.

Initializes the model.

Parameters:
  • time_series_params – parameters of the time series that influence the training and archicture of the model.

  • model_params – configuration for the model.

Raises:

TypeError – if input_length or output_length is not an integer.

get_model(time_series_params: TimeSeriesConfig, model_params: KerasModelConfig) Model#

Returns the model.

Parameters:
  • time_series_params – parameters of time series that affects training and architecture of the model

  • model_params – configuration for the model.

Returns:

The uncompiled model.

property name: str#

Returns the models name.

Returns:

The models name.

predict(data: ndarray[Any, dtype[float64]]) ndarray[Any, dtype[float64]]#

Predicts the next timestamps for every row (time series).

Parameters:

data – np.array, where each dataframe is a time series.

Returns:

np.array, where each value is a time series.

train(train: list[numpy.ndarray[Any, numpy.dtype[numpy.float64]]]) None#

Trains the model with the given data.

Parameters:

train – training data.

validate_prediction_input(data: ndarray[Any, dtype[float64]]) None#

Validates the input of the predict function.

Parameters:

data – a single dataframe containing the input data, where the output will be predicted.

Raises:

ValueError – if data has incorrect shape (row length does not equal )

class DenseNeuralNetworkConfig(name: str = 'Keras Dense Neural Network', architecture_params: ~simba_ml.prediction.time_series.models.keras.keras_model.ArchitectureParams = <factory>, training_params: ~simba_ml.prediction.time_series.models.keras.keras_model.TrainingParams = <factory>, normalize: bool = True)#

Bases: KerasModelConfig

Defines the configuration for the DenseNeuralNetwork.