Moving transformer in TreatmentExpansionMixin
Open
@kbattocchi is already working on this.
Since Nov 11, 2019.
enhancement
- Dominant language
- Jupyter Notebook
- Stars
- 4.8k
- Forks
- 827
- PR merge metrics
- No merged PRs in 30d
Description
It seems that all of the classes the inherit from the TreatmentExpansionMixin so as to perform discrete treatment expansion, are doing the exact same transformer:
self._label_encoder = LabelEncoder()
self._one_hot_encoder = OneHotEncoder(categories='auto', sparse=False)
self.transformer = FunctionTransformer(
func=(lambda T:
self._one_hot_encoder.transform(
self._label_encoder.transform(T).reshape(-1, 1))[:, 1:]),
validate=False)
Shouldn't this piece of code move there? Or at least we can have a subclass called DiscreteTreatmentExpansionMixin, which is specific to this type of transformer and move this code there. It used to be that the OrthoForest was doing sth different, but this was a bug. Now it is doing exactly the same.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.