simpleml.models.classifiers.keras.base_keras_classifier

Base module for keras classifier models

Module Contents

Classes

KerasClassifier

Base Keras model class. Keras objects are incrementally structured until

Attributes

__author__

simpleml.models.classifiers.keras.base_keras_classifier.__author__ = Elisha Yadgaran[source]
class simpleml.models.classifiers.keras.base_keras_classifier.KerasClassifier(use_training_generator=False, training_generator_params=None, use_validation_generator=False, validation_generator_params=None, use_sequence_object=False, **kwargs)[source]

Bases: simpleml.models.base_keras_model.KerasModel, simpleml.models.classifiers.classification_mixin.ClassificationMixin

Base Keras model class. Keras objects are incrementally structured until fit. Also dont have separable params. Class hijacks params to store fit params instead (enables full specification on init for reproducibility)

Pass default save method as Keras’s persistence pattern

Parameters
  • use_training_generator (Bool) – Whether to propagate use of a generator object when training – does not allow for using a generator in production – only fit_generator

  • use_validation_generator (Bool) – Whether to ALSO use a generator for validation data while training. Does nothing if use_training_generator is false

  • training_generator_params – parameters to pass to the generator method for train split - normal fit(_generator) params should be passed as params={}

  • validation_generator_params – parameters to pass to the generator method for validation split - normal fit(_generator) params should be passed as params={}

_predict(self, X, **kwargs)[source]

Keras returns class tuples (proba equivalent) so cast to single prediction