ads.model.extractor package¶
Submodules¶
ads.model.extractor.keras_extractor module¶
- class ads.model.extractor.keras_extractor.KerasExtractor(model)[source]¶
Bases:
ModelInfoExtractor
Class that extract model metadata from keras models.
- property algorithm¶
Extracts the algorithm of the model.
- Returns:
The algorithm of the model.
- Return type:
- property framework¶
Extracts the framework of the model.
- Returns:
The framework of the model.
- Return type:
- property hyperparameter¶
Extracts the hyperparameters of the model.
- Returns:
The hyperparameters of the model.
- Return type:
ads.model.extractor.lightgbm_extractor module¶
- class ads.model.extractor.lightgbm_extractor.LightgbmExtractor(model)[source]¶
Bases:
ModelInfoExtractor
Class that extract model metadata from lightgbm models.
- property algorithm¶
Extracts the algorithm of the model.
- Returns:
The algorithm of the model.
- Return type:
- property framework¶
Extracts the framework of the model.
- Returns:
The framework of the model.
- Return type:
- property hyperparameter¶
Extracts the hyperparameters of the model.
- Returns:
The hyperparameters of the model.
- Return type:
ads.model.extractor.model_info_extractor module¶
- class ads.model.extractor.model_info_extractor.ModelInfoExtractor[source]¶
Bases:
ABC
The base abstract class to extract model metadata.
- abstract algorithm()[source]¶
The abstract method to extracts the algorithm of the model.
- Returns:
The algorithm of the model.
- Return type:
- abstract framework()[source]¶
The abstract method to extracts the framework of the model.
- Returns:
The framework of the model.
- Return type:
- abstract hyperparameter()[source]¶
The abstract method to extracts the hyperparameters of the model.
- Returns:
The hyperparameter of the model.
- Return type:
- ads.model.extractor.model_info_extractor.normalize_hyperparameter(data: Dict) dict [source]¶
Converts all the fields to string to make sure it’s json serializable.
- Parameters:
data (([Dict])) – The hyperparameter returned by the model.
- Returns:
Normalized (json serializable) dictionary.
- Return type:
Dict
ads.model.extractor.model_info_extractor_factory module¶
- class ads.model.extractor.model_info_extractor_factory.ModelInfoExtractorFactory[source]¶
Bases:
object
Class that extract Model Taxonomy Metadata for all supported frameworks.
- static extract_info(model)[source]¶
Extracts model taxonomy metadata.
- Parameters:
model ([ADS model, sklearn, xgboost, lightgbm, keras, oracle_automl]) – The model object
- Returns:
A dictionary with keys of Framework, FrameworkVersion, Algorithm, Hyperparameters of the model
- Return type:
ModelTaxonomyMetadata
Examples
>>> from ads.common.model_info_extractor_factory import ModelInfoExtractorFactory >>> metadata_taxonomy = ModelInfoExtractorFactory.extract_info(model)
ads.model.extractor.pytorch_extractor module¶
- class ads.model.extractor.pytorch_extractor.PyTorchExtractor(model)[source]¶
Bases:
ModelInfoExtractor
Class that extract model metadata from pytorch models.
- property algorithm¶
Extracts the algorithm of the model.
- Returns:
The algorithm of the model.
- Return type:
- property framework¶
Extracts the framework of the model.
- Returns:
The framework of the model.
- Return type:
- property hyperparameter¶
Extracts the hyperparameters of the model.
- Returns:
The hyperparameters of the model.
- Return type:
- class ads.model.extractor.pytorch_extractor.PytorchExtractor(model)[source]¶
Bases:
PyTorchExtractor
ads.model.extractor.sklearn_extractor module¶
- class ads.model.extractor.sklearn_extractor.SklearnExtractor(model)[source]¶
Bases:
ModelInfoExtractor
Class that extract model metadata from sklearn models.
- property algorithm¶
Extracts the algorithm of the model.
- Returns:
The algorithm of the model.
- Return type:
- property framework¶
Extracts the framework of the model.
- Returns:
The framework of the model.
- Return type:
- property hyperparameter¶
Extracts the hyperparameters of the model.
- Returns:
The hyperparameters of the model.
- Return type:
ads.model.extractor.spark_extractor module¶
- class ads.model.extractor.spark_extractor.SparkExtractor(model)[source]¶
Bases:
ModelInfoExtractor
Class that extract model metadata from pyspark models.
- property algorithm¶
Extracts the algorithm of the model.
- Returns:
The algorithm of the model.
- Return type:
- property framework¶
Extracts the framework of the model.
- Returns:
The framework of the model.
- Return type:
- property hyperparameter¶
Extracts the hyperparameters of the model.
- Returns:
The hyperparameters of the model
- Return type:
ads.model.extractor.tensorflow_extractor module¶
- class ads.model.extractor.tensorflow_extractor.TensorflowExtractor(model)[source]¶
Bases:
ModelInfoExtractor
Class that extract model metadata from tensorflow models.
- property algorithm¶
Extracts the algorithm of the model.
- Returns:
The algorithm of the model.
- Return type:
- property framework¶
Extracts the framework of the model.
- Returns:
The framework of the model.
- Return type:
- property hyperparameter¶
Extracts the hyperparameters of the model.
- Returns:
The hyperparameters of the model.
- Return type:
ads.model.extractor.xgboost_extractor module¶
- class ads.model.extractor.xgboost_extractor.XgboostExtractor(model)[source]¶
Bases:
ModelInfoExtractor
Class that extract model metadata from xgboost models.
- property algorithm¶
Extracts the algorithm of the model.
- Returns:
The algorithm of the model.
- Return type:
- property framework¶
Extracts the framework of the model.
- Returns:
The framework of the model.
- Return type:
- property hyperparameter¶
Extracts the hyperparameters of the model.
- Returns:
The hyperparameters of the model.
- Return type: