Skip to content

_add_training_data and _fit_on_new does not work with custom data types #49

@jangedoo

Description

@jangedoo

I have a sklearn pipeline that accepts custom data type as input but it when I use that pipeline and teach the learner, I get the following error
TypeError: float() argument must be a string or a number, not 'MyClass'

I traced the problem back to check_X_y function used in BaseLearner. I added dtype=None so that it preserves the input type instead of trying to convert it to a numeric and it didn't throw any errors and works as expected.

I think that behaviour should be expected instead of it trying to convert our data types for us.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions