/// <include file='doc.xml' path='doc/members/member[@name="ImageGrayscalingEstimator"]/*' />
 /// <param name="catalog">The transform's catalog.</param>
 /// <param name="columns">Specifies the names of the input columns for the transformation, and their respective output column names.</param>
 /// <example>
 /// <format type="text/markdown">
 /// <![CDATA[
 ///  [!code-csharp[ConvertToGrayscale](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/ImageAnalytics/ConvertToGrayscale.cs)]
 /// ]]></format>
 /// </example>
 public static ImageGrayscalingEstimator ConvertToGrayscale(this TransformsCatalog catalog, params ColumnOptions[] columns)
 => new ImageGrayscalingEstimator(CatalogUtils.GetEnvironment(catalog), ColumnOptions.ConvertToValueTuples(columns));
 /// <summary>
 /// Loads the images from the <see cref="ImageLoadingTransformer.ImageFolder" /> into memory.
 /// </summary>
 /// <remarks>
 /// The image get loaded in memory as a <see cref="System.Drawing.Bitmap" /> type.
 /// Loading is the first step of almost every pipeline that does image processing, and further analysis on images.
 /// The images to load need to be in the formats supported by <see cref = "System.Drawing.Bitmap" />.
 /// For end-to-end image processing pipelines, and scenarios in your applications, see the
 /// <a href="https://github.com/dotnet/machinelearning-samples/tree/master/samples/csharp/getting-started"> examples in the machinelearning-samples github repository.</a>
 /// <seealso cref = "ImageEstimatorsCatalog" />
 /// </remarks>
 /// <param name="catalog">The transform's catalog.</param>
 /// <param name="imageFolder">The images folder.</param>
 /// <param name="columns">Specifies the names of the input columns for the transformation, and their respective output column names.</param>
 /// <example>
 /// <format type="text/markdown">
 /// <![CDATA[
 ///  [!code-csharp[LoadImages](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/ImageAnalytics/LoadImages.cs)]
 /// ]]></format>
 /// </example>
 public static ImageLoadingEstimator LoadImages(this TransformsCatalog catalog, string imageFolder, params ColumnOptions[] columns)
 => new ImageLoadingEstimator(CatalogUtils.GetEnvironment(catalog), imageFolder, ColumnOptions.ConvertToValueTuples(columns));
Ejemplo n.º 3
0
 /// <summary>
 ///  Convert the key types back to binary vector.
 /// </summary>
 /// <param name="catalog">The categorical transform's catalog.</param>
 /// <param name="columns">The input column.</param>
 public static KeyToBinaryVectorMappingEstimator MapKeyToBinaryVector(this TransformsCatalog.ConversionTransforms catalog,
                                                                      params ColumnOptions[] columns)
 => new KeyToBinaryVectorMappingEstimator(CatalogUtils.GetEnvironment(catalog), ColumnOptions.ConvertToValueTuples(columns));
Ejemplo n.º 4
0
 /// <summary>
 /// <see cref="ValueMappingEstimator"/>
 /// </summary>
 /// <param name="catalog">The conversion transform's catalog</param>
 /// <param name="lookupMap">An instance of <see cref="IDataView"/> that contains the key and value columns.</param>
 /// <param name="keyColumnName">Name of the key column in <paramref name="lookupMap"/>.</param>
 /// <param name="valueColumnName">Name of the value column in <paramref name="lookupMap"/>.</param>
 /// <param name="columns">The columns to apply this transform on.</param>
 /// <returns>A instance of the ValueMappingEstimator</returns>
 /// <example>
 /// <format type="text/markdown">
 /// <![CDATA[
 ///  [!code-csharp[ValueMappingEstimator](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMapping.cs)]
 ///  [!code-csharp[ValueMappingEstimator](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingStringToKeyType.cs)]
 ///  [!code-csharp[ValueMappingEstimator](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingFloatToString.cs)]
 ///  [!code-csharp[ValueMappingEstimator](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingStringToArray.cs)]
 /// ]]></format>
 /// </example>
 public static ValueMappingEstimator MapValue(
     this TransformsCatalog.ConversionTransforms catalog,
     IDataView lookupMap, string keyColumnName, string valueColumnName, params ColumnOptions[] columns)
 => new ValueMappingEstimator(CatalogUtils.GetEnvironment(catalog), lookupMap, keyColumnName, valueColumnName,
                              ColumnOptions.ConvertToValueTuples(columns));
Ejemplo n.º 5
0
 /// <summary>
 /// <see cref="ValueMappingEstimator"/>
 /// </summary>
 /// <typeparam name="TInputType">The key type.</typeparam>
 /// <typeparam name="TOutputType">The value type.</typeparam>
 /// <param name="catalog">The conversion transform's catalog</param>
 /// <param name="keys">The list of keys to use for the mapping. The mapping is 1-1 with <paramref name="values"/>. The length of this list must be the same length as <paramref name="values"/> and
 /// cannot contain duplicate keys.</param>
 /// <param name="values">The list of values to pair with the keys for the mapping. The length of this list must be equal to the same length as <paramref name="keys"/>.</param>
 /// <param name="columns">The columns to apply this transform on.</param>
 /// <returns>An instance of the <see cref="ValueMappingEstimator"/></returns>
 /// <example>
 /// <format type="text/markdown">
 /// <![CDATA[
 ///  [!code-csharp[ValueMappingEstimator](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMapping.cs)]
 ///  [!code-csharp[ValueMappingEstimator](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingStringToKeyType.cs)]
 ///  [!code-csharp[ValueMappingEstimator](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingFloatToString.cs)]
 ///  [!code-csharp[ValueMappingEstimator](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/ValueMappingStringToArray.cs)]
 /// ]]></format>
 /// </example>
 public static ValueMappingEstimator <TInputType, TOutputType> MapValue <TInputType, TOutputType>(
     this TransformsCatalog.ConversionTransforms catalog,
     IEnumerable <TInputType> keys,
     IEnumerable <TOutputType> values,
     params ColumnOptions[] columns)
 => new ValueMappingEstimator <TInputType, TOutputType>(CatalogUtils.GetEnvironment(catalog), keys, values, ColumnOptions.ConvertToValueTuples(columns));
Ejemplo n.º 6
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));
 internal static MissingValueIndicatorEstimator IndicateMissingValues(this TransformsCatalog catalog,
                                                                      params ColumnOptions[] columns)
 => new MissingValueIndicatorEstimator(CatalogUtils.GetEnvironment(catalog), ColumnOptions.ConvertToValueTuples(columns));