-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Improve _EstimatorPrettyPrinter to use an indentation style a bit more consistent with black #21240
Copy link
Copy link
Open
Description
The current indentation style used in _EstimatorPrettyPrinter is too horizontal and suboptimal rendering of complex pipelines and column transformers in the notebook HTML widgets. See for instance:
I think using a more vertical indentation style would help (and would furthermore be more consistent with the black formatting we use in our code base):
For this specific example black might over-do it a bit (see below) although I still find it better than what we currently have.
Pipeline(
steps=[
(
"preprocessor",
ColumnTransformer(
transformers=[
(
"num",
Pipeline(
steps=[
("imputer", SimpleImputer(strategy="median")),
("scaler", StandardScaler()),
]
),
["age", "fare"],
),
(
"cat",
OneHotEncoder(handle_unknown="ignore"),
["embarked", "sex", "pclass"],
),
]
),
),
("classifier", LogisticRegression()),
]
)Or maybe we could find a middle ground?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Discussion
