-
Notifications
You must be signed in to change notification settings - Fork 1.9k
WIP: Refactoring of ColumnOptions for ImagePixelExtractor #2893
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
Codecov Report
@@ Coverage Diff @@
## master #2893 +/- ##
==========================================
- Coverage 71.81% 71.8% -0.01%
==========================================
Files 812 812
Lines 142644 142635 -9
Branches 16090 16089 -1
==========================================
- Hits 102433 102424 -9
- Misses 35828 35840 +12
+ Partials 4383 4371 -12
|
@@ -15,7 +15,7 @@ | |||
|
|||
namespace Microsoft.ML.Data | |||
{ | |||
internal abstract class SourceNameColumnBase | |||
public abstract class SourceNameColumnBase | |||
{ | |||
[Argument(ArgumentType.AtMostOnce, HelpText = "Name of the new column", ShortName = "name")] | |||
public string Name; |
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.
Name [](start = 22, length = 4)
The names will have to change in accordance with the conclusion of #2064, but let's have agreement on the general approach first. (If we don't also want the entry-points to change yet, remember the Name
property on the attribute.)
{ | ||
[Argument(ArgumentType.Multiple | ArgumentType.Required, HelpText = "New column definition(s) (optional form: name:src)", Name = "Column", ShortName = "col", SortOrder = 1)] | ||
public ImagePixelExtractingEstimator.ColumnOptions[] Columns; | ||
|
||
[Argument(ArgumentType.AtMostOnce, HelpText = "Whether to use alpha channel", ShortName = "alpha")] | ||
public bool? UseAlpha; |
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.
UseAlpha [](start = 25, length = 8)
These are a little funky. In entry-point land, and command line land, there would be the arguments to the transform, and then the arguments to each column that could potentially override it, which is why they are nullable. But, in this land, there's no particular reason for them to be nullable. So, I kind of feel like this is not really well suited to the purpose. Indeed I might wonder if it really is worth it?
So I'm not sure about this. It seems like the existing column structure (being nullable to allow overrides of more global options which don't exist in our interface) don't quite work. Also this particular example brings up the case that not all transformers practically benefit from this "multi-column mapping" idiom that we felt like we had to obey in the command line (since a universal interface there was more essential). Also the size of the change makes me worried this is way too much to take on prior to v1, even if we were to take this on prior to v1. What you think about just hiding the things for now, including the |
I agree that changing the behavior of the command line and the entrypoint API is such a fashion is too significant to be a valid option before V1. I will close this PR. |
Related to #2884.
The change does the following things:
ColumnInfos
and moves it to the transformerColumn
class and renames itColumnOptions
ColumnOptions
, renames those that did not match the public APIColumnOptions
classThe overall behavior of the Estimator/Transformer API is unchanged (besides the use of the new mutable class).
However, this change alters the entrypoints API behavior in the following way.
Past behavior:
After this change:
I would also like to change the name of the input and output columns (in
SourceNameColumnBase
) to something more appropriate thanName
andSource
, but since that will touch a lot of files, I would like some feedback on the approach first.