Skip to content

Replace SubComponent with IComponentFactory #585

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

Closed
eerhardt opened this issue Jul 26, 2018 · 1 comment
Closed

Replace SubComponent with IComponentFactory #585

eerhardt opened this issue Jul 26, 2018 · 1 comment
Assignees
Milestone

Comments

@eerhardt
Copy link
Member

When a component is structured in a way that it can use some other component, we are currently using a SubComponent object to specify which other component to use. For example, our One-Versus-All (Ova) class can turn any binary classifier into a multi-class classifier. So it has a SubComponent PredictorType field on its Arguments class, and users can specify which binary classifier that Ova should use.

The issues with SubComponent are:

  1. They depend on Dependency Injection in order to create the object.
  2. They use "magic strings" in order to create the object (since SubComponents are just strings to tell the DI system how to create the object).

In our main API, we shouldn't be using magic strings, or dependency injection, when you can simply just create objects, or delegates/factories, like a normal OOP API would work.

@Zruty0 Zruty0 mentioned this issue Jul 26, 2018
8 tasks
@eerhardt eerhardt self-assigned this Jul 27, 2018
@shauheen shauheen added this to the 0818 milestone Aug 4, 2018
eerhardt added a commit to eerhardt/machinelearning that referenced this issue Aug 15, 2018
eerhardt added a commit to eerhardt/machinelearning that referenced this issue Aug 17, 2018
eerhardt added a commit to eerhardt/machinelearning that referenced this issue Aug 17, 2018
eerhardt added a commit that referenced this issue Aug 17, 2018
* Convert Ensemble stacking SubComponent to IComponentFactory.

* Replace SubComponent with IComponentFactory in ML.Ensemble

Working towards #585

* Convert SimpleComponentFactory classes to ComponentFactoryUtils static class.

* Move Stacking arguments abstract properties to internal get methods.

This reduces the public surface area.
eerhardt added a commit to eerhardt/machinelearning that referenced this issue Aug 20, 2018
eerhardt added a commit to eerhardt/machinelearning that referenced this issue Aug 20, 2018
eerhardt added a commit that referenced this issue Aug 24, 2018
#700)

* Replace all ML.Transforms SubComponent usages with IComponentFactory.

Working towards #585

* PR feedback
@shauheen shauheen modified the milestones: 0818, 0918 Aug 31, 2018
eerhardt added a commit to eerhardt/machinelearning that referenced this issue Sep 4, 2018
eerhardt added a commit to eerhardt/machinelearning that referenced this issue Sep 7, 2018
eerhardt added a commit that referenced this issue Sep 8, 2018
Follow up for some PR feedback from the PipelineInference removal of SubComponent.

Working towards #585
@eerhardt
Copy link
Member Author

eerhardt commented Sep 8, 2018

This work is now complete. SubComponent no longer exists in ML.NET.

@eerhardt eerhardt closed this as completed Sep 8, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants