automatminer icon indicating copy to clipboard operation
automatminer copied to clipboard

Bug when passing config_dict to TPOTAdapter

Open janosh opened this issue 6 years ago • 2 comments

This minimal example demonstrates that passing a config_dict to TPOTAdaptor as shown in the docstring fails.

import automatminer as amm
import pandas as pd

df = pd.DataFrame(pd.np.random.randint(0, 10, (10, 4)), columns=list("abcd"))

tpot_config = {
    "sklearn.ensemble.RandomForestRegressor": {
        "n_estimators": [100],
        "max_features": pd.np.arange(0.05, 1.01, 0.05),
        "min_samples_split": range(2, 21),
        "min_samples_leaf": range(1, 21),
        "bootstrap": [True, False],
    }
}

pipe_config = lambda: {
    **amm.get_preset_config(),
    "learner": amm.TPOTAdaptor(max_time_mins=1, config_dict=tpot_config),
}

mat_pipe = amm.MatPipe(**pipe_config())
mat_pipe.fit(df, "a")

The error I get is

RuntimeError: There was an error in the TPOT optimization process.
This could be because the data was not formatted properly, or because
data for a regression problem was provided to the TPOTClassifier object.
Please make sure you passed the data to TPOT correctly.

janosh avatar Nov 25 '19 16:11 janosh

Hey @janosh thanks for reporting! Yeah that is definitely not the intended behavior. Let me look into it and Ill report back in this thread.

ardunn avatar Nov 25 '19 19:11 ardunn

Different topic but not sure this warrants a new issue. The docs state:

If you want to ensure your features are used for learning, see the section on customizing pipelines.

But then the Customizing pipelines section doesn't go on to show how to do this. Am I missing something?

janosh avatar Nov 26 '19 10:11 janosh