Skip to content
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

Train FieldAwareFactorizationMachines without providing arguments #2931

Merged
merged 6 commits into from
Mar 13, 2019
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,29 @@ namespace Microsoft.ML
/// </summary>
public static class FactorizationMachineExtensions
{
/// <summary>
/// Predict a target using a field-aware factorization machine algorithm.
Copy link
Member

@wschin wschin Mar 12, 2019

Choose a reason for hiding this comment

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

Please add Note that because there is only one feature column, the underlying model is equivalent to standard factorization machine. #Resolved

/// </summary>
/// <param name="catalog">The binary classification catalog trainer object.</param>
/// <param name="featureColumnName">The name of the feature column.</param>
/// <param name="labelColumnName">The name of the label column.</param>
/// <param name="exampleWeightColumnName">The name of the example weight column (optional).</param>
/// <example>
/// <format type="text/markdown">
/// <![CDATA[
/// [!code-csharp[FieldAwareFactorizationMachine](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/FieldAwareFactorizationMachine.cs)]
/// ]]></format>
Copy link
Member

@sfilipi sfilipi Mar 13, 2019

Choose a reason for hiding this comment

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

Does this sample illustrate this API, or one of the other ones below? This first one and the second are failry similar, but the third API is a bit different; idk if it will get confusing. #Resolved

/// </example>
public static FieldAwareFactorizationMachineBinaryClassificationTrainer FieldAwareFactorizationMachine(this BinaryClassificationCatalog.BinaryClassificationTrainers catalog,
string featureColumnName = DefaultColumnNames.Features,
Copy link
Member

@wschin wschin Mar 12, 2019

Choose a reason for hiding this comment

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

A test please. #Resolved

string labelColumnName = DefaultColumnNames.Label,
string exampleWeightColumnName = null)
{
Contracts.CheckValue(catalog, nameof(catalog));
var env = CatalogUtils.GetEnvironment(catalog);
return new FieldAwareFactorizationMachineBinaryClassificationTrainer(env, new string[] { featureColumnName }, labelColumnName, exampleWeightColumnName);
}

/// <summary>
/// Predict a target using a field-aware factorization machine algorithm.
/// </summary>
Expand Down