machinelearning icon indicating copy to clipboard operation
machinelearning copied to clipboard

Create convenience constructor for the Transforms (workitem related to #371)

Open zeahmed opened this issue 8 years ago • 2 comments

This work item is related to the new API proposal #371

Following is the initial list of transforms that will be implemented to gather feedback.

  • BootstrapSampleTransform
  • CategoricalHashTransform
  • CategoricalTransform
  • ConcatTransform
  • CopyColumnsTransform
  • CountFeatureSelection
  • DropColumnsTransform
  • LpNormNormalizerTransform
  • NAFilter
  • NormalizeTransform

There are different ways to create a public facing API for these transforms based on their class definition.

Add Convenience constructor directly to the transform class.

It is only possible for following type of transforms.

  • BootstrapSampleTransform
  • ConcatTransform
  • NAFilter

Add Create method (a helper method) for transforms that have Create method already implemented.

This is possible for following transforms.

  • CategoricalHashTransform
  • CategoricalTransform
  • CopyColumnsTransform
  • CountFeatureSelection

Add CreateX method (a helper method) for all possible use case of a transform where X is the name of the operation.

This is because one transform can instantiated for multiple purpose based on the argument e.g.

  • DropColumnTransform (can be instantiated for dropping or keeping columns)
  • LpNormNormalizerTransform (can be instantiated for LpNorm or GCNorm)
  • NormalizerTransform (can be instantiated for MinMax, Mean-Var, LogMean etc.)

zeahmed avatar Jun 20 '18 00:06 zeahmed

@TomFinley, can you please comment on what would be the best way to move forward for all the three cases above?

zeahmed avatar Jun 20 '18 23:06 zeahmed

HI @zeahmed , I think I generally like that plan at least to start. I feel like direct construction where possible is the best option, because that makes sense: you're instantiating a transform. The Create semantics are nice where possible as well. (Meta-transforms are what I see in this list, which makes sense.) And in cases where a transform can be instantiated with multiple argument classes (e.g., normalizers), then your plan for CreateX makes sense.

Just my thoughts.

TomFinley avatar Jun 22 '18 03:06 TomFinley