---
title: MLDataValue
framework: createml
role: symbol
role_heading: Enumeration
path: createml/mldatavalue
---

# MLDataValue

The value of a cell in a data table.

## Declaration

```swift
enum MLDataValue
```

## Overview

Overview The MLDataValue enumeration is the fundamental type that you use to store training data in a table. Classifiers use data values to store information like evaluation metrics. Data values wrap all of the possible data types you can use with Create ML. To access the underlying information in a data value, you can use the properties that correspond to the type’s enumeration cases. If you aren’t sure which kind of value a data value wrapper contains, use a switch statement to unwrap the value, or check the value of the type property.

## Topics

### Converting between types and data values

- [MLDataValueConvertible](createml/mldatavalueconvertible.md)

### Creating a data value

- [MLDataValue.int(_:)](createml/mldatavalue/int(_:).md)
- [MLDataValue.double(_:)](createml/mldatavalue/double(_:).md)
- [MLDataValue.string(_:)](createml/mldatavalue/string(_:).md)
- [MLDataValue.dictionary(_:)](createml/mldatavalue/dictionary(_:).md)
- [MLDataValue.sequence(_:)](createml/mldatavalue/sequence(_:).md)
- [MLDataValue.multiArray(_:)](createml/mldatavalue/multiarray(_:).md)

### Inspecting the type

- [type](createml/mldatavalue/type.md)
- [MLDataValue.ValueType](createml/mldatavalue/valuetype.md)

### Accessing numeric values

- [intValue](createml/mldatavalue/intvalue.md)
- [doubleValue](createml/mldatavalue/doublevalue.md)

### Accessing string values

- [stringValue](createml/mldatavalue/stringvalue.md)

### Accessing dictionary values

- [dictionaryValue](createml/mldatavalue/dictionaryvalue.md)
- [MLDataValue.DictionaryType](createml/mldatavalue/dictionarytype.md)

### Accessing array values

- [sequenceValue](createml/mldatavalue/sequencevalue.md)
- [MLDataValue.SequenceType](createml/mldatavalue/sequencetype.md)
- [multiArrayValue](createml/mldatavalue/multiarrayvalue.md)
- [MLDataValue.MultiArrayType](createml/mldatavalue/multiarraytype.md)

### Comparing data values

- [==(_:_:)](createml/mldatavalue/==(_:_:).md)

### Describing a data value

- [description](createml/mldatavalue/description.md)
- [debugDescription](createml/mldatavalue/debugdescription.md)

### Handling errors

- [MLDataValue.invalid](createml/mldatavalue/invalid.md)
- [isValid](createml/mldatavalue/isvalid.md)

### Default Implementations

- [CustomDebugStringConvertible Implementations](createml/mldatavalue/customdebugstringconvertible-implementations.md)
- [CustomStringConvertible Implementations](createml/mldatavalue/customstringconvertible-implementations.md)
- [Equatable Implementations](createml/mldatavalue/equatable-implementations.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)

## See Also

### Tabular data

- [MLDataTable](createml/mldatatable.md)
- [Data visualizations](createml/data-visualizations.md)
