Skip to content

Modify API for advanced settings (FieldAwareFactorizationMachineTrainer) #2219

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

Merged
merged 5 commits into from
Jan 27, 2019

Conversation

abgoswam
Copy link
Member

Towards #1798 .

This PR addresses the following algos

  • FieldAwareFactorizationMachineTrainer

The following changes have been made:

  1. Two public extension methods, one for simple arguments and the other for advanced options
  2. Make constructors internal . Also a few other fields have been made internal
  3. Pass Options objects as arguments instead of Action delegate. Also, added 3 fields to Options for API consistency.
  4. Rename Arguments to Options
  5. Rename Options objects as options (instead of args or advancedSettings used so far)

s.LatentDim = 7;
});
var ffmArgs = new FieldAwareFactorizationMachineTrainer.Options {
FeatureColumn = "Feature1",
Copy link
Member

@wschin wschin Jan 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
FeatureColumn = "Feature1",
FeatureColumn = "Feature1", // Features from the 1st field.
``` #Resolved

});
var ffmArgs = new FieldAwareFactorizationMachineTrainer.Options {
FeatureColumn = "Feature1",
ExtraFeatureColumns = new[] { "Feature2", "Feature3", "Feature4" },
Copy link
Member

@wschin wschin Jan 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ExtraFeatureColumns = new[] { "Feature2", "Feature3", "Feature4" },
ExtraFeatureColumns = new[] { "Feature2", "Feature3", "Feature4" }, // 2nd field's feature column, 3rd field's feature column, 4th field's feature column.``` #Resolved

/// <param name="onFit">A delegate that is called every time the
/// <see cref="Estimator{TInShape, TOutShape, TTransformer}.Fit(DataView{TInShape})"/> method is called on the
/// <see cref="Estimator{TInShape, TOutShape, TTransformer}"/> instance created out of this. This delegate will receive
/// the model that was trained. Note that this action cannot change the result in any way; it is only a way for the caller to
Copy link
Member

@wschin wschin Jan 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the type of the model that was trained? Is it possible to make a reference here? #Resolved

/// The settings here will override the ones provided in the direct method signature,
/// if both are present and have different values.
/// The columns names, however need to be provided directly, not through the <paramref name="advancedSettings"/>.</param>/// <param name="onFit">A delegate that is called every time the
/// <param name="onFit">A delegate that is called every time the
Copy link
Member

@wschin wschin Jan 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we reference the type of the trained model? It's impossible for user to write onFit without knowing its input type. Many thanks. #Resolved

@codecov
Copy link

codecov bot commented Jan 24, 2019

Codecov Report

Merging #2219 into master will increase coverage by 11.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master   #2219       +/-   ##
==========================================
+ Coverage   69.78%   80.8%   +11.01%     
==========================================
  Files         786     159      -627     
  Lines      143945   28504   -115441     
  Branches    16648    1909    -14739     
==========================================
- Hits       100451   23032    -77419     
+ Misses      38951    5175    -33776     
+ Partials     4543     297     -4246
Flag Coverage Δ
#Debug 80.8% <100%> (+11.01%) ⬆️
#production ?
#test 80.8% <100%> (-4.13%) ⬇️

Copy link
Member

@wschin wschin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Copy link
Contributor

@rogancarr rogancarr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎩

@abgoswam abgoswam merged commit fbe65f1 into dotnet:master Jan 27, 2019
@abgoswam abgoswam deleted the abgoswam/action_arguments_ffm branch February 20, 2019 16:59
@ghost ghost locked as resolved and limited conversation to collaborators Mar 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants