-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Multiple feature columns in FFM #2205
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
Conversation
Field1 = new float[_simpleBinaryClassSampleFeatureLength], | ||
Field2 = new float[_simpleBinaryClassSampleFeatureLength] }; | ||
// Fill feature vector according the assigned label. | ||
for (int j = 0; j < 10; ++j) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10 [](start = 36, length = 2)
_simpleBinaryClassSampleFeatureLength ? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ | ||
public bool Label; | ||
|
||
[VectorType(_simpleBinaryClassSampleFeatureLength)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VectorType [](start = 13, length = 10)
am curious - is this attribute required ? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
// Customized the field names. | ||
ffmArgs.FeatureColumn = nameof(DatasetUtils.FfmExample.Field0); // First field. | ||
ffmArgs.ExtraFeatureColumns = new[]{ nameof(DatasetUtils.FfmExample.Field1), nameof(DatasetUtils.FfmExample.Field2) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ExtraFeatureColumns [](start = 20, length = 19)
this looks slightly odd . isn't it ?
am curious -- why move away from the convention used in iteration #2, where we were re-defining FeatureColumn
as a string[]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Framework of generating entry points generates the hidden field (old feature column name) and therefore we have two fields with the same name and an error.
In reply to: 250309618 [](ancestors = 250309618)
We do not want this exposed especially since it holds content from Refers to: src/Microsoft.ML.StandardLearners/FactorizationMachine/FactorizationMachineTrainer.cs:93 in e454a19. [](commit_id = e454a19, deletion_comment = False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FeatureColumns[0] = new SchemaShape.Column(args.FeatureColumn, SchemaShape.Column.VectorKind.Vector, NumberType.R4, false); | ||
|
||
// Add 2nd, 3rd, and other fields from a FFM-specific argument, args.ExtraFeatureColumns. | ||
for (int i = 0; args.ExtraFeatureColumns != null && i < args.ExtraFeatureColumns.Length; i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (int i = 0; args.ExtraFeatureColumns != null && i < args.ExtraFeatureColumns.Length; i++) [](start = 12, length = 93)
could this be a simple foreach loop instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it can't. The array size is pre-defined and I prefer not to create an intermediate list just for calling Add
.
In reply to: 250316802 [](ancestors = 250316802)
It's not related to In reply to: 456913047 [](ancestors = 456913047) Refers to: src/Microsoft.ML.StandardLearners/FactorizationMachine/FactorizationMachineTrainer.cs:93 in e454a19. [](commit_id = e454a19, deletion_comment = False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR somehow provides a solution to #2179 regarding FFM via allowing multiple feature column names in advanced trainer arguments.
Strategy: adding one extra field to
Arguments
of FFM; that filed is