Skip to content

WeightColumn name defaults to "Weights" in one of the constructors of the estimators #1065

@artidoro

Description

@artidoro

Estimators that are instantiated through MAML without specifying a weightcolumn are instead created with default weightcolumn named "Weights".

More details:
The constructor for estimator objects that is used by MAML takes an Arguments object, which has a weight column name that defaults to "Weights". To be precise it defaults to an Optional with implicit value of "Weights".

When we instantiate the estimator through that constructor, we need to pass a SchemaShape.Column object to the base class TrainerEstimatorBase. This column is in most cases constructed with a method that takes the column name as specified in the Arguments object. As the default value in the Arguments object is not null, it is "Weights", this method does not return null, but returns a new SchemaShape.Column named Weights.

The rational:
The new API's rational is as follows:

  1. the user needs to specify a weight column name, if the name is not null we check the presence of the column
  2. if the user does not define a weight column name (it is null), we assume there is no weight column

The old MAML's rational:

  1. same as above
  2. if the user does not specify a weight column name:
    • if there is a column named "Weights" it will be taken as the weights column automatically
    • if there is no column name "Weights", we assume that there is no weight column

What we have to do:
We have to fix the current instantiation of estimators through MAML, and decide if we want to continue using a different behavior for the command line and the C# API.

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

Issue actions