Skip to content

Command-line oriented arguments, that have more suitable alternatives for the API should be made internal #2133

Closed
@sfilipi

Description

@sfilipi

In the arguments classes there are several arguments that get translated to the same parameter for the estimators/transforms.

One of the variant is a convenience for the command line version of ML.Net.

I think those can be made internal, and kept away from the user for v1.

Example:

ValueToKeyMappingTransformer.ArgumentsBase

public abstract class ArgumentsBase : TransformInputBase
{
     [Argument(ArgumentType.AtMostOnce, HelpText = "Maximum number of terms to keep per column when auto-training", ShortName = "max", SortOrder = 5)]
      public int MaxNumTerms = ValueToKeyMappingEstimator.Defaults.MaxNumTerms;

      [Argument(ArgumentType.AtMostOnce, HelpText = "Comma separated list of terms", SortOrder = 105, Visibility = ArgumentAttribute.VisibilityType.CmdLineOnly)]
      public string Terms;

      [Argument(ArgumentType.AtMostOnce, HelpText = "List of terms", SortOrder = 106, Visibility = ArgumentAttribute.VisibilityType.EntryPointsOnly)]
      public string[] Term;

I don't think our API users should see the first

public string Terms

Activity

najeeb-kazmi

najeeb-kazmi commented on Jan 12, 2019

@najeeb-kazmi
Member

The other two occurrences of this are:

CustomStopWordsRemovingTransform.ArgumentsBase

        public abstract class ArgumentsBase
        {
            [Argument(ArgumentType.AtMostOnce, HelpText = "Comma separated list of stopwords", Visibility = ArgumentAttribute.VisibilityType.CmdLineOnly)]
            public string Stopwords;

            [Argument(ArgumentType.AtMostOnce, HelpText = "List of stopwords", Visibility = ArgumentAttribute.VisibilityType.EntryPointsOnly)]
            public string[] Stopword;

and

TermLoaderArguments

    public sealed class TermLoaderArguments
    {
        [Argument(ArgumentType.AtMostOnce, HelpText = "Comma separated list of terms", SortOrder = 1, Visibility = ArgumentAttribute.VisibilityType.CmdLineOnly)]
        public string Terms;


        [Argument(ArgumentType.AtMostOnce, HelpText = "List of terms", SortOrder = 1, Visibility = ArgumentAttribute.VisibilityType.EntryPointsOnly)]
        public string[] Term;
Zruty0

Zruty0 commented on Jan 13, 2019

@Zruty0
Contributor

I would say that the name Term for a 'list of terms' is not ideal either.

added
APIIssues pertaining the friendly API
on Jan 14, 2019
glebuk

glebuk commented on Jan 25, 2019

@glebuk
Contributor

Related to #2079 and #2041

artidoro

artidoro commented on Jan 30, 2019

@artidoro
Contributor

After further investigating, it seems that the above Arguments classes should be made internal. They are only used by the entrypoints API. We are using other objects to set the parameters of the estimators (either direct definition of the parameters in the constructors, or through a ColumnInfo object).

artidoro

artidoro commented on Feb 13, 2019

@artidoro
Contributor

The only transform that still has public Options class (former Arguments class) is the TensorFlowTransformer and it does not have command line oriented arguments.

The remaining transform either use the ColumnInfo object or don't have advanced settings that cannot be set from the constructor directly. So we have made the Options class internal in those cases.

This issue can therefore be considered closed.

ghost locked as resolved and limited conversation to collaborators on Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

APIIssues pertaining the friendly API

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @artidoro@najeeb-kazmi@sfilipi@glebuk@Zruty0

      Issue actions

        Command-line oriented arguments, that have more suitable alternatives for the API should be made internal · Issue #2133 · dotnet/machinelearning