---
title: CategoricalImputer
framework: createmlcomponents
role: symbol
role_heading: Structure
path: createmlcomponents/categoricalimputer
---

# CategoricalImputer

An estimator that replaces missing values in the categorical input.

## Declaration

```swift
struct CategoricalImputer<Element> where Element : Decodable, Element : Encodable, Element : Hashable
```

## Topics

### Creating an estimator

- [init(_:)](createmlcomponents/categoricalimputer/init(_:).md)
- [init(constant:)](createmlcomponents/categoricalimputer/init(constant:).md)

### Getting the properties

- [strategy](createmlcomponents/categoricalimputer/strategy-swift.property.md)

### Fitting

- [fitted(to:eventHandler:)](createmlcomponents/categoricalimputer/fitted(to:eventhandler:).md)
- [Transformer](createmlcomponents/transformer.md)
- [CategoricalImputer.Strategy](createmlcomponents/categoricalimputer/strategy-swift.enum.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [Escapable](swift/escapable.md)
- [Estimator](createmlcomponents/estimator.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Preprocessors

- [LinearTransformer](createmlcomponents/lineartransformer.md)
- [ImputeTransformer](createmlcomponents/imputetransformer.md)
- [OneHotEncoder](createmlcomponents/onehotencoder.md)
- [OrdinalEncoder](createmlcomponents/ordinalencoder.md)
- [NumericImputer](createmlcomponents/numericimputer.md)
- [Reshaper](createmlcomponents/reshaper.md)
- [OptionalUnwrapper](createmlcomponents/optionalunwrapper.md)
