arthurai.common package

Submodules

arthurai.common.constants module

class arthurai.common.constants.AccuracyMetric

Bases: arthurai.common.constants.ListableStrEnum

Accuracy = 'accuracy'
F1 = 'f1'
Precision = 'precision'
Recall = 'recall'
class arthurai.common.constants.Enrichment

Bases: arthurai.common.constants.ListableStrEnum

This class contains constants for the names of enrichments

AnomalyDetection = 'anomaly_detection'
BiasMitigation = 'bias_mitigation'
Explainability = 'explainability'
Hotspots = 'hotspots'
class arthurai.common.constants.ImageContentType

Bases: arthurai.common.constants.ListableStrEnum

Valid image content types supported by Arthur API

Gif = 'image/gif'
Jpeg = 'image/jpeg'
Png = 'image/png'
Tiff = 'image/tiff'
class arthurai.common.constants.ImageResponseType

Bases: arthurai.common.constants.ListableStrEnum

Valid image response types supported by Arthur API

LimeExplanation = 'lime_explanation'
RawImage = 'raw_image'
ResizedImage = 'resized_image'
Thumbnail = 'thumbnail'
class arthurai.common.constants.InputType

Bases: arthurai.common.constants.ListableStrEnum

Image = 'IMAGE'
NLP = 'NLP'
Tabular = 'TABULAR'
class arthurai.common.constants.ListableStrEnum

Bases: object

This class operates similar to Enum but passes mypy type checking. The members are accessed directly rather than by .name or .value.

classmethod list()

Lists all attributes in alphabetical order

class arthurai.common.constants.OutputType

Bases: arthurai.common.constants.ListableStrEnum

Multiclass = 'MULTICLASS'
Multilabel = 'MULTILABEL'
ObjectDetection = 'OBJECT_DETECTION'
Regression = 'REGRESSION'
class arthurai.common.constants.Role

Bases: arthurai.common.constants.ListableStrEnum

Administrator = 'Administrator'
ModelOwner = 'Model Owner'
User = 'User'
class arthurai.common.constants.Stage

Bases: arthurai.common.constants.ListableStrEnum

GroundTruth = 'GROUND_TRUTH'
ModelPipelineInput = 'PIPELINE_INPUT'
NonInputData = 'NON_INPUT_DATA'
PredictFunctionInput = 'PREDICT_FUNCTION_INPUT'
PredictedValue = 'PREDICTED_VALUE'
class arthurai.common.constants.TextDelimiter

Bases: arthurai.common.constants.ListableStrEnum

This class contains patterns that can be used as text_delimiter for NLP models.

Definitions:

NOT_WORD: ‘W+’ Splits on any character that is not a word. Ex:
“this is,aaaa,,,,,test!” = [“this”, “is”, “aaaa”, “test”, “”]
WHITESPACE: ‘s+ Splits on whitespace. Ex:
“this is,a test! ” = [“this”, “is,a”, “test!”, “”]
COMMA: “,” Splits on a single comma. Ex:
“this ,is,,a,test” = [“this “, “is”, “”, “a”, “test”]
COMMA_PLUS: “,+” Splits on one or more commas. Ex:
“this ,is,,a,test” = [“this “, “is”, “a”, “test”]
PIPE: “|” Splits on a single pipe. Ex:
“this |is||a|test” = [“this “, “is”, “”, “a”, “test”]
PIPE_PLUS: “|+” Splits on one or more pipes. Ex:
“this |is||a|test” = [“this “, “is”, “a”, “test”]
COMMA = ','
COMMA_PLUS = ',+'
NOT_WORD = '\\W+'
PIPE = '\\|'
PIPE_PLUS = '\\|+'
WHITESPACE = '\\s+'
class arthurai.common.constants.ValueType

Bases: arthurai.common.constants.ListableStrEnum

Boolean = 'BOOLEAN'
BoundingBox = 'BOUNDING_BOX'
Float = 'FLOAT'
Image = 'IMAGE'
Integer = 'INTEGER'
String = 'STRING'
Timestamp = 'TIMESTAMP'
Unstructured_Text = 'UNSTRUCTURED_TEXT'

arthurai.common.exceptions module

exception arthurai.common.exceptions.ArthurError

Bases: Exception

Base Error for Arthur SDK. This class should not be used directly, Arthur exceptions should inherit from either ArthurUserError or ArthurInternalError.

exception arthurai.common.exceptions.ArthurInternalError

Bases: arthurai.common.exceptions.ArthurError

Exception raised when user input is correct but an error occurs. Can be used directly but children are preferred.

exception arthurai.common.exceptions.ArthurUserError

Bases: arthurai.common.exceptions.ArthurError

Exception raised due to incorrect user input to the Arthur SDK. Can be used directly but children are preferred.

exception arthurai.common.exceptions.ExpectedParameterNotFoundError

Bases: arthurai.common.exceptions.ArthurInternalError

Exception raised when a field or property should be available from Arthur but is unexpectedly missing.

exception arthurai.common.exceptions.InternalTypeError

Bases: arthurai.common.exceptions.ArthurInternalError, TypeError

Exception raised when a value is unexpected.

exception arthurai.common.exceptions.InternalValueError

Bases: arthurai.common.exceptions.ArthurInternalError, ValueError

Exception raised when a value is unexpected.

exception arthurai.common.exceptions.MethodNotApplicableError

Bases: arthurai.common.exceptions.ArthurUserError

Exception raised when the method called is not valid for the resource.

exception arthurai.common.exceptions.MissingParameterError

Bases: arthurai.common.exceptions.ArthurUserError

Exception raised when parameters supplied to the Arthur SDK are missing.

exception arthurai.common.exceptions.ResponseClientError

Bases: arthurai.common.exceptions.ArthurUserError

Exception raised when a 4XX response is received from the API.

exception arthurai.common.exceptions.ResponseRedirectError

Bases: arthurai.common.exceptions.ArthurInternalError

Exception raised when a 3XX response is unexpectedly received from the API.

exception arthurai.common.exceptions.ResponseServerError

Bases: arthurai.common.exceptions.ArthurInternalError

Exception raised when a 5XX response is received from the API.

exception arthurai.common.exceptions.UserTypeError

Bases: arthurai.common.exceptions.ArthurUserError, TypeError

Exception raised when a user supplies an argument of the incorrect type to the Arthur SDK.

exception arthurai.common.exceptions.UserValueError

Bases: arthurai.common.exceptions.ArthurUserError, ValueError

Exception raised when a user supplies an invalid value to the Arthur SDK.

arthurai.common.exceptions.arthur_excepted(message=None)

Decorator to wrap user-facing Arthur functions with exception handling that describes to the user whether the error is their fault or is our fault and should be reported. :param message: an optional message to prefix the error with, should describe the failure e.g. “failed to send inferences” or “an error occurred while creating the model.” :return: the decorator function

arthurai.common.log module

arthurai.common.log.disable_debug_logging()

Disables debug logging for the arthurai package.

arthurai.common.log.enable_debug_logging()

Enables debug logging for the arthurai package.

arthurai.common.log.initialize_logging()

Creates a parent ‘arthurai’ logger with a console output and INFO level.

Module contents