Skip to content

Commit 401b86b

Browse files
committed
fixed some renamings
1 parent 51fee4b commit 401b86b

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/Microsoft.ML.Transforms/CountFeatureSelection.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,18 @@ internal static IDataTransform Create(IHostEnvironment env, Options options, IDa
183183
host.CheckUserArg(Utils.Size(options.Columns) > 0, nameof(options.Columns));
184184
host.CheckUserArg(options.Count > 0, nameof(options.Count));
185185

186-
var columnOptionss = options.Columns.Select(inColName => new ColumnOptions(inColName, minCount: options.Count)).ToArray();
186+
var columnOptions = options.Columns.Select(inColName => new ColumnOptions(inColName, minCount: options.Count)).ToArray();
187187

188-
return new CountFeatureSelectingEstimator(env, columnOptionss).Fit(input).Transform(input) as IDataTransform;
188+
return new CountFeatureSelectingEstimator(env, columnOptions).Fit(input).Transform(input) as IDataTransform;
189189
}
190190

191-
private static void CreateDropAndCopyColumns(ColumnOptions[] columnOptionss, int size, long[][] scores,
191+
private static void CreateDropAndCopyColumns(ColumnOptions[] columnOptions, int size, long[][] scores,
192192
out int[] selectedCount, out SlotsDroppingTransformer.ColumnOptions[] dropSlotsColumns, out (string outputColumnName, string inputColumnName)[] copyColumnsPairs)
193193
{
194194
Contracts.Assert(size > 0);
195195
Contracts.Assert(Utils.Size(scores) == size);
196-
Contracts.AssertValue(columnOptionss);
197-
Contracts.Assert(Utils.Size(columnOptionss) == size);
196+
Contracts.AssertValue(columnOptions);
197+
Contracts.Assert(Utils.Size(columnOptions) == size);
198198

199199
selectedCount = new int[scores.Length];
200200
var dropSlotsCols = new List<SlotsDroppingTransformer.ColumnOptions>();
@@ -206,11 +206,11 @@ private static void CreateDropAndCopyColumns(ColumnOptions[] columnOptionss, int
206206
selectedCount[i] = 0;
207207
for (int j = 0; j < score.Length; j++)
208208
{
209-
if (score[j] < columnOptionss[i].MinCount)
209+
if (score[j] < columnOptions[i].MinCount)
210210
{
211211
// Adjacent slots are combined into a single range.
212212
int min = j;
213-
while (j < score.Length && score[j] < columnOptionss[i].MinCount)
213+
while (j < score.Length && score[j] < columnOptions[i].MinCount)
214214
j++;
215215
int max = j - 1;
216216
slots.Add((min, max));
@@ -221,9 +221,9 @@ private static void CreateDropAndCopyColumns(ColumnOptions[] columnOptionss, int
221221
selectedCount[i]++;
222222
}
223223
if (slots.Count <= 0)
224-
copyCols.Add((columnOptionss[i].Name, columnOptionss[i].InputColumnName));
224+
copyCols.Add((columnOptions[i].Name, columnOptions[i].InputColumnName));
225225
else
226-
dropSlotsCols.Add(new SlotsDroppingTransformer.ColumnOptions(columnOptionss[i].Name, columnOptionss[i].InputColumnName, slots.ToArray()));
226+
dropSlotsCols.Add(new SlotsDroppingTransformer.ColumnOptions(columnOptions[i].Name, columnOptions[i].InputColumnName, slots.ToArray()));
227227
}
228228
dropSlotsColumns = dropSlotsCols.ToArray();
229229
copyColumnsPairs = copyCols.ToArray();

src/Microsoft.ML.Transforms/HashJoiningTransform.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ internal bool TryUnparse(StringBuilder sb)
106106
}
107107
}
108108

109-
public sealed class ColumnOptionsEx
109+
public sealed class ColumnOptions
110110
{
111111
// Either VBuffer<Key<U4>> or a single Key<U4>.
112112
// Note that if CustomSlotMap contains only one array, the output type of the transform will a single Key<U4>.
@@ -124,7 +124,7 @@ public int OutputValueCount
124124
get { return OutputColumnType.GetValueCount(); }
125125
}
126126

127-
public ColumnOptionsEx(int[][] slotMap, int hashBits, uint hashSeed, bool ordered)
127+
public ColumnOptions(int[][] slotMap, int hashBits, uint hashSeed, bool ordered)
128128
{
129129
Contracts.CheckValueOrNull(slotMap);
130130
Contracts.Check(NumBitsMin <= hashBits && hashBits < NumBitsLim);
@@ -173,7 +173,7 @@ private static VersionInfo GetVersionInfo()
173173
loaderAssemblyName: typeof(HashJoiningTransform).Assembly.FullName);
174174
}
175175

176-
private readonly ColumnOptionsEx[] _exes;
176+
private readonly ColumnOptions[] _exes;
177177

178178
/// <summary>
179179
/// Initializes a new instance of <see cref="HashJoiningTransform"/>.
@@ -204,7 +204,7 @@ public HashJoiningTransform(IHostEnvironment env, Arguments args, IDataView inpu
204204
if (args.HashBits < NumBitsMin || args.HashBits >= NumBitsLim)
205205
throw Host.ExceptUserArg(nameof(args.HashBits), "hashBits should be between {0} and {1} inclusive", NumBitsMin, NumBitsLim - 1);
206206

207-
_exes = new ColumnOptionsEx[Infos.Length];
207+
_exes = new ColumnOptions[Infos.Length];
208208
for (int i = 0; i < Infos.Length; i++)
209209
{
210210
var hashBits = args.Columns[i].HashBits ?? args.HashBits;
@@ -238,7 +238,7 @@ private HashJoiningTransform(IHost host, ModelLoadContext ctx, IDataView input)
238238

239239
Host.AssertNonEmpty(Infos);
240240

241-
_exes = new ColumnOptionsEx[Infos.Length];
241+
_exes = new ColumnOptions[Infos.Length];
242242
for (int i = 0; i < Infos.Length; i++)
243243
{
244244
int hashBits = ctx.Reader.ReadInt32();
@@ -268,7 +268,7 @@ private HashJoiningTransform(IHost host, ModelLoadContext ctx, IDataView input)
268268
}
269269
}
270270

271-
_exes[i] = new ColumnOptionsEx(slotMap, hashBits, hashSeed, ordered);
271+
_exes[i] = new ColumnOptions(slotMap, hashBits, hashSeed, ordered);
272272
}
273273

274274
SetMetadata();
@@ -327,7 +327,7 @@ private protected override void SaveModel(ModelSaveContext ctx)
327327
}
328328
}
329329

330-
private ColumnOptionsEx CreateColumnOptionsEx(bool join, string customSlotMap, int hashBits, uint hashSeed, bool ordered, ColInfo colInfo)
330+
private ColumnOptions CreateColumnOptionsEx(bool join, string customSlotMap, int hashBits, uint hashSeed, bool ordered, ColInfo colInfo)
331331
{
332332
int[][] slotMap = null;
333333
if (colInfo.TypeSrc is VectorType vectorType)
@@ -340,7 +340,7 @@ private ColumnOptionsEx CreateColumnOptionsEx(bool join, string customSlotMap, i
340340
Host.Assert(Utils.Size(slotMap) >= 1);
341341
}
342342

343-
return new ColumnOptionsEx(slotMap, hashBits, hashSeed, ordered);
343+
return new ColumnOptions(slotMap, hashBits, hashSeed, ordered);
344344
}
345345

346346
private int[][] CompileSlotMap(string slotMapString, int srcSlotCount)

0 commit comments

Comments
 (0)