init(labeledBySubdirectoryNamesAt:type:continueOnFailure:)
Reads training examples from a directory containing files in labeled sub-directories.
Declaration
init(labeledBySubdirectoryNamesAt url: URL, type: UTType, continueOnFailure: Bool = false) throwsParameters
- url:
URL of directory containing the files.
- type:
Type of files.
- continueOnFailure:
A Boolean value indicating whether to continue reading files after encountering a file that is not readable. The default value is
false.
Discussion
Take for example this directory structure:
/
foo/
file1.png
file2.png
bar/
file3.png
file4.pngIt would produce two labels (foo and bar) with two URLs each.