---
title: "labeledSensorData(featureColumns:labelColumn:recordingFileColumn:)"
framework: Create ML
role: symbol
role_heading: Instance Method
platforms: [macOS 10.15+]
path: "createml/mlactivityclassifier/datasource/labeledsensordata(featurecolumns:labelcolumn:recordingfilecolumn:)"
---

# labeledSensorData(featureColumns:labelColumn:recordingFileColumn:)

Generates a data table from the contents of the data source.

## Declaration

```swift
func labeledSensorData(featureColumns: [String], labelColumn: String? = nil, recordingFileColumn: String? = nil) throws -> MLDataTable
```

## Parameters

- `featureColumns`: The names of the feature columns the method includes in the doc://com.apple.createml/documentation/CreateML/MLDataTable it generates.
- `labelColumn`: The name of the label column. This parameter must not be nil if the data source uses doc://com.apple.createml/documentation/CreateML/MLActivityClassifier/DataSource/directoryWithDataAndAnnotation(at:annotationFileName:timeStampColumn:labelStartTimeColumn:labelEndTimeColumn:).
- `recordingFileColumn`: The name of the column with the recording file names. This parameter must not be nil if the data source uses doc://com.apple.createml/documentation/CreateML/MLActivityClassifier/DataSource/directoryWithDataAndAnnotation(at:annotationFileName:timeStampColumn:labelStartTimeColumn:labelEndTimeColumn:).

## Return Value

Return Value A new MLDataTable instance.

## Discussion

Discussion The labelColumn and recordingFileColumn parameters are optional if the data source is MLActivityClassifier.DataSource.labeledDirectories(at:). If nil, the method names the data table’s label column and data file column “label” and “recordingFile”, respectively.

## See Also

### Generating data tables from a data source

- [stratifiedSplit(proportions:seed:featureColumns:labelColumn:recordingFileColumn:)](createml/mlactivityclassifier/datasource/stratifiedsplit(proportions:seed:featurecolumns:labelcolumn:recordingfilecolumn:).md)
