src.predictive_model.time_series_prediction package

Subpackages

Submodules

src.predictive_model.time_series_prediction.TimeSeriesPredictorMixin module

class src.predictive_model.time_series_prediction.TimeSeriesPredictorMixin.TimeSeriesPredictorMixin

Bases: object

src.predictive_model.time_series_prediction.apps module

class src.predictive_model.time_series_prediction.apps.TimeSeriesPredictionConfig(app_name, app_module)

Bases: src.predictive_model.apps.PredictiveModelConfig

name = 'src.predictive_model.time_series_prediction'

src.predictive_model.time_series_prediction.custom_time_series_prediction_models module

class src.predictive_model.time_series_prediction.custom_time_series_prediction_models.RNNTimeSeriesPredictor(**kwargs)

Bases: src.predictive_model.time_series_prediction.TimeSeriesPredictorMixin.TimeSeriesPredictorMixin

Recurrent Neural Network Time Series predictor, implements the same methods as the sklearn models to make it simple to add. This architecture is of the seq2seq type, taking as input a sequence (0…t) and outputting a sequence (1…t+1)

fit(train_data)

creates and fits the predictive_model

first the encoded data is parsed, then the predictive_model created and then trained

Parameters:train_data (DataFrame) – encoded training dataset
Return type:None
predict(test_data)

returns predictive_model predictions

parses the encoded test dataset, then returns the predictive_model predictions

Parameters:test_data (DataFrame) – encoded test dataset
Return type:ndarray
Returns:predictive_model predictions

src.predictive_model.time_series_prediction.methods_default_config module

src.predictive_model.time_series_prediction.methods_default_config.time_series_prediction_rnn()

src.predictive_model.time_series_prediction.models module

class src.predictive_model.time_series_prediction.models.RecurrentNeuralNetwork(id, model_path, predictive_model, prediction_method, predictivemodel_ptr, timeseriesprediction_ptr, n_units, rnn_type, n_epochs)

Bases: src.predictive_model.time_series_prediction.models.TimeSeriesPrediction

exception DoesNotExist

Bases: src.predictive_model.time_series_prediction.models.DoesNotExist

exception MultipleObjectsReturned

Bases: src.predictive_model.time_series_prediction.models.MultipleObjectsReturned

get_rnn_type_display(*, field=<django.db.models.fields.CharField: rnn_type>)
n_epochs

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

n_units

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

rnn_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

timeseriesprediction_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

timeseriesprediction_ptr_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

to_dict()
class src.predictive_model.time_series_prediction.models.TimeSeriesPrediction(*args, **kwargs)

Bases: src.predictive_model.models.PredictiveModel

Container of Classification to be shown in frontend

exception DoesNotExist

Bases: src.predictive_model.models.DoesNotExist

exception MultipleObjectsReturned

Bases: src.predictive_model.models.MultipleObjectsReturned

static init(configuration)
predictivemodel_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

predictivemodel_ptr_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

recurrentneuralnetwork

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

class src.predictive_model.time_series_prediction.models.TimeSeriesPredictionMethods

Bases: enum.Enum

An enumeration.

RNN = 'rnn'

src.predictive_model.time_series_prediction.time_series_prediction module

time series prediction methods and functionalities

src.predictive_model.time_series_prediction.time_series_prediction.time_series_prediction(training_df, test_df, clusterer, job)

main time series prediction entry point

train and tests the time series predictor using the provided data

Parameters:
  • clusterer (Clustering) –
  • training_df (DataFrame) – training DataFrame
  • test_df (DataFrame) – testing DataFrame
  • job (Job) – job configuration
Return type:

(<class ‘dict’>, <class ‘dict’>)

Returns:

predictive_model scores and split

src.predictive_model.time_series_prediction.time_series_prediction.time_series_prediction_single_log(input_df, model)

single log time series prediction

time series predicts a single log using the provided TODO: complete

Parameters:
  • input_df (DataFrame) – input DataFrame
  • model (dict) – TODO: complete
Return type:

dict

Returns:

predictive_model scores

Module contents