TypedColumns

Arize class used for logging typed feature or tag columns.

Usage

When initializing a Schema, TypedColumns can be used in place of a list of column names.

feature_column_names=TypedColumns( 
    inferred=["feature_1", "feature_2"], 
    to_str=["feature_3"], 
    to_int=["feature_4"] 
)

Fields

FieldData TypeDescription

inferred

Optional[List[str]]

List of columns that will not be altered at all. The values in these columns will have their type inferred as Arize validates and ingests the data. There's no difference between passing in all column names into 'inferred' vs. not using TypedColumns at all.

to_str

Optional[List[str]]

List of columns that should be cast to pandas nullable StringDType.

to_float

Optional[List[str]]

List of columns that should be cast to pandas nullable Int64DType.

to_int

Optional[List[str]]

List of columns that should be cast to pandas nullable Float64DType.

Code Example

schema = Schema(
    prediction_id_column_name='prediction_id', 
    ...
    feature_column_names=TypedColumns(
        inferred=['age'],         # columns ingested as-is
        to_float=['distance'],    # columns cast to specified type
        to_int=['purchased'],
        to_str=['country'],
    ),
    tag_column_names=TypedColumns(
        inferred=['location', 'month', 'fruit'],
        to_int=['count'],
    ),
)

Last updated

Copyright © 2023 Arize AI, Inc