8000 Should cloning create equal parameters · Issue #8023 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
Should cloning create equal parameters #8023
Closed
@amueller

Description

@amueller

I'm trying to make our common tests work on instances instead of classes in #8022 - this is a prerequisite to implement instance-level estimator tags and get rid of the hard-coded classes.
I ran into an interesting issue.

Instead of instantiating an estimator, I clone it. I expected that parameters after cloning are equal (==) to before cloning. They are not.

from sklearn.cluster import AgglomerativeClustering
from sklearn.base import clone

agg = AgglomerativeClustering()
agg2 = clone(agg)

agg.memory == agg2.memory

False

Question: should this condition be true? I think it's not actually an issue for changing the tests, but it seemed somewhat weird to me.

ping @GaelVaroquaux @jnothman @agramfort

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0