|
31 | 31 |
|
32 | 32 | namespace Microsoft.ML.Transforms
|
33 | 33 | {
|
34 |
| - /// <include file='doc.xml' path='doc/members/member[@name="ValueMappingEstimator"]/*' /> |
| 34 | + |
| 35 | + /// <summary> |
| 36 | + /// Estimator for <see cref="ValueMappingTransformer"/> creating a key-value map using the pairs of values in the input data |
| 37 | + /// <see cref="PrimitiveDataViewType"/> |
| 38 | + /// </summary> |
| 39 | + /// <remarks> |
| 40 | + /// <format type="text/markdown">< and [key](xref:Microsoft.ML.Data.KeyDataViewType) data types.| |
| 47 | + /// | Output column data type | Vector or primitive numeric, boolean, text, [System.DateTime](xref:System.DateTime) and [key](xref:Microsoft.ML.Data.KeyDataViewType) data types.| |
| 48 | + /// |
| 49 | + /// Given two sets of values, one serving as the key, and the other as the value of a Dictionary, the ValueMappingEstimator builds up this dictionary so that when given a specific key it will return a |
| 50 | + /// specific value.The ValueMappingEstimator supports keys and values of different [System.Type](xref:System.Type) to support different data types. |
| 51 | + /// Examples for using a ValueMappingEstimator are: |
| 52 | + /// * Converting a string value to a string value, this can be useful for grouping (i.e. 'cat', 'dog', 'horse' maps to 'mammals'). |
| 53 | + /// * Converting a string value to a integer value (i.e. converting the text description like quality to an numeric where 'good' maps to 1, 'poor' maps to 0. |
| 54 | + /// * Converting a integer value to a string value and have the string value represented as a [key](xref:Microsoft.ML.Data.KeyDataViewType) |
| 55 | + /// (i.e. convert zip codes to a state string value, which will generate a unique integer value that can be used as a label. |
| 56 | + /// |
| 57 | + /// Values can be repeated to allow for multiple keys to map to the same value, however keys can not be repeated. The mapping between keys and values |
| 58 | + /// can be specified either through lists, where the key list and value list must be the same size or can be done through an [System.IDataView](xref:Microsoft.ML.IDataView). |
| 59 | + /// ]]></format> |
| 60 | + /// </remarks> |
| 61 | + /// <seealso cref="ConversionsExtensionsCatalog.MapValue(TransformsCatalog.ConversionTransforms, string, IDataView, DataViewSchema.Column, DataViewSchema.Column, string)"/> |
35 | 62 | public class ValueMappingEstimator : TrivialEstimator<ValueMappingTransformer>
|
36 | 63 | {
|
37 | 64 | private readonly (string outputColumnName, string inputColumnName)[] _columns;
|
@@ -101,9 +128,37 @@ public sealed override SchemaShape GetOutputSchema(SchemaShape inputSchema)
|
101 | 128 | }
|
102 | 129 | }
|
103 | 130 |
|
104 |
| - /// <include file='doc.xml' path='doc/members/member[@name="ValueMappingEstimator"]/*' /> |
| 131 | + /// <summary> |
| 132 | + /// Estimator for <see cref="ValueMappingTransformer"/> creating a key-value map using the pairs of values in the input data |
| 133 | + /// <see cref="PrimitiveDataViewType"/> |
| 134 | + /// </summary> |
| 135 | + /// <remarks> |
| 136 | + /// <format type="text/markdown">< and [key](xref:Microsoft.ML.Data.KeyDataViewType) data types.| |
| 143 | + /// | Output column data type | Vector or primitive numeric, boolean, text, [System.DateTime](xref:System.DateTime) and [key](xref:Microsoft.ML.Data.KeyDataViewType) data types.| |
| 144 | + /// |
| 145 | + /// Given two sets of values, one serving as the key, and the other as the value of a Dictionary, the ValueMappingEstimator builds up this dictionary so that when given a specific key it will return a |
| 146 | + /// specific value.The ValueMappingEstimator supports keys and values of different [System.Type](xref:System.Type) to support different data types. |
| 147 | + /// Examples for using a ValueMappingEstimator are: |
| 148 | + /// * Converting a string value to a string value, this can be useful for grouping (i.e. 'cat', 'dog', 'horse' maps to 'mammals'). |
| 149 | + /// * Converting a string value to a integer value (i.e. converting the text description like quality to an numeric where 'good' maps to 1, 'poor' maps to 0. |
| 150 | + /// * Converting a integer value to a string value and have the string value represented as a [key](xref:Microsoft.ML.Data.KeyDataViewType) |
| 151 | + /// (i.e. convert zip codes to a state string value, which will generate a unique integer value that can be used as a label. |
| 152 | + /// |
| 153 | + /// Values can be repeated to allow for multiple keys to map to the same value, however keys can not be repeated. The mapping between keys and values |
| 154 | + /// can be specified either through lists, where the key list and value list must be the same size or can be done through an [System.IDataView](xref:Microsoft.ML.IDataView). |
| 155 | + /// ]]></format> |
| 156 | + /// </remarks> |
105 | 157 | /// <typeparam name="TKey">Specifies the key type.</typeparam>
|
106 | 158 | /// <typeparam name="TValue">Specifies the value type.</typeparam>
|
| 159 | + /// <seealso cref="ConversionsExtensionsCatalog.MapValue{TInputType, TOutputType}(TransformsCatalog.ConversionTransforms, IEnumerable{KeyValuePair{TInputType, TOutputType}}, InputOutputColumnPair[])"/> |
| 160 | + /// <seealso cref="ConversionsExtensionsCatalog.MapValue{TInputType, TOutputType}(TransformsCatalog.ConversionTransforms, IEnumerable{KeyValuePair{TInputType, TOutputType[]}}, InputOutputColumnPair[])"/> |
| 161 | + /// <seealso cref="ConversionsExtensionsCatalog.MapValue{TInputType, TOutputType}(TransformsCatalog.ConversionTransforms, string, IEnumerable{KeyValuePair{TInputType, TOutputType}}, string, bool)"/> |
107 | 162 | public sealed class ValueMappingEstimator<TKey, TValue> : ValueMappingEstimator
|
108 | 163 | {
|
109 | 164 | /// <summary>
|
@@ -283,7 +338,9 @@ internal static IDataView CreateDataView<TKey, TValue>(IHostEnvironment env,
|
283 | 338 | }
|
284 | 339 | }
|
285 | 340 |
|
286 |
| - /// <include file='doc.xml' path='doc/members/member[@name="ValueMappingEstimator"]/*' /> |
| 341 | + /// <summary> |
| 342 | + /// <see cref="ITransformer"/> resulting from fitting a <see cref="ValueMappingEstimator"/>. |
| 343 | + /// </summary> |
287 | 344 | public class ValueMappingTransformer : OneToOneTransformerBase
|
288 | 345 | {
|
289 | 346 | internal const string Summary = "Maps text values columns to new columns using a map dataset.";
|
|
0 commit comments