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) }); 110return new MissingValueReplacingEstimator(env, columnOptions); 121=> new MissingValueReplacingEstimator(CatalogUtils.GetEnvironment(catalog), columns);
77 references to MissingValueReplacingEstimator
Microsoft.ML.Samples (8)
Dynamic\Transforms\ReplaceMissingValues.cs (4)
32var defaultPipeline = mlContext.Transforms.ReplaceMissingValues( 33"MissingReplaced", "Features", MissingValueReplacingEstimator 63var meanPipeline = mlContext.Transforms.ReplaceMissingValues( 64"MissingReplaced", "Features", MissingValueReplacingEstimator
Dynamic\Transforms\ReplaceMissingValuesMultiColumn.cs (4)
36var defaultPipeline = mlContext.Transforms.ReplaceMissingValues(new[] { 40MissingValueReplacingEstimator.ReplacementMode.DefaultValue); 71var meanPipeline = mlContext.Transforms.ReplaceMissingValues(new[] { 75MissingValueReplacingEstimator.ReplacementMode.Mean);
Microsoft.ML.Tests (37)
OnnxConversionTest.cs (1)
793.Append(mlContext.Transforms.ReplaceMissingValues(new MissingValueReplacingEstimator.ColumnOptions("F2")))
Transformers\NAReplaceTests.cs (36)
67var pipe = ML.Transforms.ReplaceMissingValues( 68new MissingValueReplacingEstimator.ColumnOptions("A", "A", MissingValueReplacingEstimator.ReplacementMode.Mode), 69new MissingValueReplacingEstimator.ColumnOptions("CA", "C", MissingValueReplacingEstimator.ReplacementMode.Mode, imputeBySlot: false), 70new MissingValueReplacingEstimator.ColumnOptions("CB", "C", MissingValueReplacingEstimator.ReplacementMode.Mode), 71new MissingValueReplacingEstimator.ColumnOptions("B", "B", MissingValueReplacingEstimator.ReplacementMode.Mode), 72new MissingValueReplacingEstimator.ColumnOptions("DA", "D", MissingValueReplacingEstimator.ReplacementMode.Mode, imputeBySlot: false), 73new MissingValueReplacingEstimator.ColumnOptions("DB", "D", MissingValueReplacingEstimator.ReplacementMode.Mode) 112var pipe = ML.Transforms.ReplaceMissingValues( 113new MissingValueReplacingEstimator.ColumnOptions("NAA", "A", MissingValueReplacingEstimator.ReplacementMode.Mean), 114new MissingValueReplacingEstimator.ColumnOptions("NAB", "B", MissingValueReplacingEstimator.ReplacementMode.Mean), 115new MissingValueReplacingEstimator.ColumnOptions("NAC", "C", MissingValueReplacingEstimator.ReplacementMode.Mean), 116new MissingValueReplacingEstimator.ColumnOptions("NAD", "D", MissingValueReplacingEstimator.ReplacementMode.Mean)); 135var 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)); 170var pipe = ML.Transforms.ReplaceMissingValues( 171new MissingValueReplacingEstimator.ColumnOptions("NAA", "A", MissingValueReplacingEstimator.ReplacementMode.Mean), 172new MissingValueReplacingEstimator.ColumnOptions("NAB", "B", MissingValueReplacingEstimator.ReplacementMode.Mean), 173new MissingValueReplacingEstimator.ColumnOptions("NAC", "C", MissingValueReplacingEstimator.ReplacementMode.Mean), 174new 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> 78public static MissingValueReplacingEstimator ReplaceMissingValues(this TransformsCatalog catalog, 81MissingValueReplacingEstimator.ReplacementMode replacementMode = MissingValueReplacingEstimator.Defaults.Mode, 82bool 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> 102public static MissingValueReplacingEstimator ReplaceMissingValues(this TransformsCatalog catalog, 104MissingValueReplacingEstimator.ReplacementMode replacementMode = MissingValueReplacingEstimator.Defaults.Mode, 105bool imputeBySlot = MissingValueReplacingEstimator.Defaults.ImputeBySlot) 109var 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"/>. 120internal static MissingValueReplacingEstimator ReplaceMissingValues(this TransformsCatalog catalog, params MissingValueReplacingEstimator.ColumnOptions[] columns)
MissingValueHandlingTransformer.cs (5)
141var replaceCols = new List<MissingValueReplacingEstimator.ColumnOptions>(); 155replaceCols.Add(new MissingValueReplacingEstimator.ColumnOptions(column.Name, column.Source, 156(MissingValueReplacingEstimator.ReplacementMode)(column.Kind ?? options.ReplaceWith), column.ImputeBySlot ?? options.ImputeBySlot)); 190replaceCols.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"/>. 122public ReplacementKind ReplacementKind = (ReplacementKind)MissingValueReplacingEstimator.Defaults.Mode; 126public bool ImputeBySlot = MissingValueReplacingEstimator.Defaults.ImputeBySlot; 181private static (string outputColumnName, string inputColumnName)[] GetColumnPairs(MissingValueReplacingEstimator.ColumnOptions[] columns) 210internal MissingValueReplacingTransformer(IHostEnvironment env, IDataView input, params MissingValueReplacingEstimator.ColumnOptions[] columns) 277private void GetReplacementValues(IDataView input, MissingValueReplacingEstimator.ColumnOptions[] columns, out object[] repValues, out BitArray[] slotIsDefault, out DataViewType[] types) 436var cols = new MissingValueReplacingEstimator.ColumnOptions[options.Columns.Length]; 444cols[i] = new MissingValueReplacingEstimator.ColumnOptions( 447(MissingValueReplacingEstimator.ReplacementMode)(item.Kind ?? options.ReplacementKind), 454internal static IDataTransform Create(IHostEnvironment env, IDataView input, params MissingValueReplacingEstimator.ColumnOptions[] columns) 1026_host = env.Register(nameof(MissingValueReplacingEstimator));