# Transform several columns of an MLJ model using one transformer

**URL:** <https://discourse.julialang.org/t/transform-several-columns-of-an-mlj-model-using-one-transformer/105338>\
**Category:** Machine Learning\
**Tags:** question, package, mlj\
**Created:** [October 24, 2023, 7:17am UTC](https://discourse.julialang.org/t/transform-several-columns-of-an-mlj-model-using-one-transformer/105338 "2023-10-24T07:17:05Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![ablaom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ablaom/32/4889_2.png) [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Post date:** [October 30, 2023, 2:32am UTC](https://discourse.julialang.org/t/transform-several-columns-of-an-mlj-model-using-one-transformer/105338/13 "2023-10-30T02:32:20Z")

</div>

Not currently. The main issues are:

1. ( **abstract type roadblock** ) MLJModelInterface requires new algorithms to subtype an abstract type owned by MLJModelInterface (`Unsupervised` or `Static`) but TableTransforms.jl, as I understand it, is trying for a pure functional interface, and without depending on externally owned types.

2. ( **limitation on functionality** ) The MLJTuning.jl API for tuning models is based on mutation of the hyperparameter struct, and so not suited to TableTransforms.jl transformer structs, which are immutable. This currently rules out optimization of transformer hyperparameters in MLJ pipelines.

One day MLJ may rid itself of its abstract model type hierarchy (for efforts in this direction, see [this announcement](https://discourse.julialang.org/t/ann-learnapi-jl-proposal-for-a-basement-level-machine-learning-api/93048/1)). However, it is substantially embedded in the ecosystem and unlikely to disappear in the near future.

A simple, but unattractive, solution to 1. would be for MLJModels.jl or TableTransforms.jl to provide a wrapper. The only way I can think of to avoid the wrapper in the status quo would require metaprogramming hacks that would likely be brittle.

---

_[View the full topic](https://discourse.julialang.org/t/transform-several-columns-of-an-mlj-model-using-one-transformer/105338)._
