Skip to content

sklearn.base.clone doesn't copy kernel_function #786

@bwhite

Description

@bwhite

Example of the problem

>>> a=sklearn.svm.SVC(kernel=lambda x, y: None)
>>> a.kernel_function
<function <lambda> at 0xa769aac>
>>> sklearn.base.clone(a).kernel_function
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'SVC' object has no attribute 'kernel_function'

This makes it so that cross_validation_score can't operate on estimators with custom kernels.

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