Evalml: НСвозмоТно ΡƒΠΊΠ°Π·Π°Ρ‚ΡŒ Π³ΠΈΠΏΠ΅Ρ€ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹ со списком Π·Π½Π°Ρ‡Π΅Π½ΠΈΠΉ Π² AutoMLSearch

Π‘ΠΎΠ·Π΄Π°Π½Π½Ρ‹ΠΉ Π½Π° 23 ΠΌΠ°Ρ€. 2021  Β·  2ΠšΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΈ  Β·  Π˜ΡΡ‚ΠΎΡ‡Π½ΠΈΠΊ: alteryx/evalml

РСпродукция:

from evalml.demos import load_breast_cancer
from evalml.pipelines import BinaryClassificationPipeline
from evalml.automl import AutoMLSearch

class PipeLine(BinaryClassificationPipeline):
    component_graph = ["Drop Columns Transformer", "Random Forest Classifier"]

X , y = load_breast_cancer()

automl = AutoMLSearch(X, y, problem_type="binary", allowed_pipelines=[PipeLine],
                      pipeline_parameters={"Drop Columns Transformer": {"columns": ["mean texture"]}})
automl.search()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~/sources/evalml/evalml/pipelines/component_graph.py in instantiate(self, parameters)
     77             try:
---> 78                 new_component = component_class(**component_parameters, random_seed=self.random_seed)
     79             except (ValueError, TypeError) as e:

~/sources/evalml/evalml/pipelines/components/transformers/column_selectors.py in __init__(self, columns, random_seed, **kwargs)
     15         if columns and not isinstance(columns, list):
---> 16             raise ValueError(f"Parameter columns must be a list. Received {type(columns)}.")
     17 

ValueError: Parameter columns must be a list. Received <class 'str'>.

The above exception was the direct cause of the following exception:

ValueError                                Traceback (most recent call last)
<ipython-input-21-b4819258a317> in <module>
     10 automl = AutoMLSearch(X, y, problem_type="binary", allowed_pipelines=[PipeLine],
     11                       pipeline_parameters={"Drop Columns Transformer": {"columns": ["mean texture"]}})
---> 12 automl.search()

~/sources/evalml/evalml/automl/automl_search.py in search(self, show_iteration_plot)
    490         logger.info("Allowed model families: %s\n" % ", ".join([model.value for model in self.allowed_model_families]))
    491         self.search_iteration_plot = None
--> 492         if self.plot:
    493             self.search_iteration_plot = self.plot.search_iteration_plot(interactive_plot=show_iteration_plot)
    494 

~/sources/evalml/evalml/automl/automl_algorithm/iterative_algorithm.py in next_batch(self)
     63         next_batch = []
     64         if self._batch_number == 0:
---> 65             next_batch = [pipeline_class(parameters=self._transform_parameters(pipeline_class, {}), random_seed=self.random_seed)
     66                           for pipeline_class in self.allowed_pipelines]
     67 

~/sources/evalml/evalml/automl/automl_algorithm/iterative_algorithm.py in <listcomp>(.0)
     63         next_batch = []
     64         if self._batch_number == 0:
---> 65             next_batch = [pipeline_class(parameters=self._transform_parameters(pipeline_class, {}), random_seed=self.random_seed)
     66                           for pipeline_class in self.allowed_pipelines]
     67 

~/sources/evalml/evalml/pipelines/classification_pipeline.py in __init__(self, parameters, random_seed)
     23         """
     24         self._encoder = LabelEncoder()
---> 25         super().__init__(parameters, random_seed=random_seed)
     26 
     27     def fit(self, X, y):

~/sources/evalml/evalml/pipelines/pipeline_base.py in __init__(self, parameters, random_seed)
     77         else:
     78             self._component_graph = ComponentGraph(component_dict=self.component_graph, random_seed=self.random_seed)
---> 79         self._component_graph.instantiate(parameters)
     80 
     81         self.input_feature_names = {}

~/sources/evalml/evalml/pipelines/component_graph.py in instantiate(self, parameters)
     80                 self._is_instantiated = False
     81                 err = "Error received when instantiating component {} with the following arguments {}".format(component_name, component_parameters)
---> 82                 raise ValueError(err) from e
     83 
     84             component_instances[component_name] = new_component

ValueError: Error received when instantiating component Drop Columns Transformer with the following arguments {'columns': 'mean texture'}

IterativeAlgorithm Π²Ρ‹Π±ΠΈΡ€Π°Π΅Ρ‚ ΠΏΠ΅Ρ€Π²Ρ‹ΠΉ элСмСнт списка columns ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΉ Π½Π΅ являСтся ΠΏΡ€Π΅Π΄ΠΏΠΎΠ»Π°Π³Π°Π΅ΠΌΡ‹ΠΌ ΠΏΠΎΠ²Π΅Π΄Π΅Π½ΠΈΠ΅ΠΌ.

Π‘Π°ΠΌΡ‹ΠΉ ΠΏΠΎΠ»Π΅Π·Π½Ρ‹ΠΉ ΠΊΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΉ

@dsherry @chukarsten

Π’ # 1862 ΠΏΠ»Π°Π½ состоит Π² Ρ‚ΠΎΠΌ, Ρ‡Ρ‚ΠΎΠ±Ρ‹ Π΄ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ Drop Columns Transformer Π² _get_preprocessing_components ΠΊΠΎΠ³Π΄Π° столбСц индСкса сущСствуСт, Π° Π·Π°Ρ‚Π΅ΠΌ Π΄ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ эти столбцы Π² self. pipeline_parameters Ρ‡Ρ‚ΠΎΠ±Ρ‹ эта ΠΏΡ€ΠΎΠ±Π»Π΅ΠΌΠ° Ρ‚Π°ΠΊΠΆΠ΅ Π±Π»ΠΎΠΊΠΈΡ€ΠΎΠ²Π°Π»Π° Π΅Π³ΠΎ.

ВсС 2 ΠšΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΉ

Π­Ρ‚Π° ΠΏΡ€ΠΎΠ±Π»Π΅ΠΌΠ° Π²ΠΎΠ·Π½ΠΈΠΊΠ°Π΅Ρ‚, ΠΊΠΎΠ³Π΄Π° IterativeAlgorithm Π²Ρ‹Π·Ρ‹Π²Π°Π΅Ρ‚ _transform_parameters ΠΈ пытаСтся Ρ€Π°ΡΠΏΠ°ΠΊΠΎΠ²Π°Ρ‚ΡŒ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹. Π­Ρ‚ΠΎΡ‚ ΠΊΠΎΠ΄ Π±Ρ‹Π» Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ Π² адрСс, ΠΊΠΎΠ³Π΄Π° ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒ ΠΏΠ΅Ρ€Π΅Π΄Π°Π΅Ρ‚ pipeline_parameters Ρ‡Ρ‚ΠΎΠ±Ρ‹ Π·Π°ΠΌΠΎΡ€ΠΎΠ·ΠΈΡ‚ΡŒ ΠΈΠ»ΠΈ ΡƒΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚ΡŒ Π³ΠΈΠΏΠ΅Ρ€ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹ для ΠΎΠΏΡ€Π΅Π΄Π΅Π»Π΅Π½Π½ΠΎΠ³ΠΎ подмноТСства. НапримСр:

    params = {'Imputer': {'numeric_impute_strategy': ['median', 'most_frequent']},
              'Decision Tree Regressor': {'max_depth': [17, 18, 19], 'max_features': Categorical(['auto'])},
              'Elastic Net Regressor': {"alpha": Real(0, 0.5), "l1_ratio": (0.01, 0.02, 0.03)}}
    automl = AutoMLSearch(X_train=X, y_train=y, problem_type='regression', pipeline_parameters=params, n_jobs=1)
    automl.search()

Π’ ΠΏΠ΅Ρ€Π²ΠΎΠΌ ΠΏΠ°ΠΊΠ΅Ρ‚Π΅ Π² _transform_parameters для ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚ΠΊΠΈ Π²Ρ…ΠΎΠ΄Π½Ρ‹Ρ… Π΄Π°Π½Π½Ρ‹Ρ… списка, Ρ‚Π°ΠΊΠΈΡ… ΠΊΠ°ΠΊ max_depth ΠΈΠ»ΠΈ numeric_impute_strategy Π²Ρ‹ΡˆΠ΅, ΠΌΡ‹ просто Π²Ρ‹Π±ΠΈΡ€Π°Π΅ΠΌ ΠΈΠ»ΠΈ ΠΏΡ€ΠΎΠ±ΡƒΠ΅ΠΌ ΠΏΠ΅Ρ€Π²Ρ‹ΠΉ элСмСнт Π² спискС.

Π’Π°ΠΊΠΈΠΌ ΠΎΠ±Ρ€Π°Π·ΠΎΠΌ, ΠΎΠ΄ΠΈΠ½ ΠΈΠ· способов Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ этой ΠΏΡ€ΠΎΠ±Π»Π΅ΠΌΡ‹ - ΡƒΠ΄Π°Π»ΠΈΡ‚ΡŒ эту строку ΠΈ Π·Π°ΠΏΡ€Π΅Ρ‚ΠΈΡ‚ΡŒ использованиС списков.

@dsherry @freddyaboulton @ bchen1116 @chukarsten К Π²Π°ΡˆΠ΅ΠΌΡƒ свСдСнию :)

@dsherry @chukarsten

Π’ # 1862 ΠΏΠ»Π°Π½ состоит Π² Ρ‚ΠΎΠΌ, Ρ‡Ρ‚ΠΎΠ±Ρ‹ Π΄ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ Drop Columns Transformer Π² _get_preprocessing_components ΠΊΠΎΠ³Π΄Π° столбСц индСкса сущСствуСт, Π° Π·Π°Ρ‚Π΅ΠΌ Π΄ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ эти столбцы Π² self. pipeline_parameters Ρ‡Ρ‚ΠΎΠ±Ρ‹ эта ΠΏΡ€ΠΎΠ±Π»Π΅ΠΌΠ° Ρ‚Π°ΠΊΠΆΠ΅ Π±Π»ΠΎΠΊΠΈΡ€ΠΎΠ²Π°Π»Π° Π΅Π³ΠΎ.

Π‘Ρ‹Π»Π° Π»ΠΈ эта страница ΠΏΠΎΠ»Π΅Π·Π½ΠΎΠΉ?
0 / 5 - 0 Ρ€Π΅ΠΉΡ‚ΠΈΠ½Π³ΠΈ