simpleml.models
Import modules to register class names in global registry
Expose classes in one import module
Models Directory follows this structure: Generic Base -> Library Base -> Domain Base -> Individual Models (ex: Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Subpackages
simpleml.models.classifiers
simpleml.models.classifiers.keras
simpleml.models.classifiers.sklearn
simpleml.models.classifiers.sklearn.base_sklearn_classifier
simpleml.models.classifiers.sklearn.dummy
simpleml.models.classifiers.sklearn.ensemble
simpleml.models.classifiers.sklearn.gaussian_process
simpleml.models.classifiers.sklearn.linear_model
simpleml.models.classifiers.sklearn.mixture
simpleml.models.classifiers.sklearn.multiclass
simpleml.models.classifiers.sklearn.multioutput
simpleml.models.classifiers.sklearn.naive_bayes
simpleml.models.classifiers.sklearn.neighbors
simpleml.models.classifiers.sklearn.neural_network
simpleml.models.classifiers.sklearn.svm
simpleml.models.classifiers.sklearn.tree
simpleml.models.classifiers.classification_mixin
simpleml.models.classifiers.external_models
simpleml.models.clusterers
simpleml.models.regressors
simpleml.models.transfer
Submodules
Package Contents
Classes
Base Keras model class. Keras objects are incrementally structured until |
|
Specific subset of Seq2Seq models that contain encoder and decoder architectures |
|
Specific subset of Seq2Seq models that contain encoder and decoder architectures |
|
Specific subset of Seq2Seq models that contain encoder and decoder architectures |
|
Base Keras model class. Keras objects are incrementally structured until |
|
Base Keras model class. Keras objects are incrementally structured until |
|
Base class for sequence to sequence models. Differ from traditional models |
|
Base Keras model class. Keras objects are incrementally structured until |
|
Main model class needs to be initialize-able in order to play nice with |
|
Base class for all Model objects. Defines the required |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
|
No different than base model. Here just to maintain the pattern |
Attributes
- class simpleml.models.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)
Keras returns class tuples (proba equivalent) so cast to single prediction
- class simpleml.models.KerasEncoderDecoderClassifier(use_training_generator=False, training_generator_params=None, use_validation_generator=False, validation_generator_params=None, use_sequence_object=False, **kwargs)[source]
Bases:
KerasSeq2SeqClassifier
Specific subset of Seq2Seq models that contain encoder and decoder architectures
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={}
- check_for_models(self, rebuild=False)
- decode(self, X)
- encode(self, X)
- class simpleml.models.KerasEncoderDecoderStateClassifier(use_training_generator=False, training_generator_params=None, use_validation_generator=False, validation_generator_params=None, use_sequence_object=False, **kwargs)[source]
Bases:
KerasEncoderDecoderClassifier
Specific subset of Seq2Seq models that contain encoder and decoder architectures with a state value to be propagated for each decoder timestep (eg LSTM/GRU decoder states)
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, end_index, max_length=None, **kwargs)
Inference network differs from training one so gets established dynamically at inference time. Does NOT get persisted since the weights are duplicative to the training ones. And the training network can in theory be updated with new training data later
Runs full encoder/decoder loop 1) Encodes input into initial decoder state 2) Loops through decoder state until:
End token is predicted
Max length is reached
- class simpleml.models.KerasEncoderDecoderStatelessClassifier(use_training_generator=False, training_generator_params=None, use_validation_generator=False, validation_generator_params=None, use_sequence_object=False, **kwargs)[source]
Bases:
KerasEncoderDecoderStateClassifier
Specific subset of Seq2Seq models that contain encoder and decoder architectures withOUT a state value to be propagated for each decoder timestep. These architectures typically use repeat vectors to duplicate decoder inputs for later timesteps
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, end_index, max_length=None, **kwargs)
Inference network differs from training one so gets established dynamically at inference time. Does NOT get persisted since the weights are duplicative to the training ones. And the training network can in theory be updated with new training data later
Runs full encoder/decoder loop 1) Encodes input into initial decoder state 2) Loops through decoder state until:
End token is predicted
Max length is reached
- class simpleml.models.KerasModel(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_model.LibraryModel
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={}
- abstract _create_external_model(self, **kwargs)
Abstract method for each subclass to implement should return the desired model object
Must return external_file
Keras pattern is: external_model = SomeWrappedKerasClass(**kwargs) return self.build_network(external_model)
- _fit(self)
Keras fit parameters (epochs, callbacks…) are stored as self.params so retrieve them automatically
- _fit_generator(self)
Keras fit parameters (epochs, callbacks…) are stored as self.params so retrieve them automatically
- build_network(self, external_model, **kwargs)
Design choice to require build network method instead of exposing raw Keras objects that can be modified later. Simplifies saving and loading pattern because initialized object should also be the final state (as long as manual override doesnt happen)
- get_params(self, **kwargs)
Get fit params
- set_params(self, **kwargs)
Keras networks don’t have params beyond layers, which should be configured in self.build_network, so use this for fit params - self.fit will auto pull params and pass them to the fit method.
TODO: Figure out if changing params should be allowed after fit. If they are, would need to reinitialize model, otherwise it would train more epochs and not forget the original training. If not, once fit, we can treat the model as static, and no longer able to be changed
For now going with option 2 - cannot refit models
- static transfer_weights(new_model, old_model)
- class simpleml.models.KerasModelClassifier(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.classifiers.keras.base_keras_classifier.KerasClassifier
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={}
- class simpleml.models.KerasSeq2SeqClassifier(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.classifiers.keras.model.KerasModelClassifier
Base class for sequence to sequence models. Differ from traditional models because training and inference use different architectures
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)
Inference network differs from training one so gets established dynamically at inference time. Does NOT get persisted since the weights are duplicative to the training ones. And the training network can in theory be updated with new training data later
- abstract build_inference_network(self, model)
Inference network - Differs from training one so gets established dynamically at inference time
return: inference_model(s) rtype: self.external_model.__class__
- check_for_models(self, rebuild=False)
- predict(self, X, **kwargs)
Seq2Seq models have unpredictable results so overwrite batch process and return arrays instead of fixed size matrix (nXm vs nX1)
- class simpleml.models.KerasSequentialClassifier(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.classifiers.keras.base_keras_classifier.KerasClassifier
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={}
- class simpleml.models.LibraryModel(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
Model
Main model class needs to be initialize-able in order to play nice with database persistence and loading. This class is the in between that defines the expected methods for each extended library.
Examples: Scikit-learn estimators –> SklearnModel(LibraryModel): … Keras estimators –> KerasModel(LibraryModel): … PyTorch … …
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- abstract _fit(self)
Abstract method to act as a placeholder. Inheriting classes MUST instantiate this method to manage the fit operation. Intentionally not abstracting function because each library internally configures a little differently
- class simpleml.models.Model(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.persistables.base_persistable.Persistable
Base class for all Model objects. Defines the required parameters for versioning and all other metadata can be stored in the arbitrary metadata field
Also outlines the expected subclass methods (with NotImplementedError). Design choice to not abstract unified API across all libraries since each has a different internal mechanism
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- object_type = MODEL
- abstract _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- abstract _fit(self)
Abstract method to act as a placeholder. Inheriting classes MUST instantiate this method to manage the fit operation. Intentionally not abstracting function because each library internally configures a little differently
- _hash(self)
- Hash is the combination of the:
Pipeline
Model
Params
Config
May only include attributes that exist at instantiation. Any attribute that gets calculated later will result in a race condition that may return a different hash depending on when the function is called
- _load_pipeline(self)
Helper to fetch the pipeline
- _predict(self, X, **kwargs)
Separate out actual predict call for optional overwrite in subclasses
- add_pipeline(self, pipeline)
Setter method for dataset pipeline used
- Parameters
pipeline (simpleml.pipelines.Pipeline) –
- Return type
None
- assert_fitted(self, msg='')
Helper method to raise an error if model isn’t fit
- assert_pipeline(self, msg='')
Helper method to raise an error if pipeline isn’t present and configured
- property external_model(self)
All model objects are going to require some filebase persisted object
Wrapper around whatever underlying class is desired (eg sklearn or keras)
- fit(self, **kwargs)
Pass through method to external model after running through pipeline
- fit_predict(self, **kwargs)
Wrapper for fit and predict methods
- property fitted(self)
- get_feature_metadata(self, **kwargs)
Abstract method for each model to define
Should return a dict of feature information (importance, coefficients…)
- get_labels(self, dataset_split=None)
Wrapper method to return labels from dataset
- get_params(self, **kwargs)
Pass through method to external model
- property pipeline(self)
Use a weakref to bind linked pipeline so it doesnt bloat usage returns pipeline if still available or tries to fetch otherwise
- predict(self, X, transform=True, **kwargs)
Pass through method to external model after running through pipeline :param transform: bool, whether to transform input via pipeline
before predicting, default True
- save(self, **kwargs)
Extend parent function with a few additional save routines
save params
save feature metadata
- score(self, X, y=None, **kwargs)
Pass through method to external model
- set_params(self, **params)
Pass through method to external model
- transform(self, *args, **kwargs)
Run input through pipeline – only method that should reference the pipeline relationship directly (gates the connection point for easy extension in the future)
- class simpleml.models.SklearnAdaBoostClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnBaggingClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnBayesianGaussianMixture(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnBernoulliNB(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.base_sklearn_model.SklearnModel
,simpleml.models.classifiers.classification_mixin.ClassificationMixin
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- class simpleml.models.SklearnClassifierChain(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnDecisionTreeClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnDummyClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnExtraTreeClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnExtraTreesClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnGaussianMixture(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnGaussianNB(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnGaussianProcessClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnGradientBoostingClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnHistGradientBoostingClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnKNeighborsClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnLinearSVC(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnLogisticRegression(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnLogisticRegressionCV(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnMLPClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnModel(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.base_model.LibraryModel
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _fit(self)
Separate out actual fit call for optional overwrite in subclasses
Sklearn estimators don’t support data generators, so do not expose fit_generator method
- class simpleml.models.SklearnMultiOutputClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnMultinomialNB(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnNuSVC(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnOneVsOneClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnOneVsRestClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnOutputCodeClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnPerceptron(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnRandomForestClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnRidgeClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnRidgeClassifierCV(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnSGDClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnSVC(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object
- class simpleml.models.SklearnVotingClassifier(has_external_files=True, external_model_kwargs=None, params=None, fitted=False, pipeline_id=None, **kwargs)[source]
Bases:
simpleml.models.classifiers.sklearn.base_sklearn_classifier.SklearnClassifier
No different than base model. Here just to maintain the pattern Generic Base -> Library Base -> Domain Base -> Individual Models (ex: [Library]Model -> SklearnModel -> SklearnClassifier -> SklearnLogisticRegression)
Need to explicitly separate passthrough kwargs to external models since most do not support arbitrary **kwargs in the constructors
Two supported patterns - full initialization in constructor or stepwise configured before fit and save
- Parameters
- _create_external_model(self, **kwargs)
Abstract method for each subclass to implement
should return the desired model object