altair.ImputeTransform#

class altair.ImputeTransform(impute=Undefined, key=Undefined, frame=Undefined, groupby=Undefined, keyvals=Undefined, method=Undefined, value=Undefined, **kwds)#

ImputeTransform schema wrapper.

Parameters:
imputestr, FieldName

The data field for which the missing values should be imputed.

keystr, FieldName

A key field that uniquely identifies data objects within a group. Missing key values (those occurring in the data but not in the current group) will be imputed.

frameSequence[None, float]

A frame specification as a two-element array used to control the window over which the specified method is applied. The array entries should either be a number indicating the offset from the current data object, or null to indicate unbounded rows preceding or following the current data object. For example, the value [-5, 5] indicates that the window should include five objects preceding and five objects following the current object.

Default value:: [null, null] indicating that the window includes all objects.

groupbySequence[str, FieldName]

An optional array of fields by which to group the values. Imputation will then be performed on a per-group basis.

keyvalsdict, Sequence[Any], ImputeSequence

Defines the key values that should be considered for imputation. An array of key values or an object defining a number sequence.

If provided, this will be used in addition to the key values observed within the input data. If not provided, the values will be derived from all unique values of the key field. For impute in encoding, the key field is the x-field if the y-field is imputed, or vice versa.

If there is no impute grouping, this property must be specified.

methodImputeMethod, Literal[‘value’, ‘median’, ‘max’, ‘min’, ‘mean’]

The imputation method to use for the field value of imputed data objects. One of "value", "mean", "median", "max" or "min".

Default value: "value"

valueAny

The field value to use when the imputation method is "value".

__init__(impute=Undefined, key=Undefined, frame=Undefined, groupby=Undefined, keyvals=Undefined, method=Undefined, value=Undefined, **kwds)#

Methods

__init__([impute, key, frame, groupby, ...])

copy([deep, ignore])

Return a copy of the object.

from_dict(dct[, validate])

Construct class from a dictionary representation.

from_json(json_string[, validate])

Instantiate the object from a valid JSON string.

resolve_references([schema])

Resolve references in the context of this object's schema or root schema.

to_dict([validate, ignore, context])

Return a dictionary representation of the object.

to_json([validate, indent, sort_keys, ...])

Emit the JSON representation for this object as a string.

validate(instance[, schema])

Validate the instance against the class schema in the context of the rootschema.

validate_property(name, value[, schema])

Validate a property against property schema in the context of the rootschema.