Posts

Post not yet marked as solved
4 Replies
554 Views
I'm following Apple WWDC video (https://developer.apple.com/videos/play/wwdc2021/10037/) about how to create a recommendation model. But I'm getting this error when I run the project on that like of code from their tutorial. "Column keywords has element of unsupported type Dictionary<String, Double>." Here is the block of code took from the transcript of WWDC video that cause me issue: func featuresFromMealAndKeywords(meal: String, keywords: [String]) -> [String: Double] { // Capture interactions between content (the dish keywords) and context (meal) by // adding a copy of each keyword modified to include the meal. let featureNames = keywords + keywords.map { meal + ":" + $0 } // For each keyword, create an entry in a dictionary of features with a value of 1.0. return featureNames.reduce(into: [:]) { features, name in features[name] = 1.0 } } var trainingKeywords: [[String: Double]] = [] var trainingTargets: [Double] = [] for item in userPurchasedItems { // Add in the positive example. trainingKeywords.append( featuresFromMealAndKeywords(meal: item.meal, keywords: item.keywords)) trainingTargets.append(1.0) // Add in the negative example. let negativeKeywords = allKeywords.subtracting(item.keywords) trainingKeywords.append( featuresFromMealAndKeywords(meal: item.meal, keywords: Array(negativeKeywords))) trainingTargets.append(-1.0) } // Create the training data. var trainingData = DataFrame() trainingData.append(column: Column(name: "keywords" contents: trainingKeywords)) trainingData.append(column: Column(name: "target", contents: trainingTargets)) // Create the model. let model = try MLLinearRegressor(trainingData: trainingData, targetColumn: "target") Did DataFrame implementation changed since then and doesn't support Dictionary anymore? I'm at lost right now on how to reproduce their example.
Posted Last updated
.
Post not yet marked as solved
4 Replies
2.5k Views
Everytime I launch Xcode now i'm getting this crash. I tried all version of XCode 15 and none are working. Only Xcode 14 opens properly. Process: Xcode [971] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 15.0 (22265) Build Info: IDEApplication-22265000000000000~3 (15A240d) Code Type: ARM-64 (Native) Parent Process: launchd [1] User ID: 501 Date/Time: 2023-09-22 15:19:20.4158 -0400 OS Version: macOS 13.5.2 (22G91) Report Version: 12 Anonymous UUID: 552B0663-5A0A-7299-3393-EAB927768D4A Time Awake Since Boot: 120 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6 Terminating Process: Xcode [971] Application Specific Information: abort() called Application Specific Signatures: _mutableDirectExtensions != ((void *)0) Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x1a88ec764 __pthread_kill + 8 1 libsystem_pthread.dylib 0x1a8923c28 pthread_kill + 288 2 libsystem_c.dylib 0x1a8831ae8 abort + 180 3 IDEKit 0x106f74d58 +[IDEAssertionHandler _handleAssertionWithLogString:assertionSignature:assertionReason:extraBacktrace:] + 972 4 IDEKit 0x106f75198 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] + 872 5 DVTFoundation 0x1028199a8 _DVTAssertionHandler + 424 6 DVTFoundation 0x102819b28 _DVTAssertionFailureHandler + 196 7 DVTFoundation 0x1028618d0 -[DVTExtensionPoint _registerExtension:] + 296 8 DVTFoundation 0x102685360 -[DVTExtension awakeFromPropertyList] + 176 9 DVTFoundation 0x1026c2530 -[DVTPlugIn awakeFromPropertyList] + 308 10 DVTFoundation 0x1027f85a4 -[DVTPlugInManager _createPlugInObjectsFromScanRecords:] + 340 11 DVTFoundation 0x1027f6a30 __52-[DVTPlugInManager _recordNonApplePlugInDescriptor:]_block_invoke + 92 12 DVTFoundation 0x1027f6ff8 -[DVTPlugInManager _allowNonApplePlugInsFromDescriptors:error:] + 304 13 DVTFoundation 0x1027f71e0 -[DVTPlugInManager _checkNonApplePlugIns] + 204 14 DVTFoundation 0x1027f72bc -[DVTPlugInManager initializePlugIns:] + 20 15 IDEFoundation 0x1088250c8 _IDEInitializeOtherPlugInStuff + 168 16 IDEFoundation 0x108827408 IDEInitialize + 4952 17 IDEKit 0x106f54620 -[IDEApplicationController applicationWillFinishLaunching:] + 484 18 CoreFoundation 0x1a89f7180 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148 19 CoreFoundation 0x1a8a92eec ___CFXRegistrationPost_block_invoke + 88 20 CoreFoundation 0x1a8a92e34 _CFXRegistrationPost + 440 21 CoreFoundation 0x1a89c84cc _CFXNotificationPost + 704 22 Foundation 0x1a99268e4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88 23 AppKit 0x1abc1b1bc -[NSApplication finishLaunching] + 248 24 DVTKit 0x1030dfe48 -[DVTApplication finishLaunching] + 196 25 AppKit 0x1abc1aea8 -[NSApplication run] + 252 26 DVTKit 0x1030dfcbc -[DVTApplication run] + 60 27 AppKit 0x1abbf23cc NSApplicationMain + 880 28 dyld 0x1a85cbf28 start + 2236 Thread 1: 0 libsystem_pthread.dylib 0x1a891ed8c start_wqthread + 0 Thread 2: 0 libsystem_pthread.dylib 0x1a891ed8c start_wqthread + 0 Thread 0 crashed with ARM Thread State (64-bit): x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000000 x4: 0x00000001a89bd730 x5: 0x0000000000000065 x6: 0x0000000000002800 x7: 0x000000016da54f28 x8: 0x9ade123b8a873d80 x9: 0x9ade1239891d5d00 x10: 0x00006003f937b55f x11: 0x0000000000000007 x12: 0x0000000000000007 x13: 0x0000600002fd11e0 x14: 0x0100000203ec3191 x15: 0x0000000203ec3190 x16: 0x0000000000000148 x17: 0x00000002084cb3a0 x18: 0x0000000000000000 x19: 0x0000000000000006 x20: 0x00000002039a6080 x21: 0x0000000000000103 x22: 0x00000002039a6160 x23: 0x0000000000000000 x24: 0x0000000000000000 x25: 0x0000000000000000 x26: 0x00006000016c40c0 x27: 0x00006000003c1a00 x28: 0x00000002039a79a0 fp: 0x000000016da55b30 lr: 0x00000001a8923c28 sp: 0x000000016da55b10 pc: 0x00000001a88ec764 cpsr: 0x40001000 far: 0x00000001538b4000 esr: 0x56000080 Address size fault Binary Images: 0x1023a8000 - 0x1023abfff com.apple.dt.Xcode (15.0) <6c185205-c752-3ce5-bea5-b4e74e423759> /Applications/Xcode.app/Contents/MacOS/Xcode 0x1034b4000 - 0x10394bfff com.apple.MIL (5.33) <2f2bbe88-0c7d-3006-88ac-7843837d9a63> /Applications/Xcode.app/Contents/SystemFrameworks/MIL.framework/Versions/A/MIL
Posted Last updated
.