3 instantiations of TypeConvertingEstimator
Microsoft.ML.Data (3)
Transforms\ConversionsExtensionsCatalog.cs (3)
84
=> new
TypeConvertingEstimator
(CatalogUtils.GetEnvironment(catalog), new[] { new TypeConvertingEstimator.ColumnOptions(outputColumnName, outputKind, inputColumnName) });
107
return new
TypeConvertingEstimator
(env, columnOptions);
120
=> new
TypeConvertingEstimator
(CatalogUtils.GetEnvironment(catalog), columns);
68 references to TypeConvertingEstimator
Microsoft.ML.Data (26)
Transforms\ConversionsExtensionsCatalog.cs (12)
14
using ConvertDefaults =
TypeConvertingEstimator
.Defaults;
69
/// Create a <see cref="
TypeConvertingEstimator
"/>, which converts the type of the data to the type specified in <paramref name="outputKind"/>.
82
public static
TypeConvertingEstimator
ConvertType(this TransformsCatalog.ConversionTransforms catalog, string outputColumnName, string inputColumnName = null,
84
=> new TypeConvertingEstimator(CatalogUtils.GetEnvironment(catalog), new[] { new
TypeConvertingEstimator
.ColumnOptions(outputColumnName, outputKind, inputColumnName) });
87
/// Create a <see cref="
TypeConvertingEstimator
"/>, which converts the type of the data to the type specified in <paramref name="outputKind"/>.
100
public static
TypeConvertingEstimator
ConvertType(this TransformsCatalog.ConversionTransforms catalog,
106
var columnOptions = columns.Select(x => new
TypeConvertingEstimator
.ColumnOptions(x.OutputColumnName, outputKind, x.InputColumnName)).ToArray();
111
/// Create a <see cref="
TypeConvertingEstimator
"/>, which converts the type of the data in the <see cref="
TypeConvertingEstimator
.ColumnOptions.InputColumnName"/>
112
/// to the type specified in the <see cref="
TypeConvertingEstimator
.ColumnOptions.OutputKind"/>
119
internal static
TypeConvertingEstimator
ConvertType(this TransformsCatalog.ConversionTransforms catalog, params
TypeConvertingEstimator
.ColumnOptions[] columns)
Transforms\TypeConverting.cs (13)
54
/// <see cref="ITransformer"/> resulting from fitting a <see cref="
TypeConvertingEstimator
"/>.
172
/// A collection of <see cref="
TypeConvertingEstimator
.ColumnOptions"/> describing the settings of the transformation.
174
internal IReadOnlyCollection<
TypeConvertingEstimator
.ColumnOptions> Columns => _columns.AsReadOnly();
176
private readonly
TypeConvertingEstimator
.ColumnOptions[] _columns;
178
private static (string outputColumnName, string inputColumnName)[] GetColumnPairs(
TypeConvertingEstimator
.ColumnOptions[] columns)
193
: this(env, new
TypeConvertingEstimator
.ColumnOptions(outputColumnName, outputKind, inputColumnName ?? outputColumnName, outputKeyCount))
200
internal TypeConvertingTransformer(IHostEnvironment env, params
TypeConvertingEstimator
.ColumnOptions[] columns)
261
_columns = new
TypeConvertingEstimator
.ColumnOptions[columnsLength];
290
_columns[i] = new
TypeConvertingEstimator
.ColumnOptions(ColumnPairs[i].outputColumnName, kind.ToDataKind(), ColumnPairs[i].inputColumnName, keyCount);
302
var cols = new
TypeConvertingEstimator
.ColumnOptions[options.Columns.Length];
338
cols[i] = new
TypeConvertingEstimator
.ColumnOptions(item.Name, kind.ToDataKind(), item.Source ?? item.Name, keyCount);
611
/// Create a <see cref="
TypeConvertingEstimator
"/> that takes multiple pairs of columns.
614
base(Contracts.CheckRef(env, nameof(env)).Register(nameof(
TypeConvertingEstimator
)), new TypeConvertingTransformer(env, columns))
Utilities\TypeParsingUtils.cs (1)
74
/// It is used by <see cref="TextLoader"/> and <see cref="
TypeConvertingEstimator
"/>.
Microsoft.ML.EntryPoints (5)
FeatureCombiner.cs (5)
61
List<
TypeConvertingEstimator
.ColumnOptions> cvt;
142
private static IDataView ApplyConvert(List<
TypeConvertingEstimator
.ColumnOptions> cvt, IDataView viewTrain, IHostEnvironment env)
153
out List<
TypeConvertingEstimator
.ColumnOptions> cvt, out int errCount)
188
Utils.Add(ref cvt, new
TypeConvertingEstimator
.ColumnOptions(colName, DataKind.Single, col.Name));
303
var xf = new TypeConvertingTransformer(host, new
TypeConvertingEstimator
.ColumnOptions(input.LabelColumn, DataKind.Single, input.LabelColumn)).Transform(input.Data);
Microsoft.ML.Fairlearn (1)
Metrics\FairlearnMetricCatalog.cs (1)
68
var
convertToString = _context.Transforms.Conversion.ConvertType(sensitiveCol.Name, sensitiveCol.Name, DataKind.String);
Microsoft.ML.FastTree (1)
FastTree.cs (1)
1355
data = new TypeConvertingTransformer(Host, new
TypeConvertingEstimator
.ColumnOptions(groupName, DataKind.UInt64, groupName)).Transform(data);
Microsoft.ML.Samples (2)
Dynamic\Transforms\Conversion\ConvertType.cs (1)
23
var
pipeline = mlContext.Transforms.Conversion.ConvertType(
Dynamic\Transforms\Conversion\ConvertTypeMultiColumn.cs (1)
40
var
pipeline = mlContext.Transforms.Conversion.ConvertType(new[]
Microsoft.ML.Tests (31)
OnnxConversionTest.cs (1)
949
var
pipeline = mlContext.Transforms.Conversion.ConvertType("ValueConverted", "Value", outputKind: toKind);
Transformers\ConvertTests.cs (30)
130
var
pipe = ML.Transforms.Conversion.ConvertType(columns: new[] {new
TypeConvertingEstimator
.ColumnOptions("ConvA", DataKind.Single, "A"),
131
new
TypeConvertingEstimator
.ColumnOptions("ConvB", DataKind.Single, "B")});
169
var
allTypesPipe = ML.Transforms.Conversion.ConvertType(columns: new[] {
170
new
TypeConvertingEstimator
.ColumnOptions("ConvA", DataKind.Single, "AA"),
171
new
TypeConvertingEstimator
.ColumnOptions("ConvB", DataKind.Single, "AB"),
172
new
TypeConvertingEstimator
.ColumnOptions("ConvC", DataKind.Single, "AC"),
173
new
TypeConvertingEstimator
.ColumnOptions("ConvD", DataKind.Single, "AD"),
174
new
TypeConvertingEstimator
.ColumnOptions("ConvE", DataKind.Single, "AE"),
175
new
TypeConvertingEstimator
.ColumnOptions("ConvF", DataKind.Single, "AF"),
176
new
TypeConvertingEstimator
.ColumnOptions("ConvG", DataKind.Single, "AG"),
177
new
TypeConvertingEstimator
.ColumnOptions("ConvH", DataKind.Single, "AH"),
178
new
TypeConvertingEstimator
.ColumnOptions("ConvK", DataKind.Single, "AK"),
179
new
TypeConvertingEstimator
.ColumnOptions("ConvL", DataKind.Single, "AL"),
180
new
TypeConvertingEstimator
.ColumnOptions("ConvM", DataKind.Single, "AM"),
181
new
TypeConvertingEstimator
.ColumnOptions("ConvN", DataKind.Single, "AN"),
182
new
TypeConvertingEstimator
.ColumnOptions("ConvBI", DataKind.Int32, "AB") // verify Boolean -> Int32 conversion
254
var
allInputTypesDataPipe = ML.Transforms.Conversion.ConvertType(columns: new[] {new
TypeConvertingEstimator
.ColumnOptions("A1", DataKind.String, "A"),
255
new
TypeConvertingEstimator
.ColumnOptions("B1", DataKind.String, "B"),
256
new
TypeConvertingEstimator
.ColumnOptions("C1", DataKind.String, "C"),
257
new
TypeConvertingEstimator
.ColumnOptions("D1", DataKind.String, "D"),
258
new
TypeConvertingEstimator
.ColumnOptions("E1", DataKind.String, "E"),
259
new
TypeConvertingEstimator
.ColumnOptions("F1", DataKind.String, "F"),
320
var
pipe = ML.Transforms.Conversion.ConvertType(columns: new[] {new
TypeConvertingEstimator
.ColumnOptions("ConvA", typeof(double), "A"),
321
new
TypeConvertingEstimator
.ColumnOptions("ConvB", typeof(double), "B")});
342
new
TypeConvertingEstimator
.ColumnOptions("ConvA", DataKind.Double, "CatA"),
343
new
TypeConvertingEstimator
.ColumnOptions("ConvB", DataKind.UInt16, "CatB")
400
var modelNew = ML.Transforms.Conversion.ConvertType(new[] { new
TypeConvertingEstimator
.ColumnOptions("convertedKey",
Microsoft.ML.Transforms (2)
MissingValueHandlingTransformer.cs (2)
143
var naConvCols = new List<
TypeConvertingEstimator
.ColumnOptions>();
186
naConvCols.Add(new
TypeConvertingEstimator
.ColumnOptions(tmpIsMissingColName, replaceItemTypeKind.ToDataKind(), tmpIsMissingColName));