|
12 | 12 | using Microsoft.ML.Internal.Utilities;
|
13 | 13 | using Microsoft.ML.Model;
|
14 | 14 |
|
15 |
| -[assembly: LoadableClass(typeof(ChooseColumnsByIndexTransform), typeof(ChooseColumnsByIndexTransform.Arguments), typeof(SignatureDataTransform), |
| 15 | +[assembly: LoadableClass(typeof(ChooseColumnsByIndexTransform), typeof(ChooseColumnsByIndexTransform.Options), typeof(SignatureDataTransform), |
16 | 16 | "", "ChooseColumnsByIndexTransform", "ChooseColumnsByIndex")]
|
17 | 17 |
|
18 | 18 | [assembly: LoadableClass(typeof(ChooseColumnsByIndexTransform), null, typeof(SignatureLoadDataTransform),
|
19 | 19 | "", ChooseColumnsByIndexTransform.LoaderSignature, ChooseColumnsByIndexTransform.LoaderSignatureOld)]
|
20 | 20 |
|
21 | 21 | namespace Microsoft.ML.Data
|
22 | 22 | {
|
23 |
| - public sealed class ChooseColumnsByIndexTransform : RowToRowTransformBase |
| 23 | + [BestFriend] |
| 24 | + internal sealed class ChooseColumnsByIndexTransform : RowToRowTransformBase |
24 | 25 | {
|
25 |
| - public sealed class Arguments |
| 26 | + public sealed class Options |
26 | 27 | {
|
27 | 28 | [Argument(ArgumentType.Multiple | ArgumentType.Required, HelpText = "Column indices to select", Name = "Index", ShortName = "ind")]
|
28 | 29 | public int[] Indices;
|
@@ -59,17 +60,17 @@ private sealed class Bindings
|
59 | 60 | // This transform's output schema.
|
60 | 61 | internal Schema OutputSchema { get; }
|
61 | 62 |
|
62 |
| - internal Bindings(Arguments args, Schema sourceSchema) |
| 63 | + internal Bindings(Options options, Schema sourceSchema) |
63 | 64 | {
|
64 |
| - Contracts.AssertValue(args); |
| 65 | + Contracts.AssertValue(options); |
65 | 66 | Contracts.AssertValue(sourceSchema);
|
66 | 67 |
|
67 | 68 | _sourceSchema = sourceSchema;
|
68 | 69 |
|
69 | 70 | // Store user-specified arguments as the major state of this transform. Only the major states will
|
70 | 71 | // be saved and all other attributes can be reconstructed from them.
|
71 |
| - _drop = args.Drop; |
72 |
| - _selectedColumnIndexes = args.Indices; |
| 72 | + _drop = options.Drop; |
| 73 | + _selectedColumnIndexes = options.Indices; |
73 | 74 |
|
74 | 75 | // Compute actually used attributes in runtime from those major states.
|
75 | 76 | ComputeSources(_drop, _selectedColumnIndexes, _sourceSchema, out _sources);
|
@@ -194,12 +195,12 @@ private static VersionInfo GetVersionInfo()
|
194 | 195 | /// <summary>
|
195 | 196 | /// Public constructor corresponding to SignatureDataTransform.
|
196 | 197 | /// </summary>
|
197 |
| - public ChooseColumnsByIndexTransform(IHostEnvironment env, Arguments args, IDataView input) |
| 198 | + public ChooseColumnsByIndexTransform(IHostEnvironment env, Options options, IDataView input) |
198 | 199 | : base(env, RegistrationName, input)
|
199 | 200 | {
|
200 |
| - Host.CheckValue(args, nameof(args)); |
| 201 | + Host.CheckValue(options, nameof(options)); |
201 | 202 |
|
202 |
| - _bindings = new Bindings(args, Source.Schema); |
| 203 | + _bindings = new Bindings(options, Source.Schema); |
203 | 204 | }
|
204 | 205 |
|
205 | 206 | private ChooseColumnsByIndexTransform(IHost host, ModelLoadContext ctx, IDataView input)
|
|
0 commit comments