10 instantiations of TextLoader
Microsoft.ML.Data (10)
DataLoadSave\Text\TextLoader.cs (4)
1485return h.Apply("Loading Model", ch => new TextLoader(h, ctx)); 1492=> (ILegacyDataLoader)new TextLoader(env, options, files).Load(files); 1498=> new TextLoader(env, options, fileSource).Load(fileSource); 1634return new TextLoader(host, options, dataSample: dataSample);
DataLoadSave\Text\TextLoaderSaverCatalog.cs (4)
71return new TextLoader(CatalogUtils.GetEnvironment(catalog), options: options, dataSample: dataSample); 87=> new TextLoader(CatalogUtils.GetEnvironment(catalog), options, dataSample); 181var loader = new TextLoader(CatalogUtils.GetEnvironment(catalog), options: options); 207return new TextLoader(env, options, dataSample: source).Load(source);
Transforms\ValueToKeyMappingTransformer.cs (1)
445var loader = new TextLoader(env, options: options, dataSample: fileSource);
Utilities\ModelFileUtils.cs (1)
299var loader = new TextLoader(env, dataSample: repoStreamWrapper).Load(repoStreamWrapper);
1339 references to TextLoader
Microsoft.ML.AutoML (38)
API\AutoCatalog.cs (9)
214/// <param name="groupColumns">Whether to group together (when possible) original columns in the dataset file into vector columns in the resulting data structures. See <see cref="TextLoader.Range"/> for more information.</param> 219/// instantiate a <see cref="TextLoader" />. The <see cref="TextLoader" /> can be used to 242/// <param name="groupColumns">Whether to group together (when possible) original columns in the dataset file into vector columns in the resulting data structures. See <see cref="TextLoader.Range"/> for more information.</param> 247/// instantiate a <see cref="TextLoader" />. The <see cref="TextLoader" /> can be used to 272/// <param name="groupColumns">Whether to group together (when possible) original columns in the dataset file into vector columns in the resulting data structures. See <see cref="TextLoader.Range"/> for more information.</param> 277/// instantiate a <see cref="TextLoader" />. The <see cref="TextLoader" /> can be used to
API\ColumnInference.cs (3)
18/// Gets the inferred <see cref="TextLoader.Options" /> for the dataset. 21/// Can be used to instantiate a new <see cref="TextLoader" /> to load 25public TextLoader.Options TextLoaderOptions { get; internal set; }
AutoMLExperiment\ITrialResultManager.cs (7)
138var textLoaderColumns = new TextLoader.Column[] 140new TextLoader.Column("id", DataKind.Int32, 0), 141new TextLoader.Column("loss", DataKind.Single, 1), 142new TextLoader.Column("durationInMilliseconds", DataKind.Single, 2), 143new TextLoader.Column("peakCpu", DataKind.Single, 3), 144new TextLoader.Column("peakMemoryInMegaByte", DataKind.Single, 4), 145new TextLoader.Column("parameter", DataKind.Double, 5, 5 + _searchSpace.FeatureSpaceDim - 1),
ColumnInference\ColumnGroupingInference.cs (4)
9using static Microsoft.ML.Data.TextLoader; 11using Range = Microsoft.ML.Data.TextLoader.Range; 40public TextLoader.Column GenerateTextLoaderColumn() 42return new TextLoader.Column(SuggestedName, ItemKind, Ranges);
ColumnInference\ColumnInferenceApi.cs (4)
52var typedLoaderOptions = new TextLoader.Options 62var textLoader = context.Data.CreateTextLoader(typedLoaderOptions); 71IEnumerable<TextLoader.Column> columnResults = null; 89var textLoaderOptions = new TextLoader.Options()
ColumnInference\ColumnTypeInference.cs (6)
260var textLoaderOptions = new TextLoader.Options 262Columns = new[] { new TextLoader.Column("C", DataKind.String, 0, args.ColumnCount - 1) }, 268var textLoader = context.Data.CreateTextLoader(textLoaderOptions); 404public static TextLoader.Column[] GenerateLoaderColumns(Column[] columns) 406var loaderColumns = new List<TextLoader.Column>(); 409var loaderColumn = new TextLoader.Column(col.SuggestedName, col.ItemType.GetRawKind().ToDataKind(), col.ColumnIndex);
ColumnInference\TextFileContents.cs (5)
64var options = new TextLoader.Options 66Columns = new[] { new TextLoader.Column() { 69Source = new[] { new TextLoader.Range(0, null) } 86private static bool TryParseFile(MLContext context, TextLoader.Options options, IMultiStreamSource source, 93var textLoader = context.Data.CreateTextLoader(options, source);
Microsoft.ML.AutoML.Tests (35)
AutoFeaturizerTests.cs (1)
109var textLoader = context.Data.CreateTextLoader(columnInference.TextLoaderOptions);
AutoFitTests.cs (27)
47var textLoader = context.Data.CreateTextLoader(columnInference.TextLoaderOptions); 73var textLoader = context.Data.CreateTextLoader(columnInference.TextLoaderOptions); 100var textLoader = context.Data.CreateTextLoader(columnInference.TextLoaderOptions); 127var textLoader = context.Data.CreateTextLoader(columnInference.TextLoaderOptions); 261var textLoader = context.Data.CreateTextLoader(columnInference.TextLoaderOptions); 335var textLoader = context.Data.CreateTextLoader(columnInference.TextLoaderOptions); 362var textLoader = context.Data.CreateTextLoader(columnInference.TextLoaderOptions); 392var textLoader = context.Data.CreateTextLoader(columnInference.TextLoaderOptions); 418var reader = new TextLoader(mlContext, GetLoaderArgsRank(labelColumnName, groupIdColumnName, featuresColumnVectorNameA, featuresColumnVectorNameB)); 479var reader = new TextLoader(mlContext, GetLoaderArgsRank(labelColumnName, groupIdColumnName, 523var reader = new TextLoader(mlContext, GetLoaderArgs(labelColumnName, userColumnName, itemColumnName)); 587var textLoader = context.Data.CreateTextLoader(columnInference.TextLoaderOptions); 651var textLoader = context.Data.CreateTextLoader(columnInference.TextLoaderOptions); 691private TextLoader.Options GetLoaderArgs(string labelColumnName, string userIdColumnName, string itemIdColumnName) 693return new TextLoader.Options() 699new TextLoader.Column(labelColumnName, DataKind.Single, new [] { new TextLoader.Range(0) }), 700new TextLoader.Column(userIdColumnName, DataKind.UInt32, new [] { new TextLoader.Range(1) }, new KeyCount(20)), 701new TextLoader.Column(itemIdColumnName, DataKind.UInt32, new [] { new TextLoader.Range(2) }, new KeyCount(40)), 706private TextLoader.Options GetLoaderArgsRank(string labelColumnName, string groupIdColumnName, string featureColumnVectorNameA, string featureColumnVectorNameB) 708return new TextLoader.Options() 714new TextLoader.Column(labelColumnName, DataKind.Single, 0), 715new TextLoader.Column(groupIdColumnName, DataKind.Int32, 1), 716new TextLoader.Column(featureColumnVectorNameA, DataKind.Single, 2, 9), 717new TextLoader.Column(featureColumnVectorNameB, DataKind.Single, 10, 137)
DatasetUtil.cs (6)
59var textLoader = context.Data.CreateTextLoader(columnInferenceResult.TextLoaderOptions); 72var textLoader = context.Data.CreateTextLoader(columnInferenceResult.TextLoaderOptions); 85var textLoader = context.Data.CreateTextLoader(columnInferenceResult.TextLoaderOptions); 98var textLoader = context.Data.CreateTextLoader(columnInferenceResult.TextLoaderOptions); 110var textLoader = context.Data.CreateTextLoader(columnInferenceResult.TextLoaderOptions); 121var textLoader = context.Data.CreateTextLoader(columnInferenceResult.TextLoaderOptions);
TrainValidaionDatasetManagerTest.cs (1)
31var textLoader = context.Data.CreateTextLoader(columnInference.TextLoaderOptions);
Microsoft.ML.CodeGenerator (1)
Utils.cs (1)
42var textLoader = mlContext.Data.CreateTextLoader(columnInference.TextLoaderOptions);
Microsoft.ML.CodeGenerator.Tests (146)
ApprovalTests\ConsoleCodeGeneratorTests.cs (63)
569var textLoaderArgs = new TextLoader.Options() 572new TextLoader.Column("Label", DataKind.String, 0), 573new TextLoader.Column("userId", DataKind.String, 1), 574new TextLoader.Column("movieId", DataKind.String, 2), 608var textLoaderArgs = new TextLoader.Options() 611new TextLoader.Column("Label", DataKind.Boolean, 0), 612new TextLoader.Column("col1", DataKind.Single, 1), 613new TextLoader.Column("col2", DataKind.Single, 0), 614new TextLoader.Column("col3", DataKind.String, 0), 615new TextLoader.Column("col4", DataKind.Int32, 0), 616new TextLoader.Column("col5", DataKind.UInt32, 0), 645var textLoaderArgs = new TextLoader.Options() 648new TextLoader.Column("Label", DataKind.Boolean, 0), 649new TextLoader.Column("col1", DataKind.Single, 1), 650new TextLoader.Column("col2", DataKind.Single, 0), 651new TextLoader.Column("col3", DataKind.String, 0), 652new TextLoader.Column("col4", DataKind.Int32, 0), 653new TextLoader.Column("col5", DataKind.UInt32, 0), 698var textLoaderArgs = new TextLoader.Options() 701new TextLoader.Column("Label", DataKind.String, 0), 702new TextLoader.Column("ImagePath", DataKind.String, 1), // 0? 736var textLoaderArgs = new TextLoader.Options() 739new TextLoader.Column("Label", DataKind.Boolean, 0), 740new TextLoader.Column("GroupId", DataKind.Single, 1), 741new TextLoader.Column("col1", DataKind.Single, 0), 742new TextLoader.Column("col2", DataKind.String, 0), 743new TextLoader.Column("col3", DataKind.Int32, 0), 744new TextLoader.Column("col4", DataKind.UInt32, 0), 787var textLoaderArgs = new TextLoader.Options() 790new TextLoader.Column("Label", DataKind.String, 0), 791new TextLoader.Column("ImageSource", DataKind.String, 1), // 0? 818var textLoaderArgs = new TextLoader.Options() 821new TextLoader.Column("Age", DataKind.Double, 0), 822new TextLoader.Column("Workclass", DataKind.String, 1), // 0? 823new TextLoader.Column("Fnlwgt", DataKind.Double, 2), 824new TextLoader.Column("Education", DataKind.String, 3), 825new TextLoader.Column("Education_num", DataKind.Double, 4), 826new TextLoader.Column("Marital_status", DataKind.String, 5), 827new TextLoader.Column("Occupation", DataKind.String, 6), 828new TextLoader.Column("Relationship", DataKind.String, 7), 829new TextLoader.Column("Race", DataKind.String, 8), 830new TextLoader.Column("Sex", DataKind.String, 9), 831new TextLoader.Column("Capital_gain", DataKind.Double, 10), 832new TextLoader.Column("Capital_loss", DataKind.Double, 11), 833new TextLoader.Column("Hours_per_week", DataKind.Double, 12), 834new TextLoader.Column("Native_country", DataKind.String, 13), 835new TextLoader.Column("label", DataKind.Boolean, 14), 993var textLoaderArgs = new TextLoader.Options() 996new TextLoader.Column("id", DataKind.Int32, 0), 997new TextLoader.Column("MsAssetNum", DataKind.Int32, 1), 998new TextLoader.Column("Make", DataKind.String, 2), 999new TextLoader.Column("Model", DataKind.String, 3), 1000new TextLoader.Column("model", DataKind.Double, 4), 1001new TextLoader.Column("work category", DataKind.String, 5), 1002new TextLoader.Column("Work category", DataKind.Int32, 6), 1003new TextLoader.Column("IsDetachable", DataKind.Boolean, 7), 1103var textLoaderArgs = new TextLoader.Options() 1106new TextLoader.Column("Label", DataKind.Boolean, 0), 1107new TextLoader.Column("col1", DataKind.Single, 1), 1108new TextLoader.Column("col2", DataKind.Single, 0), 1109new TextLoader.Column("col3", DataKind.String, 0), 1110new TextLoader.Column("col4", DataKind.Int32, 0), 1111new TextLoader.Column("col5", DataKind.UInt32, 0),
CodeGenTests.cs (83)
100TextLoaderOptions = new TextLoader.Options() 141public static List<TextLoader.Column[]> inputColumns = new List<TextLoader.Column[]> 143new TextLoader.Column[] 145new TextLoader.Column(){ Name = "Label", Source = new TextLoader.Range[]{new TextLoader.Range(0) }, DataKind = DataKind.Boolean }, 147new TextLoader.Column[] 149new TextLoader.Column(){ Name = "id", Source = new TextLoader.Range[]{new TextLoader.Range(0) }, DataKind = DataKind.Single }, 150new TextLoader.Column(){ Name = "country", Source = new TextLoader.Range[]{new TextLoader.Range(1) }, DataKind = DataKind.Single }, 151new TextLoader.Column(){ Name = "Country", Source = new TextLoader.Range[]{new TextLoader.Range(2) }, DataKind = DataKind.String } 153new TextLoader.Column[] 155new TextLoader.Column(){ Name = "id", Source = new TextLoader.Range[]{new TextLoader.Range(0) }, DataKind = DataKind.Int32 }, 156new TextLoader.Column(){ Name = "shape", Source = new TextLoader.Range[]{new TextLoader.Range(1) }, DataKind = DataKind.Int32 }, 157new TextLoader.Column(){ Name = "Shape", Source = new TextLoader.Range[]{new TextLoader.Range(2) }, DataKind = DataKind.String }, 158new TextLoader.Column(){ Name = "color", Source = new TextLoader.Range[]{new TextLoader.Range(3) }, DataKind = DataKind.String }, 159new TextLoader.Column(){ Name = "price", Source = new TextLoader.Range[]{new TextLoader.Range(4) }, DataKind = DataKind.Double }, 161new TextLoader.Column[] 163new TextLoader.Column(){ Name = "vin", Source = new TextLoader.Range[]{new TextLoader.Range(0) }, DataKind = DataKind.String }, 164new TextLoader.Column(){ Name = "make", Source = new TextLoader.Range[]{new TextLoader.Range(1) }, DataKind = DataKind.String }, 165new TextLoader.Column(){ Name = "model", Source = new TextLoader.Range[]{new TextLoader.Range(2) }, DataKind = DataKind.String }, 166new TextLoader.Column(){ Name = "color", Source = new TextLoader.Range[]{new TextLoader.Range(3) }, DataKind = DataKind.String }, 167new TextLoader.Column(){ Name = "MSRP", Source = new TextLoader.Range[]{new TextLoader.Range(4) }, DataKind = DataKind.Single }, 168new TextLoader.Column(){ Name = "engine size", Source = new TextLoader.Range[]{new TextLoader.Range(5) }, DataKind = DataKind.Double }, 169new TextLoader.Column(){ Name = "isElectric", Source = new TextLoader.Range[]{new TextLoader.Range(6) }, DataKind = DataKind.Boolean }, 171new TextLoader.Column[] 173new TextLoader.Column(){ Name = "var_text", Source = new TextLoader.Range[]{new TextLoader.Range(0) }, DataKind = DataKind.String }, 174new TextLoader.Column(){ Name = "var_text", Source = new TextLoader.Range[]{new TextLoader.Range(1) }, DataKind = DataKind.String }, 175new TextLoader.Column(){ Name = "var_num", Source = new TextLoader.Range[]{new TextLoader.Range(2) }, DataKind = DataKind.Int32 }, 176new TextLoader.Column(){ Name = "var_num", Source = new TextLoader.Range[]{new TextLoader.Range(3) }, DataKind = DataKind.Int32 }, 177new TextLoader.Column(){ Name = "var_num", Source = new TextLoader.Range[]{new TextLoader.Range(4) }, DataKind = DataKind.Int32 }, 178new TextLoader.Column(){ Name = "var_text", Source = new TextLoader.Range[]{new TextLoader.Range(5) }, DataKind = DataKind.String }, 179new TextLoader.Column(){ Name = "var_num", Source = new TextLoader.Range[]{new TextLoader.Range(6) }, DataKind = DataKind.Int32 }, 180new TextLoader.Column(){ Name = "var_text", Source = new TextLoader.Range[]{new TextLoader.Range(7) }, DataKind = DataKind.String }, 181new TextLoader.Column(){ Name = "var_num", Source = new TextLoader.Range[]{new TextLoader.Range(8) }, DataKind = DataKind.Double },
Microsoft.ML.Core.Tests (33)
UnitTests\TestEntryPoints.cs (31)
53new TextLoader.Column("Label", DataKind.Single, 0), 54new TextLoader.Column("Features", DataKind.Single, 55new [] { new TextLoader.Range(1, 9) }) 74new TextLoader.Column("Label", DataKind.Single, 0), 75new TextLoader.Column("F1", DataKind.String, 1), 76new TextLoader.Column("F2", DataKind.Int32, 2), 77new TextLoader.Column("Rest", DataKind.Single, new [] { new TextLoader.Range(3, 9) }) 1362new TextLoader.Options() 1369new TextLoader.Column("Label", DataKind.Boolean, 0), 1370new TextLoader.Column("SentimentText", DataKind.String, 1) 1777new TextLoader.Column("Label", DataKind.String, 0), 1778new TextLoader.Column("Text", DataKind.String, 3) 1993new TextLoader.Column("Label", DataKind.Single, 0), 1994new TextLoader.Column("Features", DataKind.Single, new [] { new TextLoader.Range(1, 4) }) 2139new TextLoader.Column("Label", DataKind.Single, 0), 2140new TextLoader.Column("Features", DataKind.Single, new[] { new TextLoader.Range(1, 8) }), 2141new TextLoader.Column("Cat", DataKind.String, 9) 4241new TextLoader.Column("Label", DataKind.Single, 0), 4242new TextLoader.Column("Features", DataKind.Single, new [] { new TextLoader.Range(1, 9) }) 4316new TextLoader.Column("Features", DataKind.Single, new [] { new TextLoader.Range(1, 784) }) 4529new TextLoader.Column("Text", DataKind.String, 4530new [] { new TextLoader.Range() { Min = 0, VariableEnd=true, ForceVector=true} }) 4721new TextLoader.Column("Text", DataKind.String, 1, 2), 4722new TextLoader.Column("Label", DataKind.Single, 0) 4763new TextLoader.Column("Text", DataKind.String, 1, 2), 4764new TextLoader.Column("Label", DataKind.Single, 0)
UnitTests\TestHosts.cs (2)
131env.Data.CreateTextLoader(new TextLoader.Options { Columns = new[] { new TextLoader.Column("TestColumn", DataKind.Single, 0) } });
Microsoft.ML.Data (131)
Commands\DataCommand.cs (4)
361return isText ? TextLoader.Create(Host, new TextLoader.Options(), fileSource) : 365TextLoader.Create(Host, new TextLoader.Options(), fileSource);
DataLoadSave\Database\DatabaseLoader.cs (1)
333internal static Range FromTextLoaderRange(TextLoader.Range range)
DataLoadSave\Text\LoadColumnAttribute.cs (7)
23Sources = new List<TextLoader.Range>(); 24Sources.Add(new TextLoader.Range(fieldIndex)); 34Sources = new List<TextLoader.Range>(); 35Sources.Add(new TextLoader.Range(start, end)); 44Sources = new List<TextLoader.Range>(); 46Sources.Add(new TextLoader.Range(col)); 49internal List<TextLoader.Range> Sources;
DataLoadSave\Text\TextLoader.cs (23)
16[assembly: LoadableClass(TextLoader.Summary, typeof(ILegacyDataLoader), typeof(TextLoader), typeof(TextLoader.Options), typeof(SignatureDataLoader), 19[assembly: LoadableClass(TextLoader.Summary, typeof(ILegacyDataLoader), typeof(TextLoader), null, typeof(SignatureLoadDataLoader), 20"Text Loader", TextLoader.LoaderSignature)] 22[assembly: LoadableClass(TextLoader.Summary, typeof(TextLoader), null, typeof(SignatureLoadModel), 23"Text Loader", TextLoader.LoaderSignature)] 287/// indicates that the <see cref="TextLoader"/> should auto-detect the legnth 310/// indicates that the <see cref="TextLoader"/> should auto-detect the legnth 425/// The settings for <see cref="TextLoader"/> 497/// <see cref="TextLoader.Load(IMultiStreamSource)"/> is called. The sample can be used to infer slot name annotations if present. 511/// If <see cref="TextLoader.Options.AllowQuoting"/> is false, this option is ignored. 704public Bindings(TextLoader parent, Column[] cols, IMultiStreamSource headerFile, IMultiStreamSource dataSample) 905public Bindings(ModelLoadContext ctx, TextLoader parent) 1095loaderAssemblyName: typeof(TextLoader).Assembly.FullName); 1477internal static TextLoader Create(IHostEnvironment env, ModelLoadContext ctx) 1495/// Convenience method to create a <see cref="TextLoader"/> and use it to load a specified file. 1547internal static TextLoader CreateTextLoader<TInput>(IHostEnvironment host, 1567internal static TextLoader CreateTextLoader<TInput>(IHostEnvironment host, 1639private readonly TextLoader _loader; 1643public BoundLoader(TextLoader loader, IMultiStreamSource files)
DataLoadSave\Text\TextLoaderCursor.cs (4)
46private static void SetupCursor(TextLoader parent, bool[] active, int n, 86private Cursor(TextLoader parent, ParseStats stats, bool[] active, LineReader reader, int srcNeeded, int cthd) 138public static DataViewRowCursor Create(TextLoader parent, IMultiStreamSource files, bool[] active) 155public static DataViewRowCursor[] CreateSet(TextLoader parent, IMultiStreamSource files, bool[] active, int n)
DataLoadSave\Text\TextLoaderParser.cs (3)
673public Parser(TextLoader parent) 734public static void GetInputSize(TextLoader parent, List<ReadOnlyMemory<char>> lines, out int minSize, out int maxSize) 771public static void ParseSlotNames(TextLoader parent, ReadOnlyMemory<char> textHeader, ColInfo[] infos, VBuffer<ReadOnlyMemory<char>>[] slotNames)
DataLoadSave\Text\TextLoaderSaverCatalog.cs (59)
20/// Create a text loader <see cref="TextLoader"/>. 23/// <param name="columns">Array of columns <see cref="TextLoader.Column"/> defining the schema.</param> 26/// indicates that the first line in the <see paramref="dataSample"/> will be used for feature names, and that when <see cref="TextLoader.Load(IMultiStreamSource)"/> 28/// skip the first line when <see cref="TextLoader.Load(IMultiStreamSource)"/> is called, but columns will not have slot names annotations. This is 29/// because the output schema is made when the loader is created, and not when <see cref="TextLoader.Load(IMultiStreamSource)"/> is called.</param> 31/// of slots in a column defined with <see cref="TextLoader.Range"/> with <see langword="null"/> maximum index. 52public static TextLoader CreateTextLoader(this DataOperationsCatalog catalog, 53TextLoader.Column[] columns, 54char separatorChar = TextLoader.Defaults.Separator, 55bool hasHeader = TextLoader.Defaults.HasHeader, 57bool allowQuoting = TextLoader.Defaults.AllowQuoting, 58bool trimWhitespace = TextLoader.Defaults.TrimWhitespace, 59bool allowSparse = TextLoader.Defaults.AllowSparse) 61var options = new TextLoader.Options 75/// Create a text loader <see cref="TextLoader"/>. 80/// of slots in <see cref="TextLoader.Options.Columns"/> defined with <see cref="TextLoader.Range"/> with <see langword="null"/> maximum index. 82/// it will also contain the schema information in the header that the loader can read even if <see cref="TextLoader.Options.Columns"/> are not specified. 83/// In order to use the schema defined in the file, all other <see cref="TextLoader.Options"/> sould be left with their default values.</param> 84public static TextLoader CreateTextLoader(this DataOperationsCatalog catalog, 85TextLoader.Options options, 90/// Create a text loader <see cref="TextLoader"/> by inferencing the dataset schema from a data model type. 98/// indicates that the first line in the <see paramref="dataSample"/> will be used for feature names, and that when <see cref="TextLoader.Load(IMultiStreamSource)"/> 100/// skip the first line when <see cref="TextLoader.Load(IMultiStreamSource)"/> is called, but columns will not have slot names annotations. This is 101/// because the output schema is made when the loader is created, and not when <see cref="TextLoader.Load(IMultiStreamSource)"/> is called.</param> 113public static TextLoader CreateTextLoader<TInput>(this DataOperationsCatalog catalog, 114char separatorChar = TextLoader.Defaults.Separator, 115bool hasHeader = TextLoader.Defaults.HasHeader, 117bool allowQuoting = TextLoader.Defaults.AllowQuoting, 118bool trimWhitespace = TextLoader.Defaults.TrimWhitespace, 119bool allowSparse = TextLoader.Defaults.AllowSparse) 120=> TextLoader.CreateTextLoader<TInput>(CatalogUtils.GetEnvironment(catalog), hasHeader, separatorChar, allowQuoting, 124/// Create a text loader <see cref="TextLoader"/> by inferencing the dataset schema from a data model type. 131public static TextLoader CreateTextLoader<TInput>(this DataOperationsCatalog catalog, 132TextLoader.Options options, 134=> TextLoader.CreateTextLoader<TInput>(CatalogUtils.GetEnvironment(catalog), options, dataSample); 137/// Load a <see cref="IDataView"/> from a text file using <see cref="TextLoader"/>. 145/// <see cref="TextLoader.Load(IMultiStreamSource)"/> is called.</param> 162TextLoader.Column[] columns, 163char separatorChar = TextLoader.Defaults.Separator, 164bool hasHeader = TextLoader.Defaults.HasHeader, 165bool allowQuoting = TextLoader.Defaults.AllowQuoting, 166bool trimWhitespace = TextLoader.Defaults.TrimWhitespace, 167bool allowSparse = TextLoader.Defaults.AllowSparse) 171var options = new TextLoader.Options 181var loader = new TextLoader(CatalogUtils.GetEnvironment(catalog), options: options); 186/// Load a <see cref="IDataView"/> from a text file using <see cref="TextLoader"/>. 200TextLoader.Options options = null) 211/// Load a <see cref="IDataView"/> from a text file using <see cref="TextLoader"/>. 218/// <see cref="TextLoader.Load(IMultiStreamSource)"/> is called.</param> 235char separatorChar = TextLoader.Defaults.Separator, 236bool hasHeader = TextLoader.Defaults.HasHeader, 237bool allowQuoting = TextLoader.Defaults.AllowQuoting, 238bool trimWhitespace = TextLoader.Defaults.TrimWhitespace, 239bool allowSparse = TextLoader.Defaults.AllowSparse) 245return TextLoader.CreateTextLoader<TInput>(CatalogUtils.GetEnvironment(catalog), hasHeader, separatorChar, 250/// Load a <see cref="IDataView"/> from a text file using <see cref="TextLoader"/>. 259TextLoader.Options options) 263return TextLoader.CreateTextLoader<TInput>(CatalogUtils.GetEnvironment(catalog), options)
DataLoadSave\Text\TextSaver.cs (9)
484var settings = CmdParser.GetSettings(_host, column, new TextLoader.Column()); 499private TextLoader.Column GetColumn(string name, DataViewType type, int? start) 509TextLoader.Range[] source = null; 510TextLoader.Range range = null; 513range = new TextLoader.Range { Min = minValue, Max = minValue + vectorType.Size - 1, ForceVector = true }; 515range = new TextLoader.Range { Min = minValue, VariableEnd = true }; 517range = new TextLoader.Range { Min = minValue }; 518source = new TextLoader.Range[1] { range }; 519return new TextLoader.Column() { Name = name, KeyCount = keyCount, Source = source, Type = kind };
Transforms\ValueMapping.cs (15)
468private static TextLoader.Column GenerateValueColumn(IHostEnvironment env, 534TextLoader.Column valueColumn = new TextLoader.Column(valueColumnName, DataKind.UInt32, 1); 635TextLoader.Column keyColumn = default; 636TextLoader.Column valueColumn = default; 642keyColumn = new TextLoader.Column(keyColumnName, DataKind.String, 0); 643valueColumn = new TextLoader.Column(valueColumnName, DataKind.String, 1); 644var txtArgs = new TextLoader.Options() 646Columns = new TextLoader.Column[] 655var textLoader = TextLoader.LoadFile(env, txtArgs, fileSource); 665keyColumn = new TextLoader.Column(keyColumnName, DataKind.String, 0); 666valueColumn = new TextLoader.Column(valueColumnName, DataKind.Single, 1); 669loader = TextLoader.Create( 671new TextLoader.Options() 673Columns = new TextLoader.Column[]
Transforms\ValueToKeyMappingTransformer.cs (4)
433"{0} should not be specified when default loader is " + nameof(TextLoader) + ". Ignoring {0}={1}", 438var options = new TextLoader.Options() 442new TextLoader.Column("Term", DataKind.String, 0) 445var loader = new TextLoader(env, options: options, dataSample: fileSource);
Utilities\TypeParsingUtils.cs (2)
61Contracts.CheckUserArg(KeyDataViewType.IsValidDataType(rawType), nameof(TextLoader.Column.Type), "Bad item type for Key"); 74/// It is used by <see cref="TextLoader"/> and <see cref="TypeConvertingEstimator"/>.
Microsoft.ML.EntryPoints (2)
ImportTextData.cs (2)
52public TextLoader.Options Arguments = new TextLoader.Options();
Microsoft.ML.IntegrationTests (40)
Datasets\MnistOneClass.cs (3)
17public static TextLoader GetTextLoader(MLContext mlContext, bool hasHeader, char separatorChar) 21new TextLoader.Column("Label", DataKind.Single, 0), 22new TextLoader.Column("Features", DataKind.Single, 1, 1 + _featureLength)
Datasets\TypeTestData.cs (17)
77public static TextLoader GetTextLoader(MLContext mlContext, char separator) 81new TextLoader.Column("Label", DataKind.Boolean, 0), 82new TextLoader.Column("I1", DataKind.SByte, 1), 83new TextLoader.Column("U1", DataKind.Byte, 2), 84new TextLoader.Column("I2", DataKind.Int16, 3), 85new TextLoader.Column("U2", DataKind.UInt16, 4), 86new TextLoader.Column("I4", DataKind.Int32, 5), 87new TextLoader.Column("U4", DataKind.UInt32, 6), 88new TextLoader.Column("I8", DataKind.Int64, 7), 89new TextLoader.Column("U8", DataKind.UInt64, 8), 90new TextLoader.Column("R4", DataKind.Single, 9), 91new TextLoader.Column("R8", DataKind.Double, 10), 92new TextLoader.Column("Tx", DataKind.String, 11), 93new TextLoader.Column("Ts", DataKind.TimeSpan, 12), 94new TextLoader.Column("Dt", DataKind.DateTime, 13), 95new TextLoader.Column("Dz", DataKind.DateTimeOffset, 14), 96new TextLoader.Column("Features", DataKind.Single, 15, 15 + _numFeatures - 1),
ModelFiles.cs (9)
135var loader = mlContext.Data.CreateTextLoader<InputData>(hasHeader: true, dataSample: file); 268var loader = mlContext.Data.CreateTextLoader<InputData>(hasHeader: true, dataSample: file); 325var loader = mlContext.Data.CreateTextLoader<InputData>(hasHeader: true, dataSample: file); 358var loader = mlContext.Data.CreateTextLoader<InputData>(hasHeader: true, dataSample: file); 373Assert.True(loadedLoaderWithTransformer is TextLoader); 387var loader = mlContext.Data.CreateTextLoader<InputData>(hasHeader: true, dataSample: file); 425var loader = mlContext.Data.CreateTextLoader<InputData>(hasHeader: true, dataSample: file); 445Assert.IsType<TextLoader>(loadedLoaderWithTransformer); 458var loader = mlContext.Data.CreateTextLoader<InputData>(hasHeader: true, dataSample: file);
Prediction.cs (1)
40var options = new TextLoader.Options
SchemaDefinitionTests.cs (4)
34var loader = _ml.Data.CreateTextLoader(new TextLoader.Options(), new MultiFileSource(fileName)); 65var loader = _ml.Data.CreateTextLoader(new TextLoader.Options(), new MultiFileSource(fileName));
Validation.cs (6)
73var reader = mlContext.Data.CreateTextLoader(new TextLoader.Options() 79new TextLoader.Column(labelColumnName, DataKind.Single, 0), 80new TextLoader.Column(groupIdColumnName, DataKind.Int32, 1), 81new TextLoader.Column(featuresColumnVectorNameA, DataKind.Single, 2, 9), 82new TextLoader.Column(featuresColumnVectorNameB, DataKind.Single, 10, 137)
Microsoft.ML.OnnxTransformerTest (8)
DnnImageFeaturizerTest.cs (2)
105new TextLoader.Column("imagePath", DataKind.String, 0), 106new TextLoader.Column("name", DataKind.String, 1)
OnnxTransformTests.cs (6)
250new TextLoader.Column("imagePath", DataKind.String, 0), 251new TextLoader.Column("name", DataKind.String, 1) 301new TextLoader.Column("imagePath", DataKind.String, 0), 302new TextLoader.Column("name", DataKind.String, 1) 1130new TextLoader.Column("imagePath", DataKind.String, 0), 1131new TextLoader.Column("name", DataKind.String, 1)
Microsoft.ML.PerformanceTests (65)
FeaturizeTextBench.cs (4)
33var columns = new List<TextLoader.Column>(); 36columns.Add(new TextLoader.Column($"Column{i}", DataKind.String, i)); 39var textLoader = _mlContext.Data.CreateTextLoader(new TextLoader.Options()
KMeansAndLogisticRegressionBench.cs (5)
25new TextLoader.Column("Label", DataKind.Boolean, 0), 26new TextLoader.Column("CatFeatures", DataKind.String, 28new TextLoader.Range() { Min = 1, Max = 8 }, 30new TextLoader.Column("NumFeatures", DataKind.Single, 32new TextLoader.Range() { Min = 9, Max = 14 },
Numeric\Ranking.cs (4)
45var environment = EnvironmentFactory.CreateRankingEnvironment<RankingEvaluator, TextLoader, HashingTransformer, FastTreeRankingTrainer, FastTreeRankingModelParameters>(); 60var environment = EnvironmentFactory.CreateRankingEnvironment<RankingEvaluator, TextLoader, HashingTransformer, LightGbmMulticlassTrainer, OneVersusAllModelParameters>(); 99var environment = EnvironmentFactory.CreateRankingEnvironment<RankingEvaluator, TextLoader, HashingTransformer, FastTreeRankingTrainer, FastTreeRankingModelParameters>(); 109var environment = EnvironmentFactory.CreateRankingEnvironment<RankingEvaluator, TextLoader, HashingTransformer, FastTreeRankingTrainer, FastTreeRankingModelParameters>();
PredictionEngineBench.cs (16)
41var options = new TextLoader.Options() 45new TextLoader.Column("Label", DataKind.Single, 0), 46new TextLoader.Column("SepalLength", DataKind.Single, 1), 47new TextLoader.Column("SepalWidth", DataKind.Single, 2), 48new TextLoader.Column("PetalLength", DataKind.Single, 3), 49new TextLoader.Column("PetalWidth", DataKind.Single, 4), 53var loader = new TextLoader(env, options: options); 80var options = new TextLoader.Options() 84new TextLoader.Column("Label", DataKind.Boolean, 0), 85new TextLoader.Column("SentimentText", DataKind.String, 1) 89var loader = new TextLoader(mlContext, options: options); 115var options = new TextLoader.Options() 119new TextLoader.Column("Label", DataKind.Boolean, 0), 120new TextLoader.Column("Features", DataKind.Single, new[] { new TextLoader.Range(1, 9) }) 124var loader = new TextLoader(env, options: options);
RffTransform.cs (5)
32var loader = mlContext.Data.CreateTextLoader(new TextLoader.Options 36new TextLoader.Column("Label", DataKind.Single, 64), 37new TextLoader.Column("Features", DataKind.Single, new[] {new TextLoader.Range() {Min = 0, Max = 63}})
StochasticDualCoordinateAscentClassifierBench.cs (20)
62var options = new TextLoader.Options() 66new TextLoader.Column("Label", DataKind.Single, 0), 67new TextLoader.Column("SepalLength", DataKind.Single, 1), 68new TextLoader.Column("SepalWidth", DataKind.Single, 2), 69new TextLoader.Column("PetalLength", DataKind.Single, 3), 70new TextLoader.Column("PetalWidth", DataKind.Single, 4), 74var loader = new TextLoader(_mlContext, options: options); 89var arguments = new TextLoader.Options() 91Columns = new TextLoader.Column[] 93new TextLoader.Column("Label", DataKind.Single, new[] { new TextLoader.Range() { Min = 0, Max = 0 } }), 94new TextLoader.Column("SentimentText", DataKind.String, new[] { new TextLoader.Range() { Min = 1, Max = 1 } }) 131var options = new TextLoader.Options() 135new TextLoader.Column("Label", DataKind.Single, 0), 136new TextLoader.Column("SepalLength", DataKind.Single, 1), 137new TextLoader.Column("SepalWidth", DataKind.Single, 2), 138new TextLoader.Column("PetalLength", DataKind.Single, 3), 139new TextLoader.Column("PetalWidth", DataKind.Single, 4), 143var loader = new TextLoader(_mlContext, options: options);
Text\MultiClassClassification.cs (6)
40var environment = EnvironmentFactory.CreateClassificationEnvironment<TextLoader, OneHotEncodingTransformer, AveragedPerceptronTrainer, LinearBinaryModelParameters>(); 55var environment = EnvironmentFactory.CreateClassificationEnvironment<TextLoader, OneHotEncodingTransformer, LightGbmMulticlassTrainer, OneVersusAllModelParameters>(); 71var environment = EnvironmentFactory.CreateClassificationEnvironment<TextLoader, OneHotEncodingTransformer, AveragedPerceptronTrainer, LinearBinaryModelParameters>(); 87var environment = EnvironmentFactory.CreateClassificationEnvironment<TextLoader, OneHotEncodingTransformer, SdcaMaximumEntropyMulticlassTrainer, MaximumEntropyModelParameters>(); 115var environment = EnvironmentFactory.CreateClassificationEnvironment<TextLoader, OneHotEncodingTransformer, AveragedPerceptronTrainer, LinearBinaryModelParameters>(); 126var environment = EnvironmentFactory.CreateClassificationEnvironment<TextLoader, OneHotEncodingTransformer, AveragedPerceptronTrainer, LinearBinaryModelParameters>();
TextLoaderBench.cs (5)
25private List<TextLoader.Column> _columns; 36_columns = new List<TextLoader.Column>(); 39_columns.Add(new TextLoader.Column($"Column{i}", DataKind.String, i)); 42var textLoader = _mlContext.Data.CreateTextLoader(new TextLoader.Options()
Microsoft.ML.Predictor.Tests (6)
TestIniModels.cs (6)
520new TextLoader.Options() 525new TextLoader.Column("Label", DataKind.Single, 0), 526new TextLoader.Column("Features", DataKind.Single, 1, 9) 559new TextLoader.Options() 564new TextLoader.Column("Label", DataKind.Boolean, 0), 565new TextLoader.Column("Features", DataKind.Single, 1, 9)
Microsoft.ML.Samples (33)
Dynamic\DataOperations\LoadingText.cs (10)
43var loader = mlContext.Data.CreateTextLoader( 46new TextLoader.Column("Features", DataKind.Single, 0, 9) 77var loaderWithCustomType = 91var loaderWithUnknownLength = mlContext.Data.CreateTextLoader( 94new TextLoader.Column("Features", 96new[] { new TextLoader.Range(0, null) }) 138var sparseLoader = mlContext.Data.CreateTextLoader( 141new TextLoader.Column("Features", DataKind.Single, 0, 9) 168var options = new TextLoader.Options() 173var sparseLoaderWithSchema =
Dynamic\TensorFlow\TextClassification.cs (2)
50new TextLoader.Column("Words", DataKind.String, 0), 51new TextLoader.Column("Ids", DataKind.Int32, 1),
Dynamic\Trainers\Regression\OrdinaryLeastSquaresAdvanced.cs (3)
32new TextLoader.Options 38new TextLoader.Column("Label", DataKind.Single, 0), 39new TextLoader.Column("Features", DataKind.Single, 1, 6)
Dynamic\Trainers\Regression\OrdinaryLeastSquaresWithOptionsAdvanced.cs (3)
32new TextLoader.Options 38new TextLoader.Column("Label", DataKind.Single, 0), 39new TextLoader.Column("Features", DataKind.Single, 1, 6)
Dynamic\Transforms\ImageAnalytics\ConvertToGrayScale.cs (3)
34var data = mlContext.Data.CreateTextLoader(new TextLoader.Options() 38new TextLoader.Column("ImagePath", DataKind.String, 0), 39new TextLoader.Column("Name", DataKind.String, 1),
Dynamic\Transforms\ImageAnalytics\DnnFeaturizeImage.cs (3)
33var data = mlContext.Data.CreateTextLoader(new TextLoader.Options() 37new TextLoader.Column("ImagePath", DataKind.String, 0), 38new TextLoader.Column("Name", DataKind.String, 1),
Dynamic\Transforms\ImageAnalytics\ExtractPixels.cs (3)
36var data = mlContext.Data.CreateTextLoader(new TextLoader.Options() 40new TextLoader.Column("ImagePath", DataKind.String, 0), 41new TextLoader.Column("Name", DataKind.String, 1),
Dynamic\Transforms\ImageAnalytics\LoadImages.cs (3)
33var data = mlContext.Data.CreateTextLoader(new TextLoader.Options() 37new TextLoader.Column("ImagePath", DataKind.String, 0), 38new TextLoader.Column("Name", DataKind.String, 1),
Dynamic\Transforms\ImageAnalytics\ResizeImages.cs (3)
33var data = mlContext.Data.CreateTextLoader(new TextLoader.Options() 37new TextLoader.Column("ImagePath", DataKind.String, 0), 38new TextLoader.Column("Name", DataKind.String, 1),
Microsoft.ML.Samples.GPU (2)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\TextClassification.cs (2)
50new TextLoader.Column("Words", DataKind.String, 0), 51new TextLoader.Column("Ids", DataKind.Int32, 1),
Microsoft.ML.Samples.OneDal (6)
Program.cs (6)
23List<TextLoader.Column> columns = new List<TextLoader.Column>(); 29columns.Add(new TextLoader.Column(column, DataKind.Boolean, Array.IndexOf(headerArray, column))); 31columns.Add(new TextLoader.Column(column, DataKind.Single, Array.IndexOf(headerArray, column))); 35columns.Add(new TextLoader.Column(column, DataKind.Single, Array.IndexOf(headerArray, column))); 39var loader = mlContext.Data.CreateTextLoader(
Microsoft.ML.SamplesUtils (29)
SamplesDatasetUtils.cs (29)
50var loader = mlContext.Data.CreateTextLoader( 53new TextLoader.Column("MedianHomeValue", DataKind.Single, 0), 54new TextLoader.Column("CrimesPerCapita", DataKind.Single, 1), 55new TextLoader.Column("PercentResidental", DataKind.Single, 2), 56new TextLoader.Column("PercentNonRetail", DataKind.Single, 3), 57new TextLoader.Column("CharlesRiver", DataKind.Single, 4), 58new TextLoader.Column("NitricOxides", DataKind.Single, 5), 59new TextLoader.Column("RoomsPerDwelling", DataKind.Single, 6), 60new TextLoader.Column("PercentPre40s", DataKind.Single, 7), 61new TextLoader.Column("EmploymentDistance", DataKind.Single, 8), 62new TextLoader.Column("HighwayDistance", DataKind.Single, 9), 63new TextLoader.Column("TaxRate", DataKind.Single, 10), 64new TextLoader.Column("TeacherRatio", DataKind.Single, 11), 126var loader = mlContext.Data.CreateTextLoader( 129new TextLoader.Column("age", DataKind.Single, 0), 130new TextLoader.Column("workclass", DataKind.String, 1), 131new TextLoader.Column("fnlwgt", DataKind.Single, 2), 132new TextLoader.Column("education", DataKind.String, 3), 133new TextLoader.Column("education-num", DataKind.Single, 4), 134new TextLoader.Column("marital-status", DataKind.String, 5), 135new TextLoader.Column("occupation", DataKind.String, 6), 136new TextLoader.Column("relationship", DataKind.String, 7), 137new TextLoader.Column("ethnicity", DataKind.String, 8), 138new TextLoader.Column("sex", DataKind.String, 9), 139new TextLoader.Column("capital-gain", DataKind.Single, 10), 140new TextLoader.Column("capital-loss", DataKind.Single, 11), 141new TextLoader.Column("hours-per-week", DataKind.Single, 12), 142new TextLoader.Column("native-country", DataKind.String, 13), 143new TextLoader.Column("IsOver50K", DataKind.Boolean, 14),
Microsoft.ML.TensorFlow.Tests (47)
TensorFlowEstimatorTests.cs (6)
157new TextLoader.Column("imagePath", DataKind.String, 0), 158new TextLoader.Column("name", DataKind.String, 1) 199new TextLoader.Column("imagePath", DataKind.String, 0), 200new TextLoader.Column("name", DataKind.String, 1) 250new TextLoader.Column("imagePath", DataKind.String, 0), 251new TextLoader.Column("name", DataKind.String, 1)
TensorflowTests.cs (41)
139var data = TextLoader.Create(_mlContext, new TextLoader.Options() 143new TextLoader.Column("ImagePath", DataKind.String, 0), 144new TextLoader.Column("Label", DataKind.String, 1), 541var reader = _mlContext.Data.CreateTextLoader( 544new TextLoader.Column("ImagePath", DataKind.String , 0), 545new TextLoader.Column("Name", DataKind.String, 1) 654var reader = _mlContext.Data.CreateTextLoader( 657new TextLoader.Column("Label", DataKind.UInt32 , new [] { new TextLoader.Range(0) }, new KeyCount(10)), 658new TextLoader.Column("Placeholder", DataKind.Single, new []{ new TextLoader.Range(1, 784) }) 698var reader = _mlContext.Data.CreateTextLoader(columns: new[] 700new TextLoader.Column("Label", DataKind.Int64, 0), 701new TextLoader.Column("Placeholder", DataKind.Single, new []{ new TextLoader.Range(1, 784) }) 787var reader = _mlContext.Data.CreateTextLoader(new[] 789new TextLoader.Column("Label", DataKind.UInt32, new []{ new TextLoader.Range(0) }, new KeyCount(10)), 790new TextLoader.Column("TfLabel", DataKind.Int64, 0), 791new TextLoader.Column("Placeholder", DataKind.Single, new []{ new TextLoader.Range(1, 784) }) 880var reader = _mlContext.Data.CreateTextLoader(columns: new[] 882new TextLoader.Column("Label", DataKind.UInt32 , new [] { new TextLoader.Range(0) }, new KeyCount(10)), 883new TextLoader.Column("Placeholder", DataKind.Single, new []{ new TextLoader.Range(1, 784) }) 1014new TextLoader.Column("ImagePath", DataKind.String, 0), 1015new TextLoader.Column("Name", DataKind.String, 1), 1072new TextLoader.Column("ImagePath", DataKind.String, 0), 1073new TextLoader.Column("Name", DataKind.String, 1), 1149var data = TextLoader.Create(_mlContext, new TextLoader.Options() 1153new TextLoader.Column("ImagePath", DataKind.String, 0), 1154new TextLoader.Column("Label", DataKind.String, 1), 1226new TextLoader.Column("ImagePath", DataKind.String, 0), 1227new TextLoader.Column("Name", DataKind.String, 1), 1269new TextLoader.Column("Words", DataKind.String, 0), 1270new TextLoader.Column("Ids", DataKind.Int32, 1), 2054new TextLoader.Column("imagePath", DataKind.String, 0), 2055new TextLoader.Column("name", DataKind.String, 1)
Microsoft.ML.TestFramework (4)
DataPipe\TestDataPipe.cs (2)
820var argsText = new TextLoader.Options(); 833IDataView view2 = TextLoader.Create(Env, argsText, new MultiFileSource(dataPath));
DataPipe\TestDataPipeBase.cs (1)
415var args = new TextLoader.Options() { AllowSparse = true, AllowQuoting = true };
EnvironmentExtensions.cs (1)
20env.ComponentCatalog.RegisterAssembly(typeof(TextLoader).Assembly); // ML.Data
Microsoft.ML.TestFrameworkCommon (20)
Datasets.cs (20)
28public Func<TextLoader.Column[]> GetLoaderColumns; 180new TextLoader.Column("MedianHomeValue", DataKind.Single, 0), 181new TextLoader.Column("CrimesPerCapita", DataKind.Single, 1), 182new TextLoader.Column("PercentResidental", DataKind.Single, 2), 183new TextLoader.Column("PercentNonRetail", DataKind.Single, 3), 184new TextLoader.Column("CharlesRiver", DataKind.Single, 4), 185new TextLoader.Column("NitricOxides", DataKind.Single, 5), 186new TextLoader.Column("RoomsPerDwelling", DataKind.Single, 6), 187new TextLoader.Column("PercentPre40s", DataKind.Single, 7), 188new TextLoader.Column("EmploymentDistance", DataKind.Single, 8), 189new TextLoader.Column("HighwayDistance", DataKind.Single, 9), 190new TextLoader.Column("TaxRate", DataKind.Single, 10), 191new TextLoader.Column("TeacherRatio", DataKind.Single, 11), 233new TextLoader.Column("Label", DataKind.Boolean, 0), 234new TextLoader.Column("SentimentText", DataKind.String, 1) 416new TextLoader.Column("SepalLength", DataKind.Single, 0), 417new TextLoader.Column("SepalWidth", DataKind.Single, 1), 418new TextLoader.Column("PetalLength", DataKind.Single, 2), 419new TextLoader.Column("PetalWidth",DataKind.Single, 3), 420new TextLoader.Column("Label", DataKind.String, 4)
Microsoft.ML.Tests (660)
AnomalyDetectionTests.cs (3)
239var loader = ML.Data.CreateTextLoader(new[] 241new TextLoader.Column(DefaultColumnNames.Label, DataKind.Single, 0), 242new TextLoader.Column(DefaultColumnNames.Features, DataKind.Single, 1, 784)
ImagesTests.cs (64)
34var data = TextLoader.Create(env, new TextLoader.Options() 38new TextLoader.Column("ImagePath", DataKind.String, 0), 39new TextLoader.Column("Name", DataKind.String, 1), 42var invalidData = TextLoader.Create(env, new TextLoader.Options() 46new TextLoader.Column("ImagePath", DataKind.Single, 0), 65var data = TextLoader.Create(env, new TextLoader.Options() 69new TextLoader.Column("ImagePath", DataKind.String, 0), 70new TextLoader.Column("Name", DataKind.String, 1), 109var data = TextLoader.Create(env, new TextLoader.Options() 113new TextLoader.Column("ImagePath", DataKind.String, 0), 114new TextLoader.Column("Name", DataKind.String, 1), 141var data = TextLoader.Create(env, new TextLoader.Options() 145new TextLoader.Column("ImagePath", DataKind.String, 0), 146new TextLoader.Column("Name", DataKind.String, 1), 178var data = TextLoader.Create(env, new TextLoader.Options() 182new TextLoader.Column("ImagePath", DataKind.String, 0), 183new TextLoader.Column("Name", DataKind.String, 1), 337var data = TextLoader.Create(env, new TextLoader.Options() 341new TextLoader.Column("ImagePath", DataKind.String, 0), 342new TextLoader.Column("Name", DataKind.String, 1), 412var data = TextLoader.Create(env, new TextLoader.Options() 416new TextLoader.Column("ImagePath", DataKind.String, 0), 417new TextLoader.Column("Name", DataKind.String, 1), 488var data = TextLoader.Create(env, new TextLoader.Options() 492new TextLoader.Column("ImagePath", DataKind.String, 0), 493new TextLoader.Column("Name", DataKind.String, 1), 563var data = TextLoader.Create(env, new TextLoader.Options() 567new TextLoader.Column("ImagePath", DataKind.String, 0), 568new TextLoader.Column("Name", DataKind.String, 1), 638var data = TextLoader.Create(env, new TextLoader.Options() 642new TextLoader.Column("ImagePath", DataKind.String, 0), 643new TextLoader.Column("Name", DataKind.String, 1), 713var data = TextLoader.Create(env, new TextLoader.Options() 717new TextLoader.Column("ImagePath", DataKind.String, 0), 718new TextLoader.Column("Name", DataKind.String, 1), 789var data = TextLoader.Create(env, new TextLoader.Options() 793new TextLoader.Column("ImagePath", DataKind.String, 0), 794new TextLoader.Column("Name", DataKind.String, 1), 864var data = TextLoader.Create(env, new TextLoader.Options() 868new TextLoader.Column("ImagePath", DataKind.String, 0), 869new TextLoader.Column("Name", DataKind.String, 1), 940var data = TextLoader.Create(env, new TextLoader.Options() 944new TextLoader.Column("ImagePath", DataKind.String, 0), 945new TextLoader.Column("Name", DataKind.String, 1), 1012var data = TextLoader.Create(env, new TextLoader.Options() 1016new TextLoader.Column("ImagePath", DataKind.String, 0) 1131new TextLoader.Column("ImagePath", DataKind.String, 0), 1132new TextLoader.Column("Label", DataKind.String, 1),
OnnxConversionTest.cs (53)
263new TextLoader.Column("label", DataKind.Single, 11), 264new TextLoader.Column("features", DataKind.Single, 0, 10) 387new TextLoader.Column("label", DataKind.Boolean, 0), 388new TextLoader.Column("text", DataKind.String, 1) 467TextLoader.Column[] columnsVector = new[] 469new TextLoader.Column("Key", valueType, 0, 3) 471TextLoader.Column[] columnsScalar = new[] 473new TextLoader.Column("Key", valueType, 0) 770new TextLoader.Column("VectorDouble2", DataKind.Double, 1), 771new TextLoader.Column("VectorDouble1", DataKind.Double, 4, 8), 772new TextLoader.Column("Label", DataKind.Boolean, 0) 871new TextLoader.Column("label", DataKind.Boolean, 0), 872new TextLoader.Column("text", DataKind.String, 1) 943TextLoader.Column[] columns = new[] 945new TextLoader.Column("Value", fromKind, 0, 0) 968new TextLoader.Column("label", DataKind.Single, 11), 969new TextLoader.Column("features", DataKind.Single, 0, 10) 1036new TextLoader.Column("Value", keyType, new[] 1038new TextLoader.Range(0) 1075new TextLoader.Column("Value", type, column), 1126new TextLoader.Column("Value", type, columnStart, columnEnd), 1192TextLoader.Column[] columnsVector = new[] 1194new TextLoader.Column("Value", valueType, 0, 3) 1196TextLoader.Column[] columnsScalar = new[] 1198new TextLoader.Column("Value", valueType, 0) 1230TextLoader.Column[] columnsVector = new[] 1232new TextLoader.Column("Keys", keyType, 0, 2) 1234TextLoader.Column[] columnsScalar = new[] 1236new TextLoader.Column("Keys", keyType, 0) 1394TextLoader.Column[] columnsVector = new[] 1396new TextLoader.Column("Value", valueType, 0, 3) 1398TextLoader.Column[] columnsScalar = new[] 1400new TextLoader.Column("Value", valueType, 0) 1604new TextLoader.Column("Label", dataKind, 0), 1605new TextLoader.Column("Thickness", DataKind.Single, 1), 1762var loader = mlContext.Data.CreateTextLoader( 1765new TextLoader.Column("Label", DataKind.String, 0), 1766new TextLoader.Column("SepalLength", DataKind.Single, 1), 1767new TextLoader.Column("SepalWidth", DataKind.Single, 2), 1768new TextLoader.Column("PetalLength", DataKind.Single, 3), 1769new TextLoader.Column("PetalWidth", DataKind.Single, 4) 1848new TextLoader.Column("Scalar", dataKind, 6), 1849new TextLoader.Column("Vector", dataKind, 1, 6), 1850new TextLoader.Column("Label", DataKind.Boolean, 0) 1887new TextLoader.Column("Label", DataKind.Boolean, 0), 1888new TextLoader.Column("Thickness", DataKind.Double, 1), 1889new TextLoader.Column("Size", DataKind.Single, 2), 1890new TextLoader.Column("Shape", DataKind.Int32, 3), 1891new TextLoader.Column("Adhesion", DataKind.Int32, 4), 1892new TextLoader.Column("EpithelialSize", DataKind.Int32, 5), 1893new TextLoader.Column("BlandChromatin", DataKind.Int32, 7), 1894new TextLoader.Column("NormalNucleoli", DataKind.Int32, 8), 1895new TextLoader.Column("Mitoses", DataKind.Int32, 9),
PermutationFeatureImportanceTests.cs (2)
490new[] { new TextLoader.Column("Label", DataKind.Boolean, 0), 491new TextLoader.Column("Features", DataKind.Single, 1, 9) });
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (58)
336new TextLoader.Column("Label", DataKind.Single, 0), 337new TextLoader.Column("CrimesPerCapita", DataKind.Single, 1), 338new TextLoader.Column("PercentResidental", DataKind.Single, 2), 339new TextLoader.Column("PercentNonRetail", DataKind.Single, 3), 340new TextLoader.Column("CharlesRiver", DataKind.Single, 4), 341new TextLoader.Column("NitricOxides", DataKind.Single, 5), 342new TextLoader.Column("RoomsPerDwelling", DataKind.Single, 6), 343new TextLoader.Column("PercentPre40s", DataKind.Single, 7), 344new TextLoader.Column("EmploymentDistance", DataKind.Single, 8), 345new TextLoader.Column("HighwayDistance", DataKind.Single, 9), 346new TextLoader.Column("TaxRate", DataKind.Single, 10), 347new TextLoader.Column("TeacherRatio", DataKind.Single, 11) 376new TextLoader.Column("Label", DataKind.Single, 0), 377new TextLoader.Column("CrimesPerCapita", DataKind.Single, 1), 378new TextLoader.Column("PercentResidental", DataKind.Single, 2), 379new TextLoader.Column("PercentNonRetail", DataKind.Single, 3), 380new TextLoader.Column("CharlesRiver", DataKind.Single, 4), 381new TextLoader.Column("NitricOxides", DataKind.Single, 5), 382new TextLoader.Column("RoomsPerDwelling", DataKind.Single, 6), 383new TextLoader.Column("PercentPre40s", DataKind.Single, 7), 384new TextLoader.Column("EmploymentDistance", DataKind.Single, 8), 385new TextLoader.Column("HighwayDistance", DataKind.Single, 9), 386new TextLoader.Column("TaxRate", DataKind.Single, 10), 387new TextLoader.Column("TeacherRatio", DataKind.Single, 11) 411new TextLoader.Column("Label", DataKind.Single, 0), 412new TextLoader.Column("CrimesPerCapita", DataKind.Single, 1), 413new TextLoader.Column("PercentResidental", DataKind.Single, 2), 414new TextLoader.Column("PercentNonRetail", DataKind.Single, 3), 415new TextLoader.Column("CharlesRiver", DataKind.Single, 4), 416new TextLoader.Column("NitricOxides", DataKind.Single, 5), 417new TextLoader.Column("RoomsPerDwelling", DataKind.Single, 6), 418new TextLoader.Column("PercentPre40s", DataKind.Single, 7), 419new TextLoader.Column("EmploymentDistance", DataKind.Single, 8), 420new TextLoader.Column("HighwayDistance", DataKind.Single, 9), 421new TextLoader.Column("TaxRate", DataKind.Single, 10), 422new TextLoader.Column("TeacherRatio", DataKind.Single, 11) 447new TextLoader.Column("MedianHomeValue", DataKind.Single, 0), 448new TextLoader.Column("CrimesPerCapita", DataKind.Single, 1), 449new TextLoader.Column("PercentResidental", DataKind.Single, 2), 450new TextLoader.Column("PercentNonRetail", DataKind.Single, 3), 451new TextLoader.Column("CharlesRiver", DataKind.Single, 4), 452new TextLoader.Column("NitricOxides", DataKind.Single, 5), 453new TextLoader.Column("RoomsPerDwelling", DataKind.Single, 6), 454new TextLoader.Column("PercentPre40s", DataKind.Single, 7), 455new TextLoader.Column("EmploymentDistance", DataKind.Single, 8), 456new TextLoader.Column("HighwayDistance", DataKind.Single, 9), 457new TextLoader.Column("TaxRate", DataKind.Single, 10), 458new TextLoader.Column("TeacherRatio", DataKind.Single, 11) 504var loader = mlContext.Data.CreateTextLoader(new[] 506new TextLoader.Column("IsToxic", DataKind.Boolean, 0), 507new TextLoader.Column("Message", DataKind.String, 1), 573var loader = mlContext.Data.CreateTextLoader(new[] 575new TextLoader.Column("Label", DataKind.Boolean, 0), 577new TextLoader.Column("CategoricalFeatures", DataKind.String, 1, 8), 579new TextLoader.Column("NumericalFeatures", DataKind.Single, 9, 14), 581new TextLoader.Column("Workclass", DataKind.String, 1), 708new TextLoader.Column("Income", DataKind.Single, 10), 709new TextLoader.Column("Features", DataKind.Single, 12, 14)
Scenarios\Api\Estimators\PredictAndMetadata.cs (4)
99var dataReader = mlContext.Data.CreateTextLoader( 102new TextLoader.Column("Label", DataKind.Single, 0), //notice the label being loaded as a float 103new TextLoader.Column("Features", DataKind.Single, new[]{ new TextLoader.Range(1,4) })
Scenarios\Api\TestApi.cs (10)
175var loader = TextLoader.Create(mlContext, new TextLoader.Options(), new MultiFileSource(dataFile)); 302new TextLoader.Column("Label", DataKind.Boolean, 0), 303new TextLoader.Column("Workclass", DataKind.String, 1), 304new TextLoader.Column("Education", DataKind.String,2), 305new TextLoader.Column("Age", DataKind.Single,9) 350new TextLoader.Column("Label", DataKind.Boolean, 0), 351new TextLoader.Column("Workclass", DataKind.String, 1), 352new TextLoader.Column("Education", DataKind.String,2), 353new TextLoader.Column("Age", DataKind.Single,9)
Scenarios\GetColumnTests.cs (11)
30new TextLoader.Column("floatScalar", DataKind.Single, 1), 31new TextLoader.Column("floatVector", DataKind.Single, 2, 6), 32new TextLoader.Column("stringScalar", DataKind.String, 4), 33new TextLoader.Column("stringVector", DataKind.String, 5, 7) 53new TextLoader.Column("floatScalar", DataKind.String, 1), 54new TextLoader.Column("anotherFloatVector", DataKind.Single, 2, 6), 55new TextLoader.Column("stringVector", DataKind.String, 5, 7) 72new TextLoader.Column("floatScalar", DataKind.Single, 1), 73new TextLoader.Column("floatVector", DataKind.Single, 2, 6), 74new TextLoader.Column("stringScalar", DataKind.String, 4), 75new TextLoader.Column("stringVector", DataKind.String, 5, 7)
Scenarios\IrisPlantClassificationTests.cs (6)
22var reader = mlContext.Data.CreateTextLoader(columns: new[] 24new TextLoader.Column("Label", DataKind.Single, 0), 25new TextLoader.Column("SepalLength", DataKind.Single, 1), 26new TextLoader.Column("SepalWidth", DataKind.Single, 2), 27new TextLoader.Column("PetalLength", DataKind.Single, 3), 28new TextLoader.Column("PetalWidth", DataKind.Single, 4)
Scenarios\IrisPlantClassificationWithStringLabelTests.cs (6)
18var reader = mlContext.Data.CreateTextLoader(columns: new[] 20new TextLoader.Column("SepalLength", DataKind.Single, 0), 21new TextLoader.Column("SepalWidth", DataKind.Single, 1), 22new TextLoader.Column("PetalLength", DataKind.Single, 2), 23new TextLoader.Column("PetalWidth", DataKind.Single, 3), 24new TextLoader.Column("IrisPlantType", DataKind.String, 4),
Scenarios\OvaTest.cs (20)
22var reader = new TextLoader(mlContext, new TextLoader.Options() 26new TextLoader.Column("Label", DataKind.Single, 0), 27new TextLoader.Column("Features", DataKind.Single, new [] { new TextLoader.Range(1, 4) }), 55var reader = new TextLoader(mlContext, new TextLoader.Options() 59new TextLoader.Column("Label", DataKind.Single, 0), 60new TextLoader.Column("Features", DataKind.Single, new [] { new TextLoader.Range(1, 4) }), 91var reader = new TextLoader(mlContext, new TextLoader.Options() 95new TextLoader.Column("Label", DataKind.Single, 0), 96new TextLoader.Column("Features", DataKind.Single, new [] { new TextLoader.Range(1, 4) }), 126var reader = new TextLoader(mlContext, new TextLoader.Options() 130new TextLoader.Column("Label", DataKind.Single, 0), 131new TextLoader.Column("Features", DataKind.Single, new [] { new TextLoader.Range(1, 4) }),
ScenariosWithDirectInstantiation\IrisPlantClassificationTests.cs (6)
20var reader = mlContext.Data.CreateTextLoader(columns: new[] 22new TextLoader.Column("Label", DataKind.Single, 0), 23new TextLoader.Column("SepalLength", DataKind.Single, 1), 24new TextLoader.Column("SepalWidth", DataKind.Single, 2), 25new TextLoader.Column("PetalLength", DataKind.Single, 3), 26new TextLoader.Column("PetalWidth", DataKind.Single, 4)
SvmLightTests.cs (2)
506var loader = ML.Data.CreateTextLoader(new[] { new TextLoader.Column("Column", DataKind.Single, 0) });
TermEstimatorTests.cs (19)
56var loader = new TextLoader(ML, new TextLoader.Options 59new TextLoader.Column("float1", DataKind.Single, 9), 60new TextLoader.Column("float4", DataKind.Single, new[]{new TextLoader.Range(9), new TextLoader.Range(10), new TextLoader.Range(11), new TextLoader.Range(12) }), 61new TextLoader.Column("double1", DataKind.Double, 9), 62new TextLoader.Column("double4", DataKind.Double, new[]{new TextLoader.Range(9), new TextLoader.Range(10), new TextLoader.Range(11), new TextLoader.Range(12) }), 63new TextLoader.Column("int1", DataKind.Int32, 9), 64new TextLoader.Column("text1", DataKind.String, 1), 65new TextLoader.Column("text2", DataKind.String, new[]{new TextLoader.Range(1), new TextLoader.Range(2)}),
TextLoaderTests.cs (61)
611var loader = mlContext.Data.CreateTextLoader(new TextLoader.Options(), new MultiFileSource(fileName)); 746dataIris = mlContext.Data.CreateTextLoader<Iris>(new TextLoader.Options() { Separator = ",", AllowQuoting = false }).Load(dataPath); 767dataIrisStartEnd = mlContext.Data.CreateTextLoader<IrisStartEnd>(new TextLoader.Options() { Separator = ",", AllowQuoting = false }).Load(dataPath); 789dataIrisColumnIndices = mlContext.Data.CreateTextLoader<IrisColumnIndices>(new TextLoader.Options() { Separator = ",", AllowQuoting = false }).Load(dataPath); 894var readerDecimalMarkerPeriod = new TextLoader(mlContext, new TextLoader.Options() 898new TextLoader.Column("Label", DataKind.UInt32, 0), 899new TextLoader.Column("Features", typeof(T) == typeof(double) ? DataKind.Double : DataKind.Single, new [] { new TextLoader.Range(1, 4) }), 930TextLoader.Options options = new TextLoader.Options() 934new TextLoader.Column("Label", DataKind.UInt32, 0), 935new TextLoader.Column("Features", typeof(T) == typeof(double) ? DataKind.Double : DataKind.Single, new [] { new TextLoader.Range(1, 4) }) 952var readerDecimalMarkerComma = new TextLoader(mlContext, options); 989TextLoader.Options options = new TextLoader.Options() 993new TextLoader.Column("Label", DataKind.UInt32, 0), 994new TextLoader.Column("Features", DataKind.Single, new [] { new TextLoader.Range(1, 4) }) 1007var reader = new TextLoader(mlContext, options); 1041var optionsPeriod = new TextLoader.Options() 1045new TextLoader.Column("Label", DataKind.UInt32, 0), 1046new TextLoader.Column("Features", DataKind.Single, new[] { new TextLoader.Range(1, 4) }) 1051var optionsComma = new TextLoader.Options() 1055new TextLoader.Column("Label", DataKind.UInt32, 0), 1056new TextLoader.Column("Features", DataKind.Single, new[] { new TextLoader.Range(1, 4) }) 1277var options = new TextLoader.Options() 1283EscapeChar = useCustomEscapeChar ? '\\' : TextLoader.Defaults.EscapeChar, 1286new TextLoader.Column("id", DataKind.Int32, 0), 1287new TextLoader.Column("description", DataKind.String, 1), 1288new TextLoader.Column("animal", DataKind.String, 2), 1389var options = new TextLoader.Options() 1397new TextLoader.Column("id", DataKind.Int32, 0), 1398new TextLoader.Column("description", DataKind.String, 1), 1399new TextLoader.Column("animal", DataKind.String, 2), 1429var options = new TextLoader.Options() 1436new TextLoader.Column("id", DataKind.Int32, 0), 1437new TextLoader.Column("description", DataKind.String, 1), 1438new TextLoader.Column("date", DataKind.DateTime, 4), 1439new TextLoader.Column("sing1", DataKind.Single, 2), 1440new TextLoader.Column("sing2", DataKind.Single, 3), 1441new TextLoader.Column("singFt1", DataKind.Single, new [] { new TextLoader.Range(2,3) } ), 1442new TextLoader.Column("sing3", DataKind.Single, 5), 1443new TextLoader.Column("sing4", DataKind.Single, 6), 1444new TextLoader.Column("singFt2", DataKind.Single, new [] { new TextLoader.Range(2,3), new TextLoader.Range(5,6) } ), 1445new TextLoader.Column("doub1", DataKind.Double, 2), 1446new TextLoader.Column("doub2", DataKind.Double, 3), 1447new TextLoader.Column("doubFt1", DataKind.Double, new [] { new TextLoader.Range(2,3) } ), 1448new TextLoader.Column("doub3", DataKind.Double, 5), 1449new TextLoader.Column("doub4", DataKind.Double, 6), 1450new TextLoader.Column("doubFt2", DataKind.Double, new [] { new TextLoader.Range(2,3), new TextLoader.Range(5,6) } )
TrainerEstimators\FAFMEstimator.cs (11)
89private TextLoader.Options GetFafmBCLoaderArgs() 91return new TextLoader.Options() 97new TextLoader.Column("Feature1", DataKind.Single, new [] { new TextLoader.Range(1, 2) }), 98new TextLoader.Column("Feature2", DataKind.Single, new [] { new TextLoader.Range(3, 4) }), 99new TextLoader.Column("Feature3", DataKind.Single, new [] { new TextLoader.Range(5, 6) }), 100new TextLoader.Column("Feature4", DataKind.Single, new [] { new TextLoader.Range(7, 9) }), 101new TextLoader.Column("Label", DataKind.Boolean, 0)
TrainerEstimators\MatrixFactorizationTests.cs (9)
68var reader = new TextLoader(mlContext, GetLoaderArgs(labelColumnName, userColumnName, itemColumnName)); 156private TextLoader.Options GetLoaderArgs(string labelColumnName, string matrixColumnIndexColumnName, string matrixRowIndexColumnName) 158return new TextLoader.Options() 164new TextLoader.Column(labelColumnName, DataKind.Single, new [] { new TextLoader.Range(0) }), 165new TextLoader.Column(matrixColumnIndexColumnName, DataKind.UInt32, new [] { new TextLoader.Range(1) }, new KeyCount(20)), 166new TextLoader.Column(matrixRowIndexColumnName, DataKind.UInt32, new [] { new TextLoader.Range(2) }, new KeyCount(40)),
TrainerEstimators\MetalinearEstimators.cs (2)
78var options = new TextLoader.Options() 83var loader = new TextLoader(Env, options: options);
TrainerEstimators\OneDalEstimators.cs (10)
40var loader = ML.Data.CreateTextLoader(columns: new[] { 41new TextLoader.Column("f0", DataKind.Single, 0), 42new TextLoader.Column("f1", DataKind.Single, 1), 43new TextLoader.Column("f2", DataKind.Single, 2), 44new TextLoader.Column("f3", DataKind.Single, 3), 45new TextLoader.Column("f4", DataKind.Single, 4), 46new TextLoader.Column("f5", DataKind.Single, 5), 47new TextLoader.Column("f6", DataKind.Single, 6), 48new TextLoader.Column("f7", DataKind.Single, 7), 49new TextLoader.Column("target", DataKind.Boolean,8)},
TrainerEstimators\OnlineLinearTests.cs (4)
21new TextLoader.Column("Label", DataKind.Single, 0), 22new TextLoader.Column("Features", DataKind.Single, 1, 10) 35new TextLoader.Column("Label", DataKind.Boolean, 0), 36new TextLoader.Column("Features", DataKind.Single, 1, 10)
TrainerEstimators\PriorRandomTests.cs (6)
17new TextLoader.Options() 22new TextLoader.Column("Label", DataKind.Boolean, 0), 23new TextLoader.Column("F1", DataKind.String, 1), 24new TextLoader.Column("F2", DataKind.Int32, 2), 25new TextLoader.Column("Rest", DataKind.Single, new [] { new TextLoader.Range(3, 9) })
TrainerEstimators\SdcaTests.cs (2)
22new TextLoader.Column("Label", DataKind.Single, 0), 23new TextLoader.Column("Features", DataKind.Single, 1, 10)
TrainerEstimators\TrainerEstimators.cs (31)
30var reader = new TextLoader(Env, new TextLoader.Options() 36new TextLoader.Column(featureColumn, DataKind.Single, new [] { new TextLoader.Range(1, 784) }) 59var reader = new TextLoader(Env, new TextLoader.Options 65new TextLoader.Column(featureColumn, DataKind.Single, new [] { new TextLoader.Range(1, 784) }), 66new TextLoader.Column(weights, DataKind.Single, 0), 192new TextLoader.Options() 199new TextLoader.Column("Label", DataKind.Boolean, 0), 200new TextLoader.Column("SentimentText", DataKind.String, 1), 201new TextLoader.Column("LoggedIn", DataKind.Boolean, 2) 227var data = new TextLoader(Env, new TextLoader.Options 233new TextLoader.Column("Label", DataKind.Single, 0), 234new TextLoader.Column("Workclass", DataKind.String, 1), 235new TextLoader.Column("NumericFeatures", DataKind.Single, new [] { new TextLoader.Range(9, 14) }) 250new TextLoader.Options() 256new TextLoader.Column("Label", DataKind.Single, 11), 257new TextLoader.Column("Features", DataKind.Single, new [] { new TextLoader.Range(0, 10) } ) 262private TextLoader.Options GetIrisLoaderArgs() 264return new TextLoader.Options() 270new TextLoader.Column("Features", DataKind.Single, new [] { new TextLoader.Range(0, 3) }), 271new TextLoader.Column("Label", DataKind.String, 4) 278var data = new TextLoader(Env, new TextLoader.Options() 283new TextLoader.Column("Features", DataKind.Single, new [] { new TextLoader.Range(0, 3) }), 284new TextLoader.Column("Label", DataKind.String, 4)
Transformers\CategoricalHashTests.cs (4)
82new TextLoader.Column("ScalarString", DataKind.String, 1), 83new TextLoader.Column("VectorString", DataKind.String, 1, 4), 84new TextLoader.Column("SingleVectorString", DataKind.String, new[] { new TextLoader.Range(1, 1) })
Transformers\CategoricalTests.cs (2)
158new TextLoader.Column("ScalarString", DataKind.String, 1), 159new TextLoader.Column("VectorString", DataKind.String, 1, 4)
Transformers\ConcatTests.cs (28)
46var loader = new TextLoader(ML, new TextLoader.Options 49new TextLoader.Column("float1", DataKind.Single, 9), 50new TextLoader.Column("float4", DataKind.Single, new[]{new TextLoader.Range(9), new TextLoader.Range(10), new TextLoader.Range(11), new TextLoader.Range(12) }), 51new TextLoader.Column("float6", DataKind.Single, new[]{new TextLoader.Range(9), new TextLoader.Range(10), new TextLoader.Range(11), new TextLoader.Range(12, 14) }), 52new TextLoader.Column("vfloat", DataKind.Single, new[]{new TextLoader.Range(14, null) { AutoEnd = false, VariableEnd = true } }) 104var loader = new TextLoader(ML, new TextLoader.Options 107new TextLoader.Column("float1", DataKind.Single, 9), 108new TextLoader.Column("float4", DataKind.Single, new[]{new TextLoader.Range(9), new TextLoader.Range(10), new TextLoader.Range(11), new TextLoader.Range(12) }), 109new TextLoader.Column("vfloat", DataKind.Single, new[]{new TextLoader.Range(9), new TextLoader.Range(10), new TextLoader.Range(11), new TextLoader.Range(12, null) { AutoEnd = false, VariableEnd = true } })
Transformers\CountTargetEncodingTests.cs (14)
27new TextLoader.Column("ScalarString", DataKind.String, 1), 28new TextLoader.Column("VectorString", DataKind.String, 1, 9), 29new TextLoader.Column("Label", DataKind.Single, 0) 42var data = ML.Data.LoadFromTextFile(dataPath, new[] { new TextLoader.Column("Label", DataKind.Single, 0), 43new TextLoader.Column("Text", DataKind.String, 1,9)}); 58new TextLoader.Column("ScalarString", DataKind.String, 1), 59new TextLoader.Column("VectorString", DataKind.String, 1, 9), 60new TextLoader.Column("Label", DataKind.Single, 0) 78new TextLoader.Column("ScalarString", DataKind.String, 1), 79new TextLoader.Column("VectorString", DataKind.String, 2, 9), 80new TextLoader.Column("Label", DataKind.Boolean, 0) 163new TextLoader.Column("ScalarString", DataKind.String, 1), 164new TextLoader.Column("VectorString", DataKind.String, 1, 9), 165new TextLoader.Column("Label", DataKind.Single, 0)
Transformers\CustomMappingTests.cs (22)
56var loader = ML.Data.CreateTextLoader(new[] { 57new TextLoader.Column("Float1", DataKind.Single, 9), 58new TextLoader.Column("Float4", DataKind.Single, new[]{new TextLoader.Range(9), new TextLoader.Range(10), new TextLoader.Range(11), new TextLoader.Range(12) }) 92var loader = ML.Data.CreateTextLoader(new[] { 93new TextLoader.Column("Float1", DataKind.Single, 0), 94new TextLoader.Column("Float4", DataKind.Single, new[]{new TextLoader.Range(0), new TextLoader.Range(2), new TextLoader.Range(4), new TextLoader.Range(10) }), 95new TextLoader.Column("Text1", DataKind.String, 0) 170var loader = ML.Data.CreateTextLoader(new[] { 171new TextLoader.Column("Features", DataKind.Single, 1, 9), 172new TextLoader.Column("Label", DataKind.String, 0), 173new TextLoader.Column("Value", DataKind.Single, 2), 195var loader = ML.Data.CreateTextLoader(new[] { 196new TextLoader.Column("Float4", DataKind.Single, 1, 4), 197new TextLoader.Column("Float1", DataKind.Single, 2),
Transformers\ExpressionTransformerTests.cs (10)
24var loader = new TextLoader(ML, new TextLoader.Options 27new TextLoader.Column("Float", DataKind.Single, 9), 28new TextLoader.Column("FloatVector", DataKind.Single, 9, 14), 29new TextLoader.Column("Double", DataKind.Double, 9), 30new TextLoader.Column("DoubleVector", DataKind.Double, 9, 14), 31new TextLoader.Column("Int", DataKind.Int32, 9), 32new TextLoader.Column("IntVector", DataKind.Int32, 9, 14), 33new TextLoader.Column("Text", DataKind.String, 1), 34new TextLoader.Column("TextVector", DataKind.String, 2, 8),
Transformers\FeatureSelectionTests.cs (25)
32new TextLoader.Column("label", DataKind.Boolean, 0), 33new TextLoader.Column("text", DataKind.String, 1) }, 37new TextLoader.Column("label", DataKind.Boolean, 0), 38new TextLoader.Column("text", DataKind.Single, 1) }, 66new TextLoader.Column("ScalarFloat", DataKind.Single, 1), 67new TextLoader.Column("ScalarDouble", DataKind.Double, 1), 68new TextLoader.Column("VectorFloat", DataKind.Single, 1, 4), 69new TextLoader.Column("VectorDouble", DataKind.Double, 4, 8), 108new TextLoader.Column("ScalarFloat", DataKind.Single, 6), 109new TextLoader.Column("VectorFloat", DataKind.Single, 1, 4), 110new TextLoader.Column("VectorDouble", DataKind.Double, 4, 8), 149new TextLoader.Column("Label", DataKind.UInt32, new[]{ new TextLoader.Range(0) }, new KeyCount(3)), 150new TextLoader.Column("VectorFloat", DataKind.Single, 1, 4) 171new TextLoader.Column("Label", DataKind.UInt32, new[] { new TextLoader.Range(0) }, new KeyCount(3)), 172new TextLoader.Column("ScalarFloat", DataKind.Single, 6), 173new TextLoader.Column("VectorFloat", DataKind.Single, 1, 4), 174new TextLoader.Column("VectorDouble", DataKind.Double, 4, 8), 209new TextLoader.Column("Label", DataKind.UInt32, new[]{ new TextLoader.Range(0) }, new KeyCount(3)), 210new TextLoader.Column("VectorFloat", DataKind.Single, 1, 4) 231new TextLoader.Column("BadLabel", DataKind.UInt32, 0), 232new TextLoader.Column("Label", DataKind.Single, 0), 233new TextLoader.Column("Features", DataKind.String, 1, 9),
Transformers\HashTests.cs (1)
359new TextLoader.Column("Features", DataKind.Single, 1, 9)
Transformers\KeyToBinaryVectorEstimatorTest.cs (2)
64new TextLoader.Column("ScalarString", DataKind.String, 0), 65new TextLoader.Column("VectorString", DataKind.String, 1, 4),
Transformers\KeyToValueTests.cs (9)
27var reader = new TextLoader(Env, new TextLoader.Options 31new TextLoader.Column("ScalarString", DataKind.String, 1), 32new TextLoader.Column("VectorString", DataKind.String, new[] {new TextLoader.Range(1, 4) }), 33new TextLoader.Column("BareKey", DataKind.UInt32, new[] { new TextLoader.Range(0) }, new KeyCount(6)) 69new TextLoader.Column("ScalarString", DataKind.String, 0), 70new TextLoader.Column("VectorString", DataKind.String, 1, 4),
Transformers\KeyToVectorEstimatorTests.cs (2)
74new TextLoader.Column("ScalarString", DataKind.String, 0), 75new TextLoader.Column("VectorString", DataKind.String, 1, 4),
Transformers\NAIndicatorTests.cs (4)
96new TextLoader.Column("ScalarFloat", DataKind.Single, 1), 97new TextLoader.Column("ScalarDouble", DataKind.Double, 1), 98new TextLoader.Column("VectorFloat", DataKind.Single, 1, 4), 99new TextLoader.Column("VectorDoulbe", DataKind.Double, 1, 4)
Transformers\NAReplaceTests.cs (4)
126new TextLoader.Column("ScalarFloat", DataKind.Single, 1), 127new TextLoader.Column("ScalarDouble", DataKind.Double, 1), 128new TextLoader.Column("VectorFloat", DataKind.Single, 1, 4), 129new TextLoader.Column("VectorDouble", DataKind.Double, 1, 4)
Transformers\NormalizerTests.cs (82)
37var loader = new TextLoader(Env, new TextLoader.Options 40new TextLoader.Column("float1", DataKind.Single, 1), 41new TextLoader.Column("float4", DataKind.Single, new[]{new TextLoader.Range(1, 4) }), 42new TextLoader.Column("double1", DataKind.Double, 1), 43new TextLoader.Column("double4", DataKind.Double, new[]{new TextLoader.Range(1, 4) }), 44new TextLoader.Column("int1", DataKind.Int32, 0), 45new TextLoader.Column("float0", DataKind.Single, new[]{ new TextLoader.Range { Min = 1, VariableEnd = true } }), 106var loader = new TextLoader(Env, new TextLoader.Options 109new TextLoader.Column("float1", DataKind.Single, 1), 110new TextLoader.Column("float4", DataKind.Single, new[]{new TextLoader.Range(1, 4) }), 111new TextLoader.Column("double1", DataKind.Double, 1), 112new TextLoader.Column("double4", DataKind.Double, new[]{new TextLoader.Range(1, 4) }), 113new TextLoader.Column("int1", DataKind.Int32, 0), 114new TextLoader.Column("float0", DataKind.Single, new[]{ new TextLoader.Range { Min = 1, VariableEnd = true } }) 224var loader = new TextLoader(context, new TextLoader.Options 227new TextLoader.Column("Label", DataKind.Single, 0), 228new TextLoader.Column("float1", DataKind.Single, 1), 229new TextLoader.Column("float4", DataKind.Single, new[]{new TextLoader.Range(1, 4) }), 230new TextLoader.Column("double1", DataKind.Double, 1), 231new TextLoader.Column("double4", DataKind.Double, new[]{new TextLoader.Range(1, 4) }), 232new TextLoader.Column("int1", DataKind.Int32, 0), 233new TextLoader.Column("float0", DataKind.Single, new[]{ new TextLoader.Range { Min = 1, VariableEnd = true } }) 471var loader = new TextLoader(Env, new TextLoader.Options 474new TextLoader.Column("Label", DataKind.Single, 0), 475new TextLoader.Column("float4", DataKind.Single, new[]{new TextLoader.Range(1, 4) }), 575var loader = new TextLoader(Env, new TextLoader.Options 578new TextLoader.Column("Label", DataKind.Single, 0), 579new TextLoader.Column("float4", DataKind.Single, new[]{new TextLoader.Range(1, 4) }), 633var loader = new TextLoader(Env, new TextLoader.Options 636new TextLoader.Column("Label", DataKind.Single, 0), 637new TextLoader.Column("input", DataKind.Single, new[]{new TextLoader.Range(1, 4) }), 657new TextLoader.Column("label", DataKind.Single, 11), 658new TextLoader.Column("features", DataKind.Single, 0, 10) 662new TextLoader.Column("label", DataKind.Single, 11), 663new TextLoader.Column("features", DataKind.String, 0, 10) 691new TextLoader.Column("label", DataKind.Single, 11), 692new TextLoader.Column("features", DataKind.Single, 0, 10) 696new TextLoader.Column("label", DataKind.Single, 11), 697new TextLoader.Column("features", DataKind.String, 0, 10) 733new TextLoader.Column("label", DataKind.Single, 11), 734new TextLoader.Column("features", DataKind.Single, 0, 10) 755new TextLoader.Column("label", DataKind.Single, 11), 756new TextLoader.Column("features", DataKind.Single, 0, 10) 760new TextLoader.Column("label", DataKind.Single, 11), 761new TextLoader.Column("features", DataKind.String, 0, 10) 794new TextLoader.Column("label", DataKind.Single, 11), 795new TextLoader.Column("features", DataKind.Single, 0, 10) 815new TextLoader.Column("label", DataKind.Single, 11), 816new TextLoader.Column("features", DataKind.Single, 0, 10) 820new TextLoader.Column("label", DataKind.Single, 11), 821new TextLoader.Column("features", DataKind.String, 0, 10) 854new TextLoader.Column("label", DataKind.Single, 11), 855new TextLoader.Column("features", DataKind.Single, 0, 10) 874var dataView = TextLoader.Create(ML, new TextLoader.Options(), new MultiFileSource(dataFile)); 991var loader = new TextLoader(Env, new TextLoader.Options 994new TextLoader.Column("float1", DataKind.Single, 1), 995new TextLoader.Column("float4", DataKind.Single, new[]{new TextLoader.Range(1, 4) }), 996new TextLoader.Column("double1", DataKind.Double, 1), 997new TextLoader.Column("double4", DataKind.Double, new[]{new TextLoader.Range(1, 4) }), 998new TextLoader.Column("int1", DataKind.Int32, 0),
Transformers\PcaTests.cs (8)
30new TextLoader.Column("label", DataKind.Single, 11), 31new TextLoader.Column("weight", DataKind.Single, 0), 32new TextLoader.Column("features", DataKind.Single, 1, 10) 36new TextLoader.Column("label", DataKind.Single, 11), 37new TextLoader.Column("weight", DataKind.Single, 0), 38new TextLoader.Column("features", DataKind.String, 1, 10) 54new TextLoader.Column("label", DataKind.Single, 11), 55new TextLoader.Column("features", DataKind.Single, 0, 10)
Transformers\RffTests.cs (2)
68new TextLoader.Column("VectorFloat", DataKind.Single, 1, 8), 69new TextLoader.Column("Label", DataKind.Single, 0)
Transformers\TextFeaturizerTests.cs (33)
427new TextLoader.Column("label", DataKind.Boolean, 0), 428new TextLoader.Column("text", DataKind.String, 1) }, 432new TextLoader.Column("label", DataKind.Boolean, 0), 433new TextLoader.Column("text", DataKind.Single, 1) }, 460new TextLoader.Column("label", DataKind.Boolean, 0), 461new TextLoader.Column("text", DataKind.String, 1) }, 465new TextLoader.Column("label", DataKind.Boolean, 0), 466new TextLoader.Column("text", DataKind.Single, 1) }, 490new TextLoader.Column("label", DataKind.Boolean, 0), 491new TextLoader.Column("text", DataKind.String, 1) }, 527new TextLoader.Column("label", DataKind.Boolean, 0), 528new TextLoader.Column("text", DataKind.String, 1) }, 532new TextLoader.Column("label", DataKind.Boolean, 0), 533new TextLoader.Column("text", DataKind.Single, 1) }, 558var data = TextLoader.Create(ML, new TextLoader.Options() 562new TextLoader.Column("Text", DataKind.String, 1) 590new TextLoader.Column("label", DataKind.Boolean, 0), 591new TextLoader.Column("text", DataKind.String, 1) }, 595new TextLoader.Column("label", DataKind.Boolean, 0), 596new TextLoader.Column("text", DataKind.Single, 1) }, 620new TextLoader.Column("label", DataKind.Boolean, 0), 621new TextLoader.Column("text", DataKind.String, 1) }, 625new TextLoader.Column("label", DataKind.Boolean, 0), 626new TextLoader.Column("text", DataKind.Single, 1) }, 657new TextLoader.Column("Sentiment", DataKind.Boolean, 0), 658new TextLoader.Column("SentimentText", DataKind.String, 1) }, 674new TextLoader.Column("label", DataKind.Boolean, 0), 675new TextLoader.Column("text", DataKind.String, 1) }, 679new TextLoader.Column("label", DataKind.Boolean, 0), 680new TextLoader.Column("text", DataKind.Single, 1) }, 778new TextLoader.Column("Label", DataKind.Boolean, 0), 779new TextLoader.Column("Features", DataKind.String, 1, 9)
Transformers\TextNormalizer.cs (2)
52new TextLoader.Column("label", DataKind.Boolean, 0), 53new TextLoader.Column("text", DataKind.String, 1)
Transformers\WordEmbeddingsTests.cs (6)
30new TextLoader.Options() 36new TextLoader.Column("Label", DataKind.Boolean, 0), 37new TextLoader.Column("SentimentText", DataKind.String, 1) 65new TextLoader.Options() 71new TextLoader.Column("Label", DataKind.Boolean, 0), 72new TextLoader.Column("SentimentText", DataKind.String, 1)
Microsoft.ML.TimeSeries.Tests (1)
TimeSeriesDirectApi.cs (1)
540new TextLoader.Column("Value", DataKind.Single, 0),
Microsoft.ML.TorchSharp.Tests (27)
NerTests.cs (8)
195var labels = ML.Data.LoadFromTextFile(labelFilePath, new TextLoader.Column[] 197new TextLoader.Column("Key", DataKind.String, 0) 202var dataView = TextLoader.Create(ML, new TextLoader.Options() 206new TextLoader.Column("Sentence", DataKind.String, 0), 207new TextLoader.Column("Label", DataKind.String, new TextLoader.Range[] 209new TextLoader.Range(1, null) { VariableEnd = true, AutoEnd = false }
ObjectDetectionTests.cs (8)
33var data = TextLoader.Create(ML, new TextLoader.Options() 37new TextLoader.Column("ImagePath", DataKind.String, 0), 38new TextLoader.Column("Labels", DataKind.String, 1), 39new TextLoader.Column("Box", DataKind.String, 2) 92var dataFiltered = TextLoader.Create(ML, new TextLoader.Options() 96new TextLoader.Column("ImagePath", DataKind.String, 0),
QATests.cs (6)
73IDataView dataView = TextLoader.Create(ML, new TextLoader.Options() 77new TextLoader.Column("Context", DataKind.String,0), 78new TextLoader.Column("Question", DataKind.String,1), 79new TextLoader.Column("TrainingAnswer", DataKind.String,2), 80new TextLoader.Column("AnswerIndex", DataKind.Int32,3)
TextClassificationTests.cs (5)
417IDataView dataView = TextLoader.Create(ML, new TextLoader.Options() 421new TextLoader.Column("search_term", DataKind.String,3), 422new TextLoader.Column("relevance", DataKind.Single,4), 423new TextLoader.Column("product_description", DataKind.String,5)
Microsoft.ML.Transforms (3)
Text\StopWordsRemovingTransformer.cs (3)
812var options = new TextLoader.Options() 816new TextLoader.Column(stopwordsCol, DataKind.String, 0) 820var textLoader = new TextLoader(Host, options: options, dataSample: fileSource);
Microsoft.ML.Vision (2)
ImageClassificationTrainer.cs (2)
27using static Microsoft.ML.Data.TextLoader; 30using Column = Microsoft.ML.Data.TextLoader.Column;