TextLoaderSaverCatalog.CreateTextLoader Method

Definition

Overloads

CreateTextLoader(DataOperationsCatalog, TextLoader+Options, IMultiStreamSource)

Create a text loader TextLoader.

CreateTextLoader(DataOperationsCatalog, TextLoader+Column[], Char, Boolean, IMultiStreamSource, Boolean, Boolean, Boolean)

Create a text loader TextLoader.

CreateTextLoader<TInput>(DataOperationsCatalog, Char, Boolean, IMultiStreamSource, Boolean, Boolean, Boolean)

Create a text loader TextLoader by inferencing the dataset schema from a data model type.

CreateTextLoader(DataOperationsCatalog, TextLoader+Options, IMultiStreamSource)

Create a text loader TextLoader.

public static Microsoft.ML.Data.TextLoader CreateTextLoader (this Microsoft.ML.DataOperationsCatalog catalog, Microsoft.ML.Data.TextLoader.Options options, Microsoft.ML.Data.IMultiStreamSource dataSample = null);
static member CreateTextLoader : Microsoft.ML.DataOperationsCatalog * Microsoft.ML.Data.TextLoader.Options * Microsoft.ML.Data.IMultiStreamSource -> Microsoft.ML.Data.TextLoader

Parameters

options
TextLoader.Options

Defines the settings of the load operation.

dataSample
IMultiStreamSource

The optional location of a data sample. The sample can be used to infer column names and number of slots in each column.

Returns

CreateTextLoader(DataOperationsCatalog, TextLoader+Column[], Char, Boolean, IMultiStreamSource, Boolean, Boolean, Boolean)

Create a text loader TextLoader.

public static Microsoft.ML.Data.TextLoader CreateTextLoader (this Microsoft.ML.DataOperationsCatalog catalog, Microsoft.ML.Data.TextLoader.Column[] columns, char separatorChar = '\t', bool hasHeader = false, Microsoft.ML.Data.IMultiStreamSource dataSample = null, bool allowQuoting = false, bool trimWhitespace = false, bool allowSparse = false);
static member CreateTextLoader : Microsoft.ML.DataOperationsCatalog * Microsoft.ML.Data.TextLoader.Column[] * char * bool * Microsoft.ML.Data.IMultiStreamSource * bool * bool * bool -> Microsoft.ML.Data.TextLoader
<Extension()>
Public Function CreateTextLoader (catalog As DataOperationsCatalog, columns As TextLoader.Column(), Optional separatorChar As Char = '\t', Optional hasHeader As Boolean = false, Optional dataSample As IMultiStreamSource = null, Optional allowQuoting As Boolean = false, Optional trimWhitespace As Boolean = false, Optional allowSparse As Boolean = false) As TextLoader

Parameters

columns
TextLoader.Column[]

Array of columns TextLoader.Column defining the schema.

separatorChar
Char

The character used as separator between data points in a row. By default the tab character is used as separator.

hasHeader
Boolean

Whether the file has a header.

dataSample
IMultiStreamSource

The optional location of a data sample. The sample can be used to infer column names and number of slots in each column.

allowQuoting
Boolean

Whether the file can contain columns defined by a quoted string.

trimWhitespace
Boolean

Remove trailing whitespace from lines

allowSparse
Boolean

Whether the file can contain numerical vectors in sparse format.

Returns

CreateTextLoader<TInput>(DataOperationsCatalog, Char, Boolean, IMultiStreamSource, Boolean, Boolean, Boolean)

Create a text loader TextLoader by inferencing the dataset schema from a data model type.

public static Microsoft.ML.Data.TextLoader CreateTextLoader<TInput> (this Microsoft.ML.DataOperationsCatalog catalog, char separatorChar = '\t', bool hasHeader = false, Microsoft.ML.Data.IMultiStreamSource dataSample = null, bool allowQuoting = false, bool trimWhitespace = false, bool allowSparse = false);
static member CreateTextLoader : Microsoft.ML.DataOperationsCatalog * char * bool * Microsoft.ML.Data.IMultiStreamSource * bool * bool * bool -> Microsoft.ML.Data.TextLoader
<Extension()>
Public Function CreateTextLoader(Of TInput) (catalog As DataOperationsCatalog, Optional separatorChar As Char = '\t', Optional hasHeader As Boolean = false, Optional dataSample As IMultiStreamSource = null, Optional allowQuoting As Boolean = false, Optional trimWhitespace As Boolean = false, Optional allowSparse As Boolean = false) As TextLoader

Type Parameters

TInput

Defines the schema of the data to be loaded. Use public fields or properties decorated with LoadColumnAttribute (and possibly other attributes) to specify the column names and their data types in the schema of the loaded data.

Parameters

separatorChar
Char

Column separator character. Default is '\t'

hasHeader
Boolean

Does the file contains header?

dataSample
IMultiStreamSource

The optional location of a data sample. The sample can be used to infer information about the columns, such as slot names.

allowQuoting
Boolean

Whether the input may include quoted values, which can contain separator characters, colons, and distinguish empty values from missing values. When true, consecutive separators denote a missing value and an empty value is denoted by "". When false, consecutive separators denote an empty value.

trimWhitespace
Boolean

Remove trailing whitespace from lines

allowSparse
Boolean

Whether the input may include sparse representations for example, if one of the row contains "5 2:6 4:3" that's mean there are 5 columns all zero except for 3rd and 5th columns which have values 6 and 3

Returns

Applies to