Skip to content

CherryPicking #3316 - ColumCopying documentation #3348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/Microsoft.ML.Data/Transforms/ColumnCopying.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,26 @@
namespace Microsoft.ML.Transforms
{
/// <summary>
/// <see cref="ColumnCopyingEstimator"/> copies the input column to another column named as specified in the parameters of the transformation.
/// <see cref="IEstimator{TTransformer}"/> for the <see cref="ColumnCopyingTransformer"/>.
/// </summary>
/// <remarks>
/// <format type="text/markdown"><![CDATA[
///
/// ### Estimator Characteristics
/// | | |
/// | -- | -- |
/// | Does this estimator need to look at the data to train its parameters? | No |
/// | Input column data type | Any |
/// | Output column data type | The same as the data type in the input column |
///
/// The resulting <see cref="ColumnCopyingTransformer"/> creates a new column, named as specified in the output column name parameters, and
/// copies the data from the input column to this new column.
/// See the See Also section for links to examples of the usage.
/// ]]>
/// </format>
/// </remarks>
/// <seealso cref="TransformExtensionsCatalog.CopyColumns(TransformsCatalog, InputOutputColumnPair[])" />
/// <seealso cref="TransformExtensionsCatalog.CopyColumns(TransformsCatalog, string, string)" />
public sealed class ColumnCopyingEstimator : TrivialEstimator<ColumnCopyingTransformer>
{
[BestFriend]
Expand Down Expand Up @@ -67,6 +85,9 @@ public override SchemaShape GetOutputSchema(SchemaShape inputSchema)
}
}

/// <summary>
/// <see cref="ITransformer"/> resulting from fitting an <see cref="ColumnCopyingEstimator"/>.
/// </summary>
public sealed class ColumnCopyingTransformer : OneToOneTransformerBase
{
[BestFriend]
Expand Down
18 changes: 11 additions & 7 deletions src/Microsoft.ML.Data/Transforms/ExtensionsCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ internal static IReadOnlyList<InputOutputColumnPair> ConvertFromValueTuples((str
public static class TransformExtensionsCatalog
{
/// <summary>
/// Copies the input column to another column named as specified in <paramref name="outputColumnName"/>.
/// Create a <see cref="ColumnCopyingEstimator"/>, which copies the data from the column specified in <paramref name="inputColumnName"/>
/// to a new column: <paramref name="outputColumnName"/>.
/// </summary>
/// <param name="catalog">The transform's catalog.</param>
/// <param name="outputColumnName">Name of the column resulting from the transformation of <paramref name="inputColumnName"/>.</param>
/// <param name="inputColumnName">Name of the columns to transform.</param>
/// <param name="outputColumnName">Name of the column resulting from the transformation of <paramref name="inputColumnName"/>.
/// This column's data type will be the same as that of the input column.</param>
/// <param name="inputColumnName">Name of the column to copy the data from.
/// This estimator operates over any data type.</param>
/// <example>
/// <format type="text/markdown">
/// <![CDATA[
Expand All @@ -67,11 +70,12 @@ public static ColumnCopyingEstimator CopyColumns(this TransformsCatalog catalog,
=> new ColumnCopyingEstimator(CatalogUtils.GetEnvironment(catalog), outputColumnName, inputColumnName);

/// <summary>
/// Copies the input column, name specified in the first item of the tuple,
/// to another column, named as specified in the second item of the tuple.
/// Create a <see cref="ColumnCopyingEstimator"/>, which copies the data from the column specified in <see cref="InputOutputColumnPair.InputColumnName" />
/// to a new column: <see cref="InputOutputColumnPair.OutputColumnName" />.
/// </summary>
/// <param name="catalog">The transform's catalog</param>
/// <param name="columns">The pairs of input and output columns.</param>
/// <remarks>This transform can operate over several columns.</remarks>
/// <param name="catalog">The transform's catalog.</param>
/// <param name="columns">The pairs of input and output columns. This estimator operates over any data type.</param>
/// <example>
/// <format type="text/markdown">
/// <![CDATA[
Expand Down