Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message for missing ConcatFeatures #663

Open
hirzel opened this issue Apr 8, 2021 · 0 comments
Open

Improve error message for missing ConcatFeatures #663

hirzel opened this issue Apr 8, 2021 · 0 comments

Comments

@hirzel
Copy link
Member

hirzel commented Apr 8, 2021

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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant