---
title: MLDataValueConvertible
framework: createml
role: symbol
role_heading: Protocol
path: createml/mldatavalueconvertible
---

# MLDataValueConvertible

A type that can convert itself to and from a data value.

## Declaration

```swift
protocol MLDataValueConvertible
```

## Overview

Overview You can use any type that conforms to the MLDataValueConvertible protocol in an MLDataValue or an MLDataTable. For example, you can create a data table by using its init(dictionary:) initializer with a [String: ``MLDataValueConvertible``] dictionary.

## Topics

### Converting from a data value to a type’s instance

- [init()](createml/mldatavalueconvertible/init().md)
- [init(from:)](createml/mldatavalueconvertible/init(from:).md)

### Converting from a type’s instance to a data value

- [dataValue](createml/mldatavalueconvertible/datavalue.md)
- [dataValueType](createml/mldatavalueconvertible/datavaluetype.md)

## Relationships

### Conforming Types

- [MLDataValue.DictionaryType](createml/mldatavalue/dictionarytype.md)
- [MLDataValue.MultiArrayType](createml/mldatavalue/multiarraytype.md)
- [MLDataValue.SequenceType](createml/mldatavalue/sequencetype.md)
