Skip to content

Commit 0b475a0

Browse files
committed
Fix tests again
1 parent 64710e7 commit 0b475a0

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

src/Microsoft.ML.StandardLearners/FactorizationMachine/FactorizationMachineTrainer.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,6 @@ public sealed class FieldAwareFactorizationMachineTrainer : TrainerBase<FieldAwa
4242

4343
public sealed class Arguments : LearnerInputBaseWithWeight
4444
{
45-
/// <summary>
46-
/// Extra feature column names. The column named <see cref="LearnerInputBase.FeatureColumn"/> stores features from the first field.
47-
/// The i-th string in <see cref="ExtraFeatureColumns"/> stores the name of the (i+1)-th field's feature column.
48-
/// </summary>
49-
[Argument(ArgumentType.AtMostOnce, HelpText = "Extra columns to use for feature vectors. The i-th specified string denotes the column containing features form the (i+1)-th field." +
50-
" Note that the first field is specified by \"feat\" instead of \"exfeat\".",
51-
ShortName = "exfeat", SortOrder = 2)]
52-
public string[] ExtraFeatureColumns = { };
53-
5445
[Argument(ArgumentType.AtMostOnce, HelpText = "Initial learning rate", ShortName = "lr", SortOrder = 1)]
5546
[TlcModule.SweepableFloatParam(0.001f, 1.0f, isLogScale: true)]
5647
public float LearningRate = (float)0.1;
@@ -74,6 +65,15 @@ public sealed class Arguments : LearnerInputBaseWithWeight
7465
[Argument(ArgumentType.AtMostOnce, HelpText = "Whether to normalize the input vectors so that the concatenation of all fields' feature vectors is unit-length", ShortName = "norm", SortOrder = 6)]
7566
public bool Norm = true;
7667

68+
/// <summary>
69+
/// Extra feature column names. The column named <see cref="LearnerInputBase.FeatureColumn"/> stores features from the first field.
70+
/// The i-th string in <see cref="ExtraFeatureColumns"/> stores the name of the (i+1)-th field's feature column.
71+
/// </summary>
72+
[Argument(ArgumentType.Multiple, HelpText = "Extra columns to use for feature vectors. The i-th specified string denotes the column containing features form the (i+1)-th field." +
73+
" Note that the first field is specified by \"feat\" instead of \"exfeat\".",
74+
ShortName = "exfeat", SortOrder = 7)]
75+
public string[] ExtraFeatureColumns;
76+
7777
[Argument(ArgumentType.AtMostOnce, HelpText = "Whether to shuffle for each training iteration", ShortName = "shuf", SortOrder = 90)]
7878
public bool Shuffle = true;
7979

@@ -139,7 +139,7 @@ public FieldAwareFactorizationMachineTrainer(IHostEnvironment env, Arguments arg
139139
FeatureColumns[0] = new SchemaShape.Column(args.FeatureColumn, SchemaShape.Column.VectorKind.Vector, NumberType.R4, false);
140140

141141
// Add 2nd, 3rd, and other fields from a FFM-specific argument, args.ExtraFeatureColumns.
142-
for (int i = 0; i < args.ExtraFeatureColumns.Length; i++)
142+
for (int i = 0; args.ExtraFeatureColumns != null && i < args.ExtraFeatureColumns.Length; i++)
143143
FeatureColumns[i + 1] = new SchemaShape.Column(args.ExtraFeatureColumns[i], SchemaShape.Column.VectorKind.Vector, NumberType.R4, false);
144144

145145
LabelColumn = new SchemaShape.Column(args.LabelColumn, SchemaShape.Column.VectorKind.Scalar, BoolType.Instance, false);
@@ -150,7 +150,7 @@ public FieldAwareFactorizationMachineTrainer(IHostEnvironment env, Arguments arg
150150
/// Initializing a new instance of <see cref="FieldAwareFactorizationMachineTrainer"/>.
151151
/// </summary>
152152
/// <param name="env">The private instance of <see cref="IHostEnvironment"/>.</param>
153-
/// <param name="featureColumns">The name of column hosting the features.</param>
153+
/// <param name="featureColumns">The name of column hosting the features. The i-th element stores feature column of the i-th field.</param>
154154
/// <param name="labelColumn">The name of the label column.</param>
155155
/// <param name="advancedSettings">A delegate to apply all the advanced arguments to the algorithm.</param>
156156
/// <param name="weights">The name of the optional weights' column.</param>

test/BaselineOutput/Common/EntryPoints/core_manifest.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10146,21 +10146,6 @@
1014610146
"SortOrder": 1.0,
1014710147
"IsNullable": false
1014810148
},
10149-
{
10150-
"Name": "ExtraFeatureColumns",
10151-
"Type": {
10152-
"Kind": "Array",
10153-
"ItemType": "String"
10154-
},
10155-
"Desc": "Extra columns to use for feature vectors. The i-th specified string denotes the column containing features form the (i+1)-th field. Note that the first field is specified by \"feat\" instead of \"exfeat\".",
10156-
"Aliases": [
10157-
"exfeat"
10158-
],
10159-
"Required": false,
10160-
"SortOrder": 2.0,
10161-
"IsNullable": false,
10162-
"Default": []
10163-
},
1016410149
{
1016510150
"Name": "Iters",
1016610151
"Type": "Int",
@@ -10319,6 +10304,21 @@
1031910304
"IsNullable": false,
1032010305
"Default": "Auto"
1032110306
},
10307+
{
10308+
"Name": "ExtraFeatureColumns",
10309+
"Type": {
10310+
"Kind": "Array",
10311+
"ItemType": "String"
10312+
},
10313+
"Desc": "Extra columns to use for feature vectors. The i-th specified string denotes the column containing features form the (i+1)-th field. Note that the first field is specified by \"feat\" instead of \"exfeat\".",
10314+
"Aliases": [
10315+
"exfeat"
10316+
],
10317+
"Required": false,
10318+
"SortOrder": 7.0,
10319+
"IsNullable": false,
10320+
"Default": null
10321+
},
1032210322
{
1032310323
"Name": "Shuffle",
1032410324
"Type": "Bool",

0 commit comments

Comments
 (0)