babao.models package

Submodules

babao.models.modelBase module

Base class for any model

class babao.models.modelBase.ABCModel[source]

Bases: abc.ABC

Base class for any model

dependencies_class

List of models or inputs needed by the current model

These should be class, not instances!

load()[source]

Load the model from self.model_file

need_training

Specify if the current model need to be trained

plot(since)[source]

Plot the model predictions from ´since´ timestamp

predict(since)[source]

Return a dataframe of prediction starting from ´since´ timestamp

save()[source]

Save the model to self.model_file

train(since)[source]

Train the model with data starting from ´since´ timestamp

Return the score of model.

babao.models.modelBase.addLookbacks(df, look_back)[source]

Add lookback(s) (shifted columns) to each df columns

babao.models.modelBase.addLookbacks3d(arr, look_back)[source]

Add lookback(s) (shifted columns) to each df columns Reshape the features to be keras-proof (3d)

babao.models.modelBase.getVerbose() → int[source]

Transform our verbose level to match keras one

babao.models.modelBase.reshape(arr)[source]

Reshape the features to be keras-proof

babao.models.modelManager module

The idea here is to give a common interface to all the models so you can use these wrappers to call all of them at once.

babao.models.modelManager.plotModels(since)[source]

Plot all models

babao.models.modelManager.predictModelsMaybeTrade(since)[source]

Call predict on the root model, then eventually trade based on the preduction

babao.models.modelManager.trainModels(since)[source]

Train all models and save the awesome result

babao.models.rootModel module

Root Model, base of the models tree

class babao.models.rootModel.RootModel[source]

Bases: babao.models.modelBase.ABCModel

Root Model, base of the models tree

Not modeling much, but handle the call of the dependencies predictions

dependencies_class = [<class 'babao.models.tree.extremaModel.ExtremaModel'>]
load()[source]

Load the model from self.model_file

need_training = False
plot(since)[source]

Plot the model predictions from ´since´ timestamp

predict(since)[source]

Call predict on the dependencies, then somehow merge the results

save()[source]

Save the model to self.model_file

train(since)[source]

Train the model with data starting from ´since´ timestamp

Return the score of model.

Module contents