Пример #1
0
        internal static NormalizingEstimator Normalize(this TransformsCatalog catalog,
                                                       NormalizingEstimator.NormalizationMode mode,
                                                       params InputOutputColumnPair[] columns)
        {
            var env = CatalogUtils.GetEnvironment(catalog);

            env.CheckValue(columns, nameof(columns));
            return(new NormalizingEstimator(env, mode, InputOutputColumnPair.ConvertToValueTuples(columns)));
        }
Пример #2
0
 /// <summary>
 /// Normalize (rescale) several columns according to the specified <paramref name="mode"/>.
 /// </summary>
 /// <param name="catalog">The transform catalog</param>
 /// <param name="mode">The <see cref="NormalizingEstimator.NormalizationMode"/> used to map the old values to the new ones. </param>
 /// <param name="columns">The pairs of input and output columns.</param>
 /// <example>
 /// <format type="text/markdown">
 /// <![CDATA[
 /// [!code-csharp[Normalize](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/Normalizer.cs)]
 /// ]]>
 /// </format>
 /// </example>
 public static NormalizingEstimator Normalize(this TransformsCatalog catalog,
                                              NormalizingEstimator.NormalizationMode mode,
                                              params ColumnOptions[] columns)
 => new NormalizingEstimator(CatalogUtils.GetEnvironment(catalog), mode, ColumnOptions.ConvertToValueTuples(columns));
Пример #3
0
 /// <summary>
 /// Normalize (rescale) the column according to the specified <paramref name="mode"/>.
 /// </summary>
 /// <param name="catalog">The transform catalog</param>
 /// <param name="outputColumnName">Name of the column resulting from the transformation of <paramref name="inputColumnName"/>.</param>
 /// <param name="inputColumnName">Name of the column to transform. If set to <see langword="null"/>, the value of the <paramref name="outputColumnName"/> will be used as source.</param>
 /// <param name="mode">The <see cref="NormalizingEstimator.NormalizationMode"/> used to map the old values in the new scale. </param>
 /// <example>
 /// <format type="text/markdown">
 /// <![CDATA[
 /// [!code-csharp[Normalize](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/Normalizer.cs)]
 /// ]]>
 /// </format>
 /// </example>
 public static NormalizingEstimator Normalize(this TransformsCatalog catalog,
                                              string outputColumnName, string inputColumnName = null,
                                              NormalizingEstimator.NormalizationMode mode     = NormalizingEstimator.NormalizationMode.MinMax)
 => new NormalizingEstimator(CatalogUtils.GetEnvironment(catalog), outputColumnName, inputColumnName ?? outputColumnName, mode);