TabularData

RSS for tag

Import, organize, and prepare a table of data to train a machine learning model.

Posts under TabularData tag

5 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

TabularData Resources
TabularData framework lets you import, organize, and export a table of data. It’s great when you’re training a machine learning model but it’s a handy tool in many other scenarios as well. General: DevForums tag: TabularData TabularData framework documentation Explore and manipulate data in Swift with TabularData tech talk For a ‘hello world’ style example, see this DevForums post Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com"
0
0
1.2k
Mar ’23
error: cannot find 'MLDataTable' in scope
I have tried multiple playgrounds and consistently get the same error in any playground I create. There is a tabular data playground that does work but I see nothing I am not doing. Here is the code that fails with Error: cannot find 'MLDataTable' in scope /* code start */ import CoreML import Foundation import TabularData let jsonFile = Bundle.main.url(forResource: "sentiment_analysis", withExtension: "json")! let tempTable = try DataTable let dataTable = try MLDataTable(contentsOf: jsonFile) print(dataTable) /* code end */
3
0
915
Jul ’23
TabluarData DataFrame removing row results in EXC_BAD_ACCESS
I am working with data in Swift using the TabularData framework. I load data from a CSV file into a DataFrame, then copy the data into a second DataFrame, and finally remove a row from the second DataFrame. The problem arises when I try to remove a row from the second DataFrame, at which point I receive an EXC_BAD_ACCESS error. However, if I modify the "timings" column (the final column) before removing the row (even to an identical value), the code runs without errors. Interestingly, this issue only occurs when a row in the column of the CSV file contains more than 15 characters. This is the code I'm using: func loadCSV() { let documentsDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! let url = documentsDirectory.appendingPathComponent("example.csv") var dataframe: DataFrame do { dataframe = try .init( contentsOfCSVFile: url, columns: ["user", "filename", "syllable count", "timings"], types: ["user": .string, "filename": .string, "syllable count": .integer, "timings": .string] ) } catch { fatalError("Failed to load csv data") } print("First data frame",dataframe, separator: "\n") /// This works var secondFrame = DataFrame() secondFrame.append(column: Column<String>(name: "user", capacity: 1000)) secondFrame.append(column: Column<String>(name: "filename", capacity: 1000)) secondFrame.append(column: Column<Int>(name: "syllable count", capacity: 1000)) secondFrame.append(column: Column<String>(name: "timings", capacity: 1000)) for row in 0..<dataframe.rows.count { secondFrame.appendEmptyRow() for col in 0..<4 { secondFrame.rows[row][col] = dataframe.rows[row][col] } } // secondFrame.rows[row][3, String.self] = String("0123456789ABCDEF") /* If we include this line, it will not crash, even though the content is the same */ print("Second data frame before removing row",dataframe, separator: "\n") // Before removal secondFrame.removeRow(at: 0) print("Second data frame after removing row",dataframe, separator: "\n") // After removal—we will get Thread 1: EXC_BAD_ACCESS here. The line will still print, however } and the csv (minimal example): user,filename,syllable count,timings john,john-001,12,0123456789ABCDEF jane,jane-001,10,0123456789ABCDE I've been able to replicate this bug on macOS and iOS using minimal projects. I'm unsure why this error is occurring and why modifying the "timings" column prevents it. It should be noted that this same error occurs with a single data frame loaded from a CSV file, which means that I basically cannot load from CSV if I want to modify the DataFrame afterwards.
2
1
752
Aug ’23
Is there a way to apply for formatting option to a Dataframe column outside of the explicit description(options:) method?
I'm building up a data frame for the sole purpose of using that lovely textual grid output. I'm getting output without any issue, but I'm trying to sort out how I might apply a formatter to a specific column so that print(dataframeInstance) "just works" nicely. In my use case, I'm running a function, collecting its output - appending that into a frame, and then using TabularData to get a nice output in a unit test, so I can see the patterns within the output. I found https://developer.apple.com/documentation/tabulardata/column/description(options:), but wasn't able to find any way to "pre-bind" that to a dataframe Column when I was creating it. (I have some double values that get a bit "excessive" in length due to the joys of floating point rounding) Is there a way of setting a formatter on a column at creation time, or after (using a property) that could basically use the same pattern as that description method above?
1
0
598
Nov ’23
FB13516799: Training Tabular Regression ML Models on large datasets in Xcode 15 continuously "Processing"
Hi, In Xcode 14 I was able to train linear regression models with Create ML using large CSV files (I tested on about 30000 items and 5 features): However, in Xcode 15 (I tested on 15.0.1 and 15.1), the training continuously stays in the "Processing" state: When using a dataset with 900 items, everything works fine. I filed a feedback for this issue: FB13516799. Does anybody else have this issue / can reproduce it?
2
0
788
Jan ’24