From 1da015f8f5d385a1589b0b8cb24d0c3621730380 Mon Sep 17 00:00:00 2001 From: Ivan Matantsev Date: Tue, 5 Mar 2019 14:30:30 -0800 Subject: [PATCH] Scrub scrub --- .../Transforms/ColumnConcatenatingEstimator.cs | 2 +- .../Transforms/ColumnConcatenatingTransformer.cs | 4 +--- .../Transforms/ColumnCopying.cs | 2 +- .../Transforms/ColumnSelecting.cs | 10 ++++------ .../Transforms/ExtensionsCatalog.cs | 16 ++++++++-------- 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/Microsoft.ML.Data/Transforms/ColumnConcatenatingEstimator.cs b/src/Microsoft.ML.Data/Transforms/ColumnConcatenatingEstimator.cs index da854c4541..cbd747f2d0 100644 --- a/src/Microsoft.ML.Data/Transforms/ColumnConcatenatingEstimator.cs +++ b/src/Microsoft.ML.Data/Transforms/ColumnConcatenatingEstimator.cs @@ -28,7 +28,7 @@ public sealed class ColumnConcatenatingEstimator : IEstimator /// The names of the output and input column pairs for the transformation. /// - public IReadOnlyCollection<(string outputColumnName, string[] inputColumnNames)> Columns + internal IReadOnlyCollection<(string outputColumnName, string[] inputColumnNames)> Columns => _columns.Select(col => (outputColumnName: col.Name, inputColumnNames: col.Sources.Select(source => source.name).ToArray())).ToArray().AsReadOnly(); /// diff --git a/src/Microsoft.ML.Data/Transforms/ColumnCopying.cs b/src/Microsoft.ML.Data/Transforms/ColumnCopying.cs index b633ab90d3..98f57bd7df 100644 --- a/src/Microsoft.ML.Data/Transforms/ColumnCopying.cs +++ b/src/Microsoft.ML.Data/Transforms/ColumnCopying.cs @@ -80,7 +80,7 @@ public sealed class ColumnCopyingTransformer : OneToOneTransformerBase /// /// Names of output and input column pairs on which the transformation is applied. /// - public IReadOnlyCollection<(string outputColumnName, string inputColumnName)> Columns => ColumnPairs.AsReadOnly(); + internal IReadOnlyCollection<(string outputColumnName, string inputColumnName)> Columns => ColumnPairs.AsReadOnly(); private static VersionInfo GetVersionInfo() { diff --git a/src/Microsoft.ML.Data/Transforms/ColumnSelecting.cs b/src/Microsoft.ML.Data/Transforms/ColumnSelecting.cs index 32e88dcdec..a065507bac 100644 --- a/src/Microsoft.ML.Data/Transforms/ColumnSelecting.cs +++ b/src/Microsoft.ML.Data/Transforms/ColumnSelecting.cs @@ -9,9 +9,7 @@ using Microsoft.ML; using Microsoft.ML.CommandLine; using Microsoft.ML.Data; -using Microsoft.ML.EntryPoints; using Microsoft.ML.Internal.Utilities; -using Microsoft.ML.Model; using Microsoft.ML.Transforms; [assembly: LoadableClass(ColumnSelectingTransformer.Summary, typeof(IDataTransform), typeof(ColumnSelectingTransformer), @@ -140,12 +138,12 @@ public sealed class ColumnSelectingTransformer : ITransformer bool ITransformer.IsRowToRowMapper => true; - public IEnumerable SelectColumns => _selectedColumns.AsReadOnly(); + internal IEnumerable SelectColumns => _selectedColumns.AsReadOnly(); - public bool KeepColumns { get; } + internal bool KeepColumns { get; } - public bool KeepHidden { get; } - public bool IgnoreMissing { get; } + internal bool KeepHidden { get; } + internal bool IgnoreMissing { get; } private static VersionInfo GetVersionInfo() { diff --git a/src/Microsoft.ML.Data/Transforms/ExtensionsCatalog.cs b/src/Microsoft.ML.Data/Transforms/ExtensionsCatalog.cs index 976f787c20..df6e4a4231 100644 --- a/src/Microsoft.ML.Data/Transforms/ExtensionsCatalog.cs +++ b/src/Microsoft.ML.Data/Transforms/ExtensionsCatalog.cs @@ -97,7 +97,7 @@ public static ColumnConcatenatingEstimator Concatenate(this TransformsCatalog ca /// that you don't want to save, you can use to remove them from the schema. /// /// The transform's catalog. - /// The array of column names to drop. + /// The array of column names to drop. /// /// /// /// /// - public static ColumnSelectingEstimator DropColumns(this TransformsCatalog catalog, params string[] columnsToDrop) - => ColumnSelectingEstimator.DropColumns(CatalogUtils.GetEnvironment(catalog), columnsToDrop); + public static ColumnSelectingEstimator DropColumns(this TransformsCatalog catalog, params string[] columnNames) + => ColumnSelectingEstimator.DropColumns(CatalogUtils.GetEnvironment(catalog), columnNames); /// /// Select a list of columns to keep in a given . @@ -121,7 +121,7 @@ public static ColumnSelectingEstimator DropColumns(this TransformsCatalog catalo /// /// /// The transform's catalog. - /// The array of column names to keep. + /// The array of column names to keep. /// If will keep hidden columns and will remove hidden columns. /// /// @@ -131,10 +131,10 @@ public static ColumnSelectingEstimator DropColumns(this TransformsCatalog catalo /// /// public static ColumnSelectingEstimator SelectColumns(this TransformsCatalog catalog, - string[] keepColumns, + string[] columnNames, bool keepHidden) => new ColumnSelectingEstimator(CatalogUtils.GetEnvironment(catalog), - keepColumns, null, keepHidden, ColumnSelectingEstimator.Defaults.IgnoreMissing); + columnNames, null, keepHidden, ColumnSelectingEstimator.Defaults.IgnoreMissing); /// /// Select a list of columns to keep in a given . @@ -146,7 +146,7 @@ public static ColumnSelectingEstimator SelectColumns(this TransformsCatalog cata /// ]]> /// /// The transform's catalog. - /// The array of column names to keep. + /// The array of column names to keep. /// /// /// /// public static ColumnSelectingEstimator SelectColumns(this TransformsCatalog catalog, - params string[] keepColumns) => catalog.SelectColumns(keepColumns, false); + params string[] columnNames) => catalog.SelectColumns(columnNames, false); } }