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
[ENH] sktime-pywatts integration - __call__
dunder design
#2654
Comments
FYI, this may interest you, @miraep8, due to connection with dunders/pipelines. |
Concerning the second bullet point, I just had an idea to make the # CASE 1: The bases contain the JointAPIBase since the package some_non_installed is not installed
class OtherBases():
def print_1(self):
print(1)
class JointAPIBase():
def print_2(self):
print(2)
try:
import os # some_non_installed
bases = [JointAPIBase, OtherBases]
except ImportError as error:
bases = [OtherBases]
class BaseSKtime(*bases):
pass
bar = BaseSKtime()
bar.print_1()
try:
bar.print_2()
except Exception:
pass
# CASE 2: The bases does not contain the JointAPIBase since the package some_non_installed is not installed
try:
import some_non_installed
bases = [JointAPIBase, OtherBases]
except ImportError as error:
bases = [OtherBases]
class BaseSKtime(*bases):
pass
bar = BaseSKtime()
bar.print_1()
try:
bar.print_2()
except Exception:
print("Print2 does not exist")
pass
|
Added material: from hackmd on June 14, we extracted four design decision elements:
|
some incomplete opinions on pros/cons
|
Ideas
|
Thoughts
|
|
(c) regarding subsetting:
(d) Here is an idea:
|
thoughts on "pipelining fitted models". this could be done using a
The serialized model arg to the init is polymorphic, and could be:
So, I would stick to the |
@miraep8, could you be more concrete of how your implementation to "load fitted parameters" would work? |
design study of |
I checked out the I guess one question is - I suppose the 'model' that we are fitting/reloading will be a |
Ahhh, I see. The advantage of having the I guess this could get us to a separate question of - if a part of the model is already fitted, we could skip re-fitting it, and instead only update the fitted parameters if But I understand the design choice better now of making a new class. |
Not necessarily - could be simply a neural network with a
We could, but that feels a bit like "a class that does too many things". The pattern also does not seem
In the class I wrote, |
Note from @kalebphipps
|
|
from entire discussion, identified design point not dealt with: if
possible choice for dealing with "intermediate" pipelines:
|
here's a suggestion on this question:
I think a good solution would be the following:
|
…ing (#2907) This PR adds column subsetting functionality to transformers via the `[ ]` (`__getitem__`) dunder. Similar to how this works in `pywatts`, using the `[ ]` dunder will change any transformer to additionally subsetting columns of outputs (first key) and/or inputs (second key). This is done by pipelining with the existing `ColumnSelect` transformer, using the existing `TransformerPipeline`. Examples: `my_trafo["a"]` is shorthand for `ColumnSelect("a") * my_trafo`, which in turn is shorthand for `TransformerPipeline([ColumnSelect("a"), my_trafo])` `my_trafo[idx1, idx2]` is shorthand for `ColumnSelect(idx1) * my_trafo * ColumnSelect(idx2)`, which in turn is shorthand for `TransformerPipeline([ColumnSelect(idx1), my_trafo, ColumnSelect(idx2)])` Includes tests. Relies on: * #2906, so subsetting like `my_trafo["a"]` is valid (same as `my_trafo[["a"]]`) * #2958, for an example where input subsetting and output subsetting do not commute * #2959, since vectorization for the `ThetaLinesTransformer` in a pipeline was not working Credit to `pywatts` for the idea - thanks, @benHeid, @SMEISEN, @kalebphipps! Also see discussion here: #2654
We decided to use a design without the Feel free to reopen it, if you disagree. |
Part of pywatts integration design questions.
pywatts
has a nicekeras
-like__call__
dunder syntax for creating pipelines.It is, however, not entirely clear:
__call__
should live directly insktime
, or inpywatts
. If not insktime
, how could it possibly work after import?Some preliminary thoughts are in this document: https://github.com/sktime/community-org/blob/main/meetups/previous_meetings/20220506-pywatts.md
FYI @aiwalter
The text was updated successfully, but these errors were encountered: