init(sequences:)
Creates a new column of machine learning sequences by converting the elements of another column.
Declaration
init(sequences: MLUntypedColumn)Parameters
- sequences:
A column with elements that are convertible to Create ML sequences.
Return Value
A new untyped column of doubles; otherwise an invalid column if any element of the given column cannot be converted to MLDataValue.SequenceType.
Discussion
Use this initializer to create a column of sequences from another column. As an example, to create a column with this initializer, first start with a column that is convertible to sequences.
let intSequenceString = "[1, 2, 3]"
let intSequenceString2 = "[4, 5, 6]"
let stringsColumn = MLUntypedColumn([intSequenceString, intSequenceString2])
print(stringsColumn)
/* Prints...
ValueType: String
Values: [[1, 2, 3], [4, 5, 6]]
*/Then use init(sequences:) to convert the column to a column of sequences.
let sequenceColumn = MLUntypedColumn(sequences: stringsColumn)
print(sequenceColumn)
/* Prints...
ValueType: Sequence
Values: [[DataValue(1), DataValue(2), DataValue(3)],
[DataValue(4), DataValue(5), DataValue(6)]]
*/