alteryx / alteryx/evalml

Coordinate equivalent output from `component_dict` across list and dict inputs

Offen
#2,836 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
good first issue refactor
Vorherrschende Sprache
Python
Sterne
850
Forks
96
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Currently if a list is passed as a `component_graph` to a pipeline, the `component_dict` outputs the class object as the first item in the value of the list within `_make_component_dict_from_component_list`
```
class LinearRegressionPipeline(RegressionPipeline):
"""Linear Regression Pipeline for regression problems."""

component_graph = [
"One Hot Encoder",
"Imputer",
"Standard Scaler",
"Linear Regressor",
]
custom_name = "Linear Regression Pipeline"

def __init__(self, parameters, random_seed=0):
super().__init__(
self.component_graph,
parameters=parameters,
custom_name=self.custom_name,
random_seed=random_seed,
)

pipeline_ = LinearRegressionPipeline({})
print(pipeline_.component_graph.component_dict)
----------------------------------------------------------
{'Imputer': [,
'One Hot Encoder.x',
'y'],
'Linear Regressor': [,
'Standard Scaler.x',
'y'],
'One Hot Encoder': [,
'X',
'y'],
'Standard Scaler': [,
'Imputer.x',
'y']}
```

If a dictionary is passed, then the name of the component is passed instead since the `component_graph` is passed directly to the `ComponentGraph` class
```
component_graph = {
"Imputer": ["Imputer", "X", "y"],
"Target Imputer": ["Target Imputer", "X", "y"],
"OneHot_RandomForest": ["One Hot Encoder", "Imputer.x", "Target Imputer.y"],
"OneHot_ElasticNet": ["One Hot Encoder", "Imputer.x", "y"],
"Random Forest": ["Random Forest Classifier", "OneHot_RandomForest.x", "y"],
"Elastic Net": ["Elastic Net Classifier", "OneHot_ElasticNet.x", "y"],
"Logistic Regression": [
"Logistic Regression Classifier",
"Random Forest.x",
"Elastic Net.x",
"y",
],
}
----------------------------------------------------------
{'Elastic Net': ['Elastic Net Classifier', 'OneHot_ElasticNet.x', 'y'],
'Imputer': ['Imputer', 'X', 'y'],
'Logistic Regression': ['Logistic Regression Classifier',
'Random Forest.x',
'Elastic Net.x',
'y'],
'OneHot_ElasticNet': ['One Hot Encoder', 'Imputer.x', 'y'],
'OneHot_RandomForest': ['One Hot Encoder', 'Imputer.x', 'Target Imputer.y'],
'Random Forest': ['Random Forest Classifier', 'OneHot_RandomForest.x', 'y'],
'Target Imputer': ['Target Imputer', 'X', 'y']}
```

Since `component_dict` is easily accessible for OS users, this should be standardized.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.