Skip to content

Improve error message for missing ConcatFeatures #663

Description

@hirzel

The Lale & combinator is most commonly used with ConcatFeatures. If a pipeline accidentally pipes the output of & directly into an operator that does not expect it, Lale should report a helpful error message for how to fix that mistake. For example, consider the following code:

X, y = load_iris(return_X_y=True)
trainable = (PCA() & NoOp) >> LogisticRegression()
trained = trainable.fit(X, y)

This produces the following error from sklearn:

ValueError: Found array with dim 3. Estimator expected <= 2.

Or, when used with lale.settings.set_disable_data_schema_validation(False), it produces the following error from Lale:

ValueError: LogisticRegression.fit() invalid X, the schema of the actual data is not a subschema of the expected schema of the argument.

It would be nice if the error message would provide the clue to the solution, which would be something like this:

from lale.lib.lale import ConcatFeatures
(PCA() & NoOp) >> ConcatFeatures >> LogisticRegression()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions