3 instantiations of MissingValueReplacingEstimator
Microsoft.ML.Transforms (3)
ExtensionsCatalog.cs (3)
83
=> new
MissingValueReplacingEstimator
(CatalogUtils.GetEnvironment(catalog), new[] { new MissingValueReplacingEstimator.ColumnOptions(outputColumnName, inputColumnName, replacementMode, imputeBySlot) });
110
return new
MissingValueReplacingEstimator
(env, columnOptions);
121
=> new
MissingValueReplacingEstimator
(CatalogUtils.GetEnvironment(catalog), columns);
77 references to MissingValueReplacingEstimator
Microsoft.ML.Samples (8)
Dynamic\Transforms\ReplaceMissingValues.cs (4)
32
var
defaultPipeline = mlContext.Transforms.ReplaceMissingValues(
33
"MissingReplaced", "Features",
MissingValueReplacingEstimator
63
var
meanPipeline = mlContext.Transforms.ReplaceMissingValues(
64
"MissingReplaced", "Features",
MissingValueReplacingEstimator
Dynamic\Transforms\ReplaceMissingValuesMultiColumn.cs (4)
36
var
defaultPipeline = mlContext.Transforms.ReplaceMissingValues(new[] {
40
MissingValueReplacingEstimator
.ReplacementMode.DefaultValue);
71
var
meanPipeline = mlContext.Transforms.ReplaceMissingValues(new[] {
75
MissingValueReplacingEstimator
.ReplacementMode.Mean);
Microsoft.ML.Tests (37)
OnnxConversionTest.cs (1)
793
.Append(mlContext.Transforms.ReplaceMissingValues(new
MissingValueReplacingEstimator
.ColumnOptions("F2")))
Transformers\NAReplaceTests.cs (36)
67
var
pipe = ML.Transforms.ReplaceMissingValues(
68
new
MissingValueReplacingEstimator
.ColumnOptions("A", "A",
MissingValueReplacingEstimator
.ReplacementMode.Mode),
69
new
MissingValueReplacingEstimator
.ColumnOptions("CA", "C",
MissingValueReplacingEstimator
.ReplacementMode.Mode, imputeBySlot: false),
70
new
MissingValueReplacingEstimator
.ColumnOptions("CB", "C",
MissingValueReplacingEstimator
.ReplacementMode.Mode),
71
new
MissingValueReplacingEstimator
.ColumnOptions("B", "B",
MissingValueReplacingEstimator
.ReplacementMode.Mode),
72
new
MissingValueReplacingEstimator
.ColumnOptions("DA", "D",
MissingValueReplacingEstimator
.ReplacementMode.Mode, imputeBySlot: false),
73
new
MissingValueReplacingEstimator
.ColumnOptions("DB", "D",
MissingValueReplacingEstimator
.ReplacementMode.Mode)
112
var
pipe = ML.Transforms.ReplaceMissingValues(
113
new
MissingValueReplacingEstimator
.ColumnOptions("NAA", "A",
MissingValueReplacingEstimator
.ReplacementMode.Mean),
114
new
MissingValueReplacingEstimator
.ColumnOptions("NAB", "B",
MissingValueReplacingEstimator
.ReplacementMode.Mean),
115
new
MissingValueReplacingEstimator
.ColumnOptions("NAC", "C",
MissingValueReplacingEstimator
.ReplacementMode.Mean),
116
new
MissingValueReplacingEstimator
.ColumnOptions("NAD", "D",
MissingValueReplacingEstimator
.ReplacementMode.Mean));
135
var est = ML.Transforms.ReplaceMissingValues("A", "ScalarFloat", replacementMode:
MissingValueReplacingEstimator
.ReplacementMode.Maximum)
136
.Append(ML.Transforms.ReplaceMissingValues("B", "ScalarDouble", replacementMode:
MissingValueReplacingEstimator
.ReplacementMode.Mean))
137
.Append(ML.Transforms.ReplaceMissingValues("C", "VectorFloat", replacementMode:
MissingValueReplacingEstimator
.ReplacementMode.Mean))
138
.Append(ML.Transforms.ReplaceMissingValues("D", "VectorDouble", replacementMode:
MissingValueReplacingEstimator
.ReplacementMode.Minimum))
139
.Append(ML.Transforms.ReplaceMissingValues("E", "VectorDouble", replacementMode:
MissingValueReplacingEstimator
.ReplacementMode.Mode));
170
var
pipe = ML.Transforms.ReplaceMissingValues(
171
new
MissingValueReplacingEstimator
.ColumnOptions("NAA", "A",
MissingValueReplacingEstimator
.ReplacementMode.Mean),
172
new
MissingValueReplacingEstimator
.ColumnOptions("NAB", "B",
MissingValueReplacingEstimator
.ReplacementMode.Mean),
173
new
MissingValueReplacingEstimator
.ColumnOptions("NAC", "C",
MissingValueReplacingEstimator
.ReplacementMode.Mean),
174
new
MissingValueReplacingEstimator
.ColumnOptions("NAD", "D",
MissingValueReplacingEstimator
.ReplacementMode.Mean));
Microsoft.ML.Transforms (32)
ExtensionsCatalog.cs (16)
60
/// Create a <see cref="
MissingValueReplacingEstimator
"/>, which copies the data from the column specified in <paramref name="inputColumnName"/>
68
/// <param name="replacementMode">The type of replacement to use as specified in <see cref="
MissingValueReplacingEstimator
.ReplacementMode"/></param>
78
public static
MissingValueReplacingEstimator
ReplaceMissingValues(this TransformsCatalog catalog,
81
MissingValueReplacingEstimator
.ReplacementMode replacementMode =
MissingValueReplacingEstimator
.Defaults.Mode,
82
bool imputeBySlot =
MissingValueReplacingEstimator
.Defaults.ImputeBySlot)
83
=> new MissingValueReplacingEstimator(CatalogUtils.GetEnvironment(catalog), new[] { new
MissingValueReplacingEstimator
.ColumnOptions(outputColumnName, inputColumnName, replacementMode, imputeBySlot) });
92
/// <param name="replacementMode">The type of replacement to use as specified in <see cref="
MissingValueReplacingEstimator
.ReplacementMode"/></param>
102
public static
MissingValueReplacingEstimator
ReplaceMissingValues(this TransformsCatalog catalog,
104
MissingValueReplacingEstimator
.ReplacementMode replacementMode =
MissingValueReplacingEstimator
.Defaults.Mode,
105
bool imputeBySlot =
MissingValueReplacingEstimator
.Defaults.ImputeBySlot)
109
var columnOptions = columns.Select(x => new
MissingValueReplacingEstimator
.ColumnOptions(x.OutputColumnName, x.InputColumnName, replacementMode, imputeBySlot)).ToArray();
115
/// The missing values of the input column, in this new column are replaced with <see cref="
MissingValueReplacingEstimator
.ReplacementMode.DefaultValue"/>.
120
internal static
MissingValueReplacingEstimator
ReplaceMissingValues(this TransformsCatalog catalog, params
MissingValueReplacingEstimator
.ColumnOptions[] columns)
MissingValueHandlingTransformer.cs (5)
141
var replaceCols = new List<
MissingValueReplacingEstimator
.ColumnOptions>();
155
replaceCols.Add(new
MissingValueReplacingEstimator
.ColumnOptions(column.Name, column.Source,
156
(
MissingValueReplacingEstimator
.ReplacementMode)(column.Kind ?? options.ReplaceWith), column.ImputeBySlot ?? options.ImputeBySlot));
190
replaceCols.Add(new
MissingValueReplacingEstimator
.ColumnOptions(tmpReplacementColName, column.Source,
191
(
MissingValueReplacingEstimator
.ReplacementMode)(column.Kind ?? options.ReplaceWith), column.ImputeBySlot ?? options.ImputeBySlot));
MissingValueReplacing.cs (11)
36
/// <see cref="ITransformer"/> resulting from fitting a <see cref="
MissingValueReplacingEstimator
"/>.
122
public ReplacementKind ReplacementKind = (ReplacementKind)
MissingValueReplacingEstimator
.Defaults.Mode;
126
public bool ImputeBySlot =
MissingValueReplacingEstimator
.Defaults.ImputeBySlot;
181
private static (string outputColumnName, string inputColumnName)[] GetColumnPairs(
MissingValueReplacingEstimator
.ColumnOptions[] columns)
210
internal MissingValueReplacingTransformer(IHostEnvironment env, IDataView input, params
MissingValueReplacingEstimator
.ColumnOptions[] columns)
277
private void GetReplacementValues(IDataView input,
MissingValueReplacingEstimator
.ColumnOptions[] columns, out object[] repValues, out BitArray[] slotIsDefault, out DataViewType[] types)
436
var cols = new
MissingValueReplacingEstimator
.ColumnOptions[options.Columns.Length];
444
cols[i] = new
MissingValueReplacingEstimator
.ColumnOptions(
447
(
MissingValueReplacingEstimator
.ReplacementMode)(item.Kind ?? options.ReplacementKind),
454
internal static IDataTransform Create(IHostEnvironment env, IDataView input, params
MissingValueReplacingEstimator
.ColumnOptions[] columns)
1026
_host = env.Register(nameof(
MissingValueReplacingEstimator
));