TypedValue

Arize class used for logging typed feature or tag values.

Usage

When creating a dictionary of features or tags passed into log(), TypedValue can be used in place of dictionary values.

# Example features; features & tags can be optionally defined with typing
features = {
    'state': 'ca',
    'city': 'berkeley',
    'merchant_name': 'Peets Coffee',
    'pos_approved': TypedValue(value=False, type=ArizeTypes.INT),
    'item_count': 10,
    'merchant_type': 'coffee shop',
    'charge_amount': TypedValue(value=20.11, type=ArizeTypes.FLOAT),
}
    
# example tags
tags = {
    'age': 30,
    'zip_code': '94610',
    'device_os': 'iOS',
    'server_node_id': TypedValue(value=12, type=ArizeTypes.INT),
}

Fields

FieldField TypeDescription

value

Union[str, int, float, bool]

The feature or tag value to be cast.

type

ArizeTypes

The Arize feature or tag column type that value should be cast to.

ArizeTypes Enum

Values

INT

FLOAT

STR

Last updated

Copyright © 2023 Arize AI, Inc