[Python] How to use set_config() method of sktime objects

Discussão em 'Python' iniciado por Stack, Junho 12, 2025.

  1. Stack

    Stack Membro Participativo

    I want to perform parallel computing on my ShapeletTransform. According to the documentation, I need to set the backend:parallel flag to 'loky' to activate the parallel method of the class. However, the set_config method accepts "**config_dict" as parameter.

    Here's what I tried:

    y_transformed = y

    y_transformed = pd.DataFrame(y.apply(lambda row: pd.Series(row), axis=1))

    transformer = ShapeletTransform(verbose=1)
    dict_config = {
    "backend:parallel": "default=loky"
    }
    transformer.set_config(dict_config)

    transformer.get_config()

    transformer.fit(X_3d, y_transformed)


    Here's the error:

    TypeError Traceback (most recent call last)
    \<ipython-input-96-2327096163\> in \<cell line: 0\>()
    12 "backend:parallel": "default=loky"
    13 }
    \---\> 14 transformer.set_config(dict_config)
    15 # Get the current configuration
    16 transformer.get_config()


    TypeError: BaseObject.set_config() takes 1 positional argument but 2 were given

    Continue reading...

Compartilhe esta Página